@su-record/vibe 3.0.0 → 3.1.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 (341) hide show
  1. package/hooks/scripts/__tests__/.vibe/command-log.txt +3 -78
  2. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  3. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  4. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  5. package/hooks/scripts/__tests__/clone-behaviors.test.js +64 -0
  6. package/hooks/scripts/__tests__/clone-merge-responsive.test.js +106 -0
  7. package/hooks/scripts/clone-extract.js +242 -28
  8. package/hooks/scripts/clone-merge-responsive.js +184 -0
  9. package/hooks/scripts/clone-spec.js +33 -8
  10. package/hooks/scripts/clone-validate.js +15 -9
  11. package/package.json +5 -2
  12. package/skills/clone/SKILL.md +132 -55
  13. package/skills/vibe.clone/SKILL.md +39 -19
  14. package/dist/cli/llm/gemini-commands.d.ts +0 -25
  15. package/dist/cli/llm/gemini-commands.d.ts.map +0 -1
  16. package/dist/cli/llm/gemini-commands.js +0 -143
  17. package/dist/cli/llm/gemini-commands.js.map +0 -1
  18. package/dist/cli/postinstall/codex-agents.d.ts +0 -24
  19. package/dist/cli/postinstall/codex-agents.d.ts.map +0 -1
  20. package/dist/cli/postinstall/codex-agents.js +0 -114
  21. package/dist/cli/postinstall/codex-agents.js.map +0 -1
  22. package/dist/cli/postinstall/codex-instruction.d.ts +0 -10
  23. package/dist/cli/postinstall/codex-instruction.d.ts.map +0 -1
  24. package/dist/cli/postinstall/codex-instruction.js +0 -56
  25. package/dist/cli/postinstall/codex-instruction.js.map +0 -1
  26. package/dist/cli/postinstall/gemini-agents.d.ts +0 -12
  27. package/dist/cli/postinstall/gemini-agents.d.ts.map +0 -1
  28. package/dist/cli/postinstall/gemini-agents.js +0 -80
  29. package/dist/cli/postinstall/gemini-agents.js.map +0 -1
  30. package/dist/cli/postinstall/gemini-instruction.d.ts +0 -10
  31. package/dist/cli/postinstall/gemini-instruction.d.ts.map +0 -1
  32. package/dist/cli/postinstall/gemini-instruction.js +0 -59
  33. package/dist/cli/postinstall/gemini-instruction.js.map +0 -1
  34. package/dist/infra/lib/ContextCompressor.d.ts +0 -104
  35. package/dist/infra/lib/ContextCompressor.d.ts.map +0 -1
  36. package/dist/infra/lib/ContextCompressor.js +0 -297
  37. package/dist/infra/lib/ContextCompressor.js.map +0 -1
  38. package/dist/infra/lib/ContextCompressor.test.d.ts +0 -2
  39. package/dist/infra/lib/ContextCompressor.test.d.ts.map +0 -1
  40. package/dist/infra/lib/ContextCompressor.test.js +0 -25
  41. package/dist/infra/lib/ContextCompressor.test.js.map +0 -1
  42. package/dist/infra/lib/ProgressTracker.d.ts +0 -73
  43. package/dist/infra/lib/ProgressTracker.d.ts.map +0 -1
  44. package/dist/infra/lib/ProgressTracker.js +0 -267
  45. package/dist/infra/lib/ProgressTracker.js.map +0 -1
  46. package/dist/infra/lib/TokenBudgetTracker.d.ts +0 -68
  47. package/dist/infra/lib/TokenBudgetTracker.d.ts.map +0 -1
  48. package/dist/infra/lib/TokenBudgetTracker.js +0 -191
  49. package/dist/infra/lib/TokenBudgetTracker.js.map +0 -1
  50. package/dist/infra/lib/autonomy/AuditStore.d.ts +0 -63
  51. package/dist/infra/lib/autonomy/AuditStore.d.ts.map +0 -1
  52. package/dist/infra/lib/autonomy/AuditStore.js +0 -185
  53. package/dist/infra/lib/autonomy/AuditStore.js.map +0 -1
  54. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts +0 -84
  55. package/dist/infra/lib/autonomy/AutonomyConfig.d.ts.map +0 -1
  56. package/dist/infra/lib/autonomy/AutonomyConfig.js +0 -49
  57. package/dist/infra/lib/autonomy/AutonomyConfig.js.map +0 -1
  58. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts +0 -78
  59. package/dist/infra/lib/autonomy/AutonomyOrchestrator.d.ts.map +0 -1
  60. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js +0 -246
  61. package/dist/infra/lib/autonomy/AutonomyOrchestrator.js.map +0 -1
  62. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts +0 -36
  63. package/dist/infra/lib/autonomy/BackgroundMonitor.d.ts.map +0 -1
  64. package/dist/infra/lib/autonomy/BackgroundMonitor.js +0 -138
  65. package/dist/infra/lib/autonomy/BackgroundMonitor.js.map +0 -1
  66. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts +0 -56
  67. package/dist/infra/lib/autonomy/CollaborationProtocol.d.ts.map +0 -1
  68. package/dist/infra/lib/autonomy/CollaborationProtocol.js +0 -122
  69. package/dist/infra/lib/autonomy/CollaborationProtocol.js.map +0 -1
  70. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts +0 -42
  71. package/dist/infra/lib/autonomy/ConfirmationManager.d.ts.map +0 -1
  72. package/dist/infra/lib/autonomy/ConfirmationManager.js +0 -200
  73. package/dist/infra/lib/autonomy/ConfirmationManager.js.map +0 -1
  74. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts +0 -55
  75. package/dist/infra/lib/autonomy/ConfirmationStore.d.ts.map +0 -1
  76. package/dist/infra/lib/autonomy/ConfirmationStore.js +0 -130
  77. package/dist/infra/lib/autonomy/ConfirmationStore.js.map +0 -1
  78. package/dist/infra/lib/autonomy/EventBus.d.ts +0 -20
  79. package/dist/infra/lib/autonomy/EventBus.d.ts.map +0 -1
  80. package/dist/infra/lib/autonomy/EventBus.js +0 -119
  81. package/dist/infra/lib/autonomy/EventBus.js.map +0 -1
  82. package/dist/infra/lib/autonomy/EventOutbox.d.ts +0 -32
  83. package/dist/infra/lib/autonomy/EventOutbox.d.ts.map +0 -1
  84. package/dist/infra/lib/autonomy/EventOutbox.js +0 -152
  85. package/dist/infra/lib/autonomy/EventOutbox.js.map +0 -1
  86. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts +0 -24
  87. package/dist/infra/lib/autonomy/NotificationDispatcher.d.ts.map +0 -1
  88. package/dist/infra/lib/autonomy/NotificationDispatcher.js +0 -112
  89. package/dist/infra/lib/autonomy/NotificationDispatcher.js.map +0 -1
  90. package/dist/infra/lib/autonomy/PolicyEngine.d.ts +0 -76
  91. package/dist/infra/lib/autonomy/PolicyEngine.d.ts.map +0 -1
  92. package/dist/infra/lib/autonomy/PolicyEngine.js +0 -208
  93. package/dist/infra/lib/autonomy/PolicyEngine.js.map +0 -1
  94. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts +0 -61
  95. package/dist/infra/lib/autonomy/ProactiveAnalyzer.d.ts.map +0 -1
  96. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js +0 -236
  97. package/dist/infra/lib/autonomy/ProactiveAnalyzer.js.map +0 -1
  98. package/dist/infra/lib/autonomy/RiskClassifier.d.ts +0 -35
  99. package/dist/infra/lib/autonomy/RiskClassifier.d.ts.map +0 -1
  100. package/dist/infra/lib/autonomy/RiskClassifier.js +0 -147
  101. package/dist/infra/lib/autonomy/RiskClassifier.js.map +0 -1
  102. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts +0 -51
  103. package/dist/infra/lib/autonomy/SecuritySentinel.d.ts.map +0 -1
  104. package/dist/infra/lib/autonomy/SecuritySentinel.js +0 -162
  105. package/dist/infra/lib/autonomy/SecuritySentinel.js.map +0 -1
  106. package/dist/infra/lib/autonomy/SuggestionStore.d.ts +0 -54
  107. package/dist/infra/lib/autonomy/SuggestionStore.d.ts.map +0 -1
  108. package/dist/infra/lib/autonomy/SuggestionStore.js +0 -144
  109. package/dist/infra/lib/autonomy/SuggestionStore.js.map +0 -1
  110. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts +0 -38
  111. package/dist/infra/lib/autonomy/TaskDecomposer.d.ts.map +0 -1
  112. package/dist/infra/lib/autonomy/TaskDecomposer.js +0 -175
  113. package/dist/infra/lib/autonomy/TaskDecomposer.js.map +0 -1
  114. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts +0 -2
  115. package/dist/infra/lib/autonomy/__tests__/audit-store.test.d.ts.map +0 -1
  116. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js +0 -198
  117. package/dist/infra/lib/autonomy/__tests__/audit-store.test.js.map +0 -1
  118. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts +0 -2
  119. package/dist/infra/lib/autonomy/__tests__/event-bus.test.d.ts.map +0 -1
  120. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js +0 -225
  121. package/dist/infra/lib/autonomy/__tests__/event-bus.test.js.map +0 -1
  122. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts +0 -2
  123. package/dist/infra/lib/autonomy/__tests__/event-core.test.d.ts.map +0 -1
  124. package/dist/infra/lib/autonomy/__tests__/event-core.test.js +0 -194
  125. package/dist/infra/lib/autonomy/__tests__/event-core.test.js.map +0 -1
  126. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts +0 -2
  127. package/dist/infra/lib/autonomy/__tests__/governance.test.d.ts.map +0 -1
  128. package/dist/infra/lib/autonomy/__tests__/governance.test.js +0 -540
  129. package/dist/infra/lib/autonomy/__tests__/governance.test.js.map +0 -1
  130. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts +0 -2
  131. package/dist/infra/lib/autonomy/__tests__/integration.test.d.ts.map +0 -1
  132. package/dist/infra/lib/autonomy/__tests__/integration.test.js +0 -480
  133. package/dist/infra/lib/autonomy/__tests__/integration.test.js.map +0 -1
  134. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts +0 -2
  135. package/dist/infra/lib/autonomy/__tests__/proactive.test.d.ts.map +0 -1
  136. package/dist/infra/lib/autonomy/__tests__/proactive.test.js +0 -410
  137. package/dist/infra/lib/autonomy/__tests__/proactive.test.js.map +0 -1
  138. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts +0 -2
  139. package/dist/infra/lib/autonomy/__tests__/sentinel.test.d.ts.map +0 -1
  140. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js +0 -486
  141. package/dist/infra/lib/autonomy/__tests__/sentinel.test.js.map +0 -1
  142. package/dist/infra/lib/autonomy/index.d.ts +0 -18
  143. package/dist/infra/lib/autonomy/index.d.ts.map +0 -1
  144. package/dist/infra/lib/autonomy/index.js +0 -22
  145. package/dist/infra/lib/autonomy/index.js.map +0 -1
  146. package/dist/infra/lib/autonomy/schemas.d.ts +0 -317
  147. package/dist/infra/lib/autonomy/schemas.d.ts.map +0 -1
  148. package/dist/infra/lib/autonomy/schemas.js +0 -90
  149. package/dist/infra/lib/autonomy/schemas.js.map +0 -1
  150. package/dist/infra/lib/claude/index.d.ts +0 -5
  151. package/dist/infra/lib/claude/index.d.ts.map +0 -1
  152. package/dist/infra/lib/claude/index.js +0 -5
  153. package/dist/infra/lib/claude/index.js.map +0 -1
  154. package/dist/infra/lib/claude/storage.d.ts +0 -12
  155. package/dist/infra/lib/claude/storage.d.ts.map +0 -1
  156. package/dist/infra/lib/claude/storage.js +0 -54
  157. package/dist/infra/lib/claude/storage.js.map +0 -1
  158. package/dist/infra/lib/gemini/auth.d.ts +0 -18
  159. package/dist/infra/lib/gemini/auth.d.ts.map +0 -1
  160. package/dist/infra/lib/gemini/auth.js +0 -32
  161. package/dist/infra/lib/gemini/auth.js.map +0 -1
  162. package/dist/infra/lib/gemini/capabilities.d.ts +0 -28
  163. package/dist/infra/lib/gemini/capabilities.d.ts.map +0 -1
  164. package/dist/infra/lib/gemini/capabilities.js +0 -178
  165. package/dist/infra/lib/gemini/capabilities.js.map +0 -1
  166. package/dist/infra/lib/gemini/chat.d.ts +0 -35
  167. package/dist/infra/lib/gemini/chat.d.ts.map +0 -1
  168. package/dist/infra/lib/gemini/chat.js +0 -161
  169. package/dist/infra/lib/gemini/chat.js.map +0 -1
  170. package/dist/infra/lib/gemini/completion.d.ts +0 -12
  171. package/dist/infra/lib/gemini/completion.d.ts.map +0 -1
  172. package/dist/infra/lib/gemini/completion.js +0 -13
  173. package/dist/infra/lib/gemini/completion.js.map +0 -1
  174. package/dist/infra/lib/gemini/constants.d.ts +0 -8
  175. package/dist/infra/lib/gemini/constants.d.ts.map +0 -1
  176. package/dist/infra/lib/gemini/constants.js +0 -11
  177. package/dist/infra/lib/gemini/constants.js.map +0 -1
  178. package/dist/infra/lib/gemini/index.d.ts +0 -13
  179. package/dist/infra/lib/gemini/index.d.ts.map +0 -1
  180. package/dist/infra/lib/gemini/index.js +0 -12
  181. package/dist/infra/lib/gemini/index.js.map +0 -1
  182. package/dist/infra/lib/gemini/models.d.ts +0 -11
  183. package/dist/infra/lib/gemini/models.d.ts.map +0 -1
  184. package/dist/infra/lib/gemini/models.js +0 -38
  185. package/dist/infra/lib/gemini/models.js.map +0 -1
  186. package/dist/infra/lib/gemini/orchestration.d.ts +0 -33
  187. package/dist/infra/lib/gemini/orchestration.d.ts.map +0 -1
  188. package/dist/infra/lib/gemini/orchestration.js +0 -62
  189. package/dist/infra/lib/gemini/orchestration.js.map +0 -1
  190. package/dist/infra/lib/gemini/types.d.ts +0 -115
  191. package/dist/infra/lib/gemini/types.d.ts.map +0 -1
  192. package/dist/infra/lib/gemini/types.js +0 -5
  193. package/dist/infra/lib/gemini/types.js.map +0 -1
  194. package/dist/infra/orchestrator/AgentAnnouncer.d.ts +0 -64
  195. package/dist/infra/orchestrator/AgentAnnouncer.d.ts.map +0 -1
  196. package/dist/infra/orchestrator/AgentAnnouncer.js +0 -127
  197. package/dist/infra/orchestrator/AgentAnnouncer.js.map +0 -1
  198. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts +0 -5
  199. package/dist/infra/orchestrator/AgentAnnouncer.test.d.ts.map +0 -1
  200. package/dist/infra/orchestrator/AgentAnnouncer.test.js +0 -119
  201. package/dist/infra/orchestrator/AgentAnnouncer.test.js.map +0 -1
  202. package/dist/infra/orchestrator/AgentExecutor.d.ts +0 -22
  203. package/dist/infra/orchestrator/AgentExecutor.d.ts.map +0 -1
  204. package/dist/infra/orchestrator/AgentExecutor.js +0 -272
  205. package/dist/infra/orchestrator/AgentExecutor.js.map +0 -1
  206. package/dist/infra/orchestrator/AgentManager.d.ts +0 -72
  207. package/dist/infra/orchestrator/AgentManager.d.ts.map +0 -1
  208. package/dist/infra/orchestrator/AgentManager.js +0 -183
  209. package/dist/infra/orchestrator/AgentManager.js.map +0 -1
  210. package/dist/infra/orchestrator/AgentManifestCache.d.ts +0 -54
  211. package/dist/infra/orchestrator/AgentManifestCache.d.ts.map +0 -1
  212. package/dist/infra/orchestrator/AgentManifestCache.js +0 -191
  213. package/dist/infra/orchestrator/AgentManifestCache.js.map +0 -1
  214. package/dist/infra/orchestrator/AgentRegistry.d.ts +0 -76
  215. package/dist/infra/orchestrator/AgentRegistry.d.ts.map +0 -1
  216. package/dist/infra/orchestrator/AgentRegistry.js +0 -217
  217. package/dist/infra/orchestrator/AgentRegistry.js.map +0 -1
  218. package/dist/infra/orchestrator/AgentRegistry.test.d.ts +0 -5
  219. package/dist/infra/orchestrator/AgentRegistry.test.d.ts.map +0 -1
  220. package/dist/infra/orchestrator/AgentRegistry.test.js +0 -122
  221. package/dist/infra/orchestrator/AgentRegistry.test.js.map +0 -1
  222. package/dist/infra/orchestrator/BackgroundManager.d.ts +0 -128
  223. package/dist/infra/orchestrator/BackgroundManager.d.ts.map +0 -1
  224. package/dist/infra/orchestrator/BackgroundManager.js +0 -620
  225. package/dist/infra/orchestrator/BackgroundManager.js.map +0 -1
  226. package/dist/infra/orchestrator/BackgroundManager.test.d.ts +0 -6
  227. package/dist/infra/orchestrator/BackgroundManager.test.d.ts.map +0 -1
  228. package/dist/infra/orchestrator/BackgroundManager.test.js +0 -162
  229. package/dist/infra/orchestrator/BackgroundManager.test.js.map +0 -1
  230. package/dist/infra/orchestrator/CheckpointManager.d.ts +0 -54
  231. package/dist/infra/orchestrator/CheckpointManager.d.ts.map +0 -1
  232. package/dist/infra/orchestrator/CheckpointManager.js +0 -121
  233. package/dist/infra/orchestrator/CheckpointManager.js.map +0 -1
  234. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts +0 -12
  235. package/dist/infra/orchestrator/CodexAgentRuntime.d.ts.map +0 -1
  236. package/dist/infra/orchestrator/CodexAgentRuntime.js +0 -94
  237. package/dist/infra/orchestrator/CodexAgentRuntime.js.map +0 -1
  238. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts +0 -2
  239. package/dist/infra/orchestrator/CodexAgentRuntime.test.d.ts.map +0 -1
  240. package/dist/infra/orchestrator/CodexAgentRuntime.test.js +0 -37
  241. package/dist/infra/orchestrator/CodexAgentRuntime.test.js.map +0 -1
  242. package/dist/infra/orchestrator/LLMCluster.d.ts +0 -82
  243. package/dist/infra/orchestrator/LLMCluster.d.ts.map +0 -1
  244. package/dist/infra/orchestrator/LLMCluster.js +0 -146
  245. package/dist/infra/orchestrator/LLMCluster.js.map +0 -1
  246. package/dist/infra/orchestrator/MultiLlmResearch.d.ts +0 -31
  247. package/dist/infra/orchestrator/MultiLlmResearch.d.ts.map +0 -1
  248. package/dist/infra/orchestrator/MultiLlmResearch.js +0 -160
  249. package/dist/infra/orchestrator/MultiLlmResearch.js.map +0 -1
  250. package/dist/infra/orchestrator/PhasePipeline.d.ts +0 -122
  251. package/dist/infra/orchestrator/PhasePipeline.d.ts.map +0 -1
  252. package/dist/infra/orchestrator/PhasePipeline.js +0 -385
  253. package/dist/infra/orchestrator/PhasePipeline.js.map +0 -1
  254. package/dist/infra/orchestrator/PhaseResultStore.d.ts +0 -39
  255. package/dist/infra/orchestrator/PhaseResultStore.d.ts.map +0 -1
  256. package/dist/infra/orchestrator/PhaseResultStore.js +0 -151
  257. package/dist/infra/orchestrator/PhaseResultStore.js.map +0 -1
  258. package/dist/infra/orchestrator/SessionStore.d.ts +0 -40
  259. package/dist/infra/orchestrator/SessionStore.d.ts.map +0 -1
  260. package/dist/infra/orchestrator/SessionStore.js +0 -116
  261. package/dist/infra/orchestrator/SessionStore.js.map +0 -1
  262. package/dist/infra/orchestrator/SmartRouter.d.ts +0 -90
  263. package/dist/infra/orchestrator/SmartRouter.d.ts.map +0 -1
  264. package/dist/infra/orchestrator/SmartRouter.js +0 -277
  265. package/dist/infra/orchestrator/SmartRouter.js.map +0 -1
  266. package/dist/infra/orchestrator/SmartRouter.test.d.ts +0 -5
  267. package/dist/infra/orchestrator/SmartRouter.test.d.ts.map +0 -1
  268. package/dist/infra/orchestrator/SmartRouter.test.js +0 -484
  269. package/dist/infra/orchestrator/SmartRouter.test.js.map +0 -1
  270. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts +0 -143
  271. package/dist/infra/orchestrator/SwarmOrchestrator.d.ts.map +0 -1
  272. package/dist/infra/orchestrator/SwarmOrchestrator.js +0 -378
  273. package/dist/infra/orchestrator/SwarmOrchestrator.js.map +0 -1
  274. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts +0 -5
  275. package/dist/infra/orchestrator/SwarmOrchestrator.test.d.ts.map +0 -1
  276. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +0 -95
  277. package/dist/infra/orchestrator/SwarmOrchestrator.test.js.map +0 -1
  278. package/dist/infra/orchestrator/agentDiscovery.d.ts +0 -26
  279. package/dist/infra/orchestrator/agentDiscovery.d.ts.map +0 -1
  280. package/dist/infra/orchestrator/agentDiscovery.js +0 -175
  281. package/dist/infra/orchestrator/agentDiscovery.js.map +0 -1
  282. package/dist/infra/orchestrator/backgroundAgent.d.ts +0 -9
  283. package/dist/infra/orchestrator/backgroundAgent.d.ts.map +0 -1
  284. package/dist/infra/orchestrator/backgroundAgent.js +0 -10
  285. package/dist/infra/orchestrator/backgroundAgent.js.map +0 -1
  286. package/dist/infra/orchestrator/index.d.ts +0 -207
  287. package/dist/infra/orchestrator/index.d.ts.map +0 -1
  288. package/dist/infra/orchestrator/index.js +0 -362
  289. package/dist/infra/orchestrator/index.js.map +0 -1
  290. package/dist/infra/orchestrator/orchestrator.d.ts +0 -60
  291. package/dist/infra/orchestrator/orchestrator.d.ts.map +0 -1
  292. package/dist/infra/orchestrator/orchestrator.js +0 -214
  293. package/dist/infra/orchestrator/orchestrator.js.map +0 -1
  294. package/dist/infra/orchestrator/parallelResearch.d.ts +0 -27
  295. package/dist/infra/orchestrator/parallelResearch.d.ts.map +0 -1
  296. package/dist/infra/orchestrator/parallelResearch.js +0 -285
  297. package/dist/infra/orchestrator/parallelResearch.js.map +0 -1
  298. package/dist/infra/orchestrator/types.d.ts +0 -205
  299. package/dist/infra/orchestrator/types.d.ts.map +0 -1
  300. package/dist/infra/orchestrator/types.js +0 -87
  301. package/dist/infra/orchestrator/types.js.map +0 -1
  302. package/dist/infra/orchestrator/types.test.d.ts +0 -2
  303. package/dist/infra/orchestrator/types.test.d.ts.map +0 -1
  304. package/dist/infra/orchestrator/types.test.js +0 -57
  305. package/dist/infra/orchestrator/types.test.js.map +0 -1
  306. package/dist/tools/semantic/analyzeDependencyGraph.d.ts +0 -12
  307. package/dist/tools/semantic/analyzeDependencyGraph.d.ts.map +0 -1
  308. package/dist/tools/semantic/analyzeDependencyGraph.js +0 -359
  309. package/dist/tools/semantic/analyzeDependencyGraph.js.map +0 -1
  310. package/dist/tools/semantic/astGrep.d.ts +0 -25
  311. package/dist/tools/semantic/astGrep.d.ts.map +0 -1
  312. package/dist/tools/semantic/astGrep.js +0 -324
  313. package/dist/tools/semantic/astGrep.js.map +0 -1
  314. package/dist/tools/semantic/astGrep.test.d.ts +0 -2
  315. package/dist/tools/semantic/astGrep.test.d.ts.map +0 -1
  316. package/dist/tools/semantic/astGrep.test.js +0 -74
  317. package/dist/tools/semantic/astGrep.test.js.map +0 -1
  318. package/dist/tools/semantic/findReferences.d.ts +0 -9
  319. package/dist/tools/semantic/findReferences.d.ts.map +0 -1
  320. package/dist/tools/semantic/findReferences.js +0 -200
  321. package/dist/tools/semantic/findReferences.js.map +0 -1
  322. package/dist/tools/semantic/findSymbol.d.ts +0 -8
  323. package/dist/tools/semantic/findSymbol.d.ts.map +0 -1
  324. package/dist/tools/semantic/findSymbol.js +0 -204
  325. package/dist/tools/semantic/findSymbol.js.map +0 -1
  326. package/dist/tools/semantic/index.d.ts +0 -9
  327. package/dist/tools/semantic/index.d.ts.map +0 -1
  328. package/dist/tools/semantic/index.js +0 -11
  329. package/dist/tools/semantic/index.js.map +0 -1
  330. package/dist/tools/semantic/lsp.d.ts +0 -68
  331. package/dist/tools/semantic/lsp.d.ts.map +0 -1
  332. package/dist/tools/semantic/lsp.js +0 -561
  333. package/dist/tools/semantic/lsp.js.map +0 -1
  334. package/dist/tools/spec/e2eTestGenerator.d.ts +0 -61
  335. package/dist/tools/spec/e2eTestGenerator.d.ts.map +0 -1
  336. package/dist/tools/spec/e2eTestGenerator.js +0 -255
  337. package/dist/tools/spec/e2eTestGenerator.js.map +0 -1
  338. package/dist/tools/spec/specVersioning.d.ts +0 -76
  339. package/dist/tools/spec/specVersioning.d.ts.map +0 -1
  340. package/dist/tools/spec/specVersioning.js +0 -236
  341. package/dist/tools/spec/specVersioning.js.map +0 -1
@@ -1,59 +0,0 @@
1
- /**
2
- * Gemini CLI 전역 GEMINI.md 생성
3
- *
4
- * CLAUDE.md에서 VIBE 섹션을 읽어 GEMINI.md 형식으로 변환
5
- */
6
- import path from 'path';
7
- import fs from 'fs';
8
- const CORE_START_MARKER = '# VIBE';
9
- const CORE_END_MARKER = '<!-- VIBE:END -->';
10
- /**
11
- * CLAUDE.md에서 VIBE 섹션 추출 (CLI-neutral 공통 내용)
12
- */
13
- function getVibeInstructionContent(packageRoot) {
14
- const claudeMdPath = path.join(packageRoot, 'CLAUDE.md');
15
- if (!fs.existsSync(claudeMdPath))
16
- return '';
17
- const content = fs.readFileSync(claudeMdPath, 'utf-8').replace(/\r\n/g, '\n');
18
- const startIdx = content.indexOf(CORE_START_MARKER);
19
- const endIdx = content.indexOf(CORE_END_MARKER);
20
- if (startIdx === -1)
21
- return '';
22
- const endPos = endIdx !== -1 ? endIdx + CORE_END_MARKER.length : content.length;
23
- return content.substring(startIdx, endPos);
24
- }
25
- /**
26
- * VIBE 내용을 Gemini CLI 형식으로 변환
27
- * - "Claude Code Exclusive" 문구 제거
28
- * - hooks 이벤트 이름을 Gemini 형식으로 변환
29
- * - 경로 참조를 ~/.gemini/ 기준으로 변환
30
- */
31
- function adaptForGemini(content) {
32
- let adapted = content;
33
- // "Claude Code Exclusive" 문구 제거
34
- adapted = adapted.replace(/\(Claude Code Exclusive\)/g, '');
35
- adapted = adapted.replace(/Claude Code Exclusive/g, '');
36
- // Hooks 이벤트 이름 변환 (Claude → Gemini)
37
- adapted = adapted.replace(/PreToolUse/g, 'BeforeTool');
38
- adapted = adapted.replace(/PostToolUse/g, 'AfterTool');
39
- adapted = adapted.replace(/UserPromptSubmit/g, 'BeforeAgent');
40
- adapted = adapted.replace(/\bStop\b/g, 'SessionEnd');
41
- // ~/.claude/ → ~/.gemini/ 경로 변환
42
- adapted = adapted.replace(/~\/\.claude\//g, '~/.gemini/');
43
- adapted = adapted.replace(/\.claude\//g, '.gemini/');
44
- // "Claude Code" → "Gemini CLI" 변환 (일반적 참조)
45
- adapted = adapted.replace(/Claude Code/g, 'Gemini CLI');
46
- return adapted.trim();
47
- }
48
- /**
49
- * 전역 ~/.gemini/GEMINI.md 생성
50
- */
51
- export function generateGeminiMd(geminiDir, packageRoot) {
52
- const vibeContent = getVibeInstructionContent(packageRoot);
53
- if (!vibeContent)
54
- return;
55
- const geminiContent = adaptForGemini(vibeContent);
56
- const geminiMdPath = path.join(geminiDir, 'GEMINI.md');
57
- fs.writeFileSync(geminiMdPath, geminiContent + '\n', 'utf-8');
58
- }
59
- //# sourceMappingURL=gemini-instruction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gemini-instruction.js","sourceRoot":"","sources":["../../../src/cli/postinstall/gemini-instruction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AACnC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;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AAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAErD,gCAAgC;IAChC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAC1D,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAErD,2CAA2C;IAC3C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAExD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,WAAmB;IACrE,MAAM,WAAW,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,aAAa,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEvD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
@@ -1,104 +0,0 @@
1
- export interface CompressionResult {
2
- compressed: string;
3
- originalSize: number;
4
- compressedSize: number;
5
- compressionRatio: number;
6
- removedSections: string[];
7
- retainedSections: string[];
8
- retentionStats?: {
9
- codeRetentionPercent: number;
10
- answerRetentionPercent: number;
11
- questionRetentionPercent: number;
12
- };
13
- }
14
- export interface ChunkScore {
15
- text: string;
16
- score: number;
17
- type: 'code' | 'explanation' | 'question' | 'answer' | 'metadata';
18
- keywords: string[];
19
- index: number;
20
- }
21
- export declare class ContextCompressor {
22
- private static readonly MAX_CHUNK_SIZE;
23
- private static readonly DEFAULT_TARGET_TOKENS;
24
- private static readonly TOKENS_PER_CHAR_ESTIMATE;
25
- private static readonly MAX_SCORE;
26
- private static readonly MIN_SCORE;
27
- private static readonly CODE_KEYWORDS;
28
- private static readonly IMPORTANT_KEYWORDS;
29
- /**
30
- * Compress context by selecting most important chunks
31
- * @param context - Text content to compress
32
- * @param targetTokens - Target token count (default: 4000)
33
- * @returns Compression result with statistics
34
- */
35
- static compress(context: string, targetTokens?: number): CompressionResult;
36
- /**
37
- * Calculate retention percentages by type
38
- */
39
- private static calculateRetentionStats;
40
- /**
41
- * Split context into manageable chunks
42
- */
43
- private static splitIntoChunks;
44
- /**
45
- * Score chunk importance (0-100)
46
- * @param text - Text chunk to score
47
- * @param index - Original position of the chunk in the source document
48
- * @returns Scored chunk with type, keywords, and original index
49
- */
50
- private static scoreChunk;
51
- /**
52
- * Detect chunk type based on content
53
- */
54
- private static detectChunkType;
55
- /**
56
- * Extract important keywords from text
57
- */
58
- private static extractKeywords;
59
- /**
60
- * Calculate base score for chunk
61
- */
62
- private static calculateBaseScore;
63
- /**
64
- * Get score based on chunk type
65
- */
66
- private static getTypeScore;
67
- /**
68
- * Get score for important keywords
69
- */
70
- private static getKeywordScore;
71
- /**
72
- * Get score based on text structure
73
- */
74
- private static getStructureScore;
75
- /**
76
- * Summarize removed chunk (one-liner)
77
- */
78
- private static summarizeChunk;
79
- /**
80
- * Reconstruct compressed context.
81
- *
82
- * Chunks are emitted in their original document order (the caller sorts
83
- * `selected` by index before calling). We intentionally do NOT regroup by
84
- * type: reordering by score/type means a small change to the input reshuffles
85
- * the whole output, destroying the common prefix between successive
86
- * compactions and forcing a full KV-cache recompute. Preserving order keeps
87
- * appended content at the tail so the prefix stays stable.
88
- */
89
- private static reconstructContext;
90
- /**
91
- * Extract key entities (names, numbers, dates) from context
92
- */
93
- static extractKeyEntities(context: string): {
94
- names: string[];
95
- numbers: string[];
96
- dates: string[];
97
- files: string[];
98
- };
99
- /**
100
- * Estimate token count (rough approximation)
101
- */
102
- static estimateTokens(text: string): number;
103
- }
104
- //# sourceMappingURL=ContextCompressor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextC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uB;IA2BtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAuB9B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAczB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAS9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAU9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAgBjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAW3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAU9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAS7B;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAwBjC;;OAEG;WACW,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjD,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB;IA4BD;;OAEG;WACW,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAKnD"}
@@ -1,297 +0,0 @@
1
- // Context compression utility (v1.3)
2
- // Intelligently compress context when approaching token limits
3
- export class ContextCompressor {
4
- // WHY 500 chars: Small enough to score and discard at fine granularity, but
5
- // large enough to keep related lines together (a typical function is ~300-600 chars).
6
- static MAX_CHUNK_SIZE = 500; // characters
7
- static DEFAULT_TARGET_TOKENS = 4000;
8
- // WHY 0.25: GPT-family tokenizers average ~4 chars per token for English/code.
9
- // 1 char * 0.25 = 0.25 tokens, so 4 chars = 1 token. Intentionally conservative
10
- // to avoid exceeding context windows (overestimating tokens = safer truncation).
11
- static TOKENS_PER_CHAR_ESTIMATE = 0.25;
12
- static MAX_SCORE = 100;
13
- static MIN_SCORE = 0;
14
- static CODE_KEYWORDS = [
15
- 'function', 'class', 'const', 'let', 'var', 'import', 'export',
16
- 'def', 'async', 'await', 'return', 'if', 'for', 'while'
17
- ];
18
- static IMPORTANT_KEYWORDS = [
19
- 'error', 'bug', 'fix', 'issue', 'problem', 'solution',
20
- 'TODO', 'FIXME', 'HACK', 'NOTE', 'WARNING'
21
- ];
22
- /**
23
- * Compress context by selecting most important chunks
24
- * @param context - Text content to compress
25
- * @param targetTokens - Target token count (default: 4000)
26
- * @returns Compression result with statistics
27
- */
28
- static compress(context, targetTokens = ContextCompressor.DEFAULT_TARGET_TOKENS) {
29
- // Handle empty or very short context
30
- if (!context || context.trim().length === 0) {
31
- return {
32
- compressed: '',
33
- originalSize: 0,
34
- compressedSize: 0,
35
- compressionRatio: 0,
36
- removedSections: [],
37
- retainedSections: []
38
- };
39
- }
40
- const chunks = this.splitIntoChunks(context);
41
- const scoredChunks = chunks.map((chunk, i) => this.scoreChunk(chunk, i));
42
- // WHY 1.2x threshold (not 1.0x): Avoids wasteful compression when the content
43
- // is only marginally over the target — the scoring/reordering overhead would
44
- // degrade readability for negligible size savings. context.length is in CHARS,
45
- // targetTokens in tokens, so normalize via TOKENS_PER_CHAR_ESTIMATE (4 chars/token)
46
- // before comparing — otherwise the early exit fires at ~30% of the real budget
47
- // and in-budget content gets needlessly rechunked (breaking KV prefix-cache reuse).
48
- const targetCharsWithMargin = (targetTokens / ContextCompressor.TOKENS_PER_CHAR_ESTIMATE) * 1.2;
49
- if (context.length <= targetCharsWithMargin) {
50
- return {
51
- compressed: context,
52
- originalSize: context.length,
53
- compressedSize: context.length,
54
- compressionRatio: 1,
55
- removedSections: [],
56
- retainedSections: scoredChunks.map(s => s.type),
57
- retentionStats: {
58
- codeRetentionPercent: 100,
59
- answerRetentionPercent: 100,
60
- questionRetentionPercent: 100
61
- }
62
- };
63
- }
64
- // Sort by score (highest first)
65
- scoredChunks.sort((a, b) => b.score - a.score);
66
- // Select chunks until target size
67
- // TOKENS_PER_CHAR_ESTIMATE = 0.25 means 1 char ≈ 0.25 tokens, so 4 chars ≈ 1 token
68
- // Reserve space for headers and formatting (5% overhead, min 50 chars, max 300 chars)
69
- const HEADER_OVERHEAD = Math.max(50, Math.min(300, targetTokens * 4 * 0.05));
70
- const targetChars = (targetTokens * 4) - HEADER_OVERHEAD;
71
- const selected = [];
72
- const removed = [];
73
- let currentSize = 0;
74
- for (const chunk of scoredChunks) {
75
- if (currentSize + chunk.text.length <= targetChars) {
76
- selected.push(chunk);
77
- currentSize += chunk.text.length;
78
- }
79
- else {
80
- removed.push(this.summarizeChunk(chunk));
81
- }
82
- }
83
- // Emit in original document order (not score order) so a recompressed,
84
- // grown context keeps a stable prefix — preserving KV prefix-cache reuse.
85
- selected.sort((a, b) => a.index - b.index);
86
- // Reconstruct compressed context
87
- const compressed = this.reconstructContext(selected, removed);
88
- // Calculate retention statistics
89
- const retentionStats = this.calculateRetentionStats(scoredChunks, selected);
90
- return {
91
- compressed,
92
- originalSize: context.length,
93
- compressedSize: compressed.length,
94
- compressionRatio: compressed.length / context.length,
95
- removedSections: removed,
96
- retainedSections: selected.map(s => s.type),
97
- retentionStats
98
- };
99
- }
100
- /**
101
- * Calculate retention percentages by type
102
- */
103
- static calculateRetentionStats(allChunks, selectedChunks) {
104
- const countByType = (chunks, type) => {
105
- return chunks.filter(c => c.type === type).length;
106
- };
107
- const totalCode = countByType(allChunks, 'code');
108
- const totalAnswer = countByType(allChunks, 'answer');
109
- const totalQuestion = countByType(allChunks, 'question');
110
- const retainedCode = countByType(selectedChunks, 'code');
111
- const retainedAnswer = countByType(selectedChunks, 'answer');
112
- const retainedQuestion = countByType(selectedChunks, 'question');
113
- return {
114
- codeRetentionPercent: totalCode > 0 ? Math.round((retainedCode / totalCode) * 100) : 0,
115
- answerRetentionPercent: totalAnswer > 0 ? Math.round((retainedAnswer / totalAnswer) * 100) : 0,
116
- questionRetentionPercent: totalQuestion > 0 ? Math.round((retainedQuestion / totalQuestion) * 100) : 0
117
- };
118
- }
119
- /**
120
- * Split context into manageable chunks
121
- */
122
- static splitIntoChunks(context) {
123
- const chunks = [];
124
- const lines = context.split('\n');
125
- let currentChunk = '';
126
- for (const line of lines) {
127
- if (currentChunk.length + line.length > this.MAX_CHUNK_SIZE) {
128
- if (currentChunk.trim()) {
129
- chunks.push(currentChunk.trim());
130
- }
131
- currentChunk = line;
132
- }
133
- else {
134
- currentChunk += '\n' + line;
135
- }
136
- }
137
- if (currentChunk.trim()) {
138
- chunks.push(currentChunk.trim());
139
- }
140
- return chunks;
141
- }
142
- /**
143
- * Score chunk importance (0-100)
144
- * @param text - Text chunk to score
145
- * @param index - Original position of the chunk in the source document
146
- * @returns Scored chunk with type, keywords, and original index
147
- */
148
- static scoreChunk(text, index) {
149
- const lowerText = text.toLowerCase();
150
- const type = this.detectChunkType(lowerText, text);
151
- const keywords = this.extractKeywords(lowerText);
152
- const baseScore = this.calculateBaseScore(text, lowerText, type);
153
- const finalScore = Math.max(ContextCompressor.MIN_SCORE, Math.min(ContextCompressor.MAX_SCORE, baseScore));
154
- return { text, score: finalScore, type, keywords, index };
155
- }
156
- /**
157
- * Detect chunk type based on content
158
- */
159
- static detectChunkType(lowerText, text) {
160
- if (text.includes('```'))
161
- return 'code';
162
- if (lowerText.match(/^(answer|solution|결과|답변):/i))
163
- return 'answer';
164
- if (lowerText.match(/^(timestamp|date|author|file):/i))
165
- return 'metadata';
166
- if (lowerText.includes('?'))
167
- return 'question';
168
- if (this.CODE_KEYWORDS.some(kw => lowerText.includes(kw)))
169
- return 'code';
170
- return 'explanation';
171
- }
172
- /**
173
- * Extract important keywords from text
174
- */
175
- static extractKeywords(lowerText) {
176
- const keywords = [];
177
- for (const keyword of this.IMPORTANT_KEYWORDS) {
178
- if (lowerText.includes(keyword.toLowerCase())) {
179
- keywords.push(keyword);
180
- }
181
- }
182
- return keywords;
183
- }
184
- /**
185
- * Calculate base score for chunk
186
- */
187
- static calculateBaseScore(text, lowerText, type) {
188
- let score = 0;
189
- // WHY type-based scoring: Answers/code carry the highest signal density;
190
- // metadata (timestamps, authors) is almost always reconstructible and expendable.
191
- score += this.getTypeScore(type);
192
- // Keyword bonus
193
- score += this.getKeywordScore(lowerText);
194
- // Structure bonuses
195
- score += this.getStructureScore(text);
196
- return score;
197
- }
198
- /**
199
- * Get score based on chunk type
200
- */
201
- static getTypeScore(type) {
202
- const typeScores = {
203
- code: 30,
204
- answer: 35,
205
- question: 25,
206
- explanation: 0,
207
- metadata: -20
208
- };
209
- return typeScores[type];
210
- }
211
- /**
212
- * Get score for important keywords
213
- */
214
- static getKeywordScore(lowerText) {
215
- let score = 0;
216
- for (const keyword of this.IMPORTANT_KEYWORDS) {
217
- if (lowerText.includes(keyword.toLowerCase())) {
218
- score += 15;
219
- }
220
- }
221
- return score;
222
- }
223
- /**
224
- * Get score based on text structure
225
- */
226
- static getStructureScore(text) {
227
- let score = 0;
228
- // Penalize very long chunks
229
- if (text.length > 1000)
230
- score -= 10;
231
- // Boost short, concise chunks
232
- if (text.length < 200 && text.split('\n').length <= 5)
233
- score += 10;
234
- // Boost structured content (lists)
235
- if (text.match(/^[\d\-\*•]/m))
236
- score += 15;
237
- // Boost code blocks
238
- if (text.includes('```'))
239
- score += 20;
240
- return score;
241
- }
242
- /**
243
- * Summarize removed chunk (one-liner)
244
- */
245
- static summarizeChunk(chunk) {
246
- const firstLine = chunk.text.split('\n')[0].trim();
247
- const summary = firstLine.length > 80
248
- ? firstLine.substring(0, 77) + '...'
249
- : firstLine;
250
- return `[${chunk.type}] ${summary}`;
251
- }
252
- /**
253
- * Reconstruct compressed context.
254
- *
255
- * Chunks are emitted in their original document order (the caller sorts
256
- * `selected` by index before calling). We intentionally do NOT regroup by
257
- * type: reordering by score/type means a small change to the input reshuffles
258
- * the whole output, destroying the common prefix between successive
259
- * compactions and forcing a full KV-cache recompute. Preserving order keeps
260
- * appended content at the tail so the prefix stays stable.
261
- */
262
- static reconstructContext(selected, removed) {
263
- const sections = [];
264
- // Add header
265
- sections.push('[Compressed Context - High Priority Information]\n');
266
- // Emit selected chunks in original order to keep the prefix stable.
267
- if (selected.length > 0) {
268
- sections.push(selected.map(c => c.text).join('\n\n'));
269
- sections.push('');
270
- }
271
- // Add summary of removed sections (low priority) at the tail
272
- if (removed.length > 0) {
273
- sections.push('## Removed Sections (Low Priority)');
274
- sections.push(removed.join('\n'));
275
- }
276
- return sections.join('\n');
277
- }
278
- /**
279
- * Extract key entities (names, numbers, dates) from context
280
- */
281
- static extractKeyEntities(context) {
282
- const names = Array.from(new Set(context.match(/\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*\b/g) || []));
283
- const numbers = Array.from(new Set(context.match(/\b\d+(?:\.\d+)?\b/g) || []));
284
- const dates = Array.from(new Set(context.match(/\d{4}-\d{2}-\d{2}|\d{2}\/\d{2}\/\d{4}/g) || []));
285
- const files = Array.from(new Set(context.match(/[\w\-]+\.[a-z]{2,4}\b/gi) || []));
286
- return { names, numbers, dates, files };
287
- }
288
- /**
289
- * Estimate token count (rough approximation)
290
- */
291
- static estimateTokens(text) {
292
- // GPT-like tokenization: ~1 token per 4 characters
293
- // More accurate would require actual tokenizer
294
- return Math.ceil(text.length / 4);
295
- }
296
- }
297
- //# sourceMappingURL=ContextCompressor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextCompressor.js","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,+DAA+D;AA4B/D,MAAM,OAAO,iBAAiB;IAC5B,4EAA4E;IAC5E,sFAAsF;IAC9E,MAAM,CAAU,cAAc,GAAG,GAAG,CAAC,CAAC,aAAa;IACnD,MAAM,CAAU,qBAAqB,GAAG,IAAI,CAAC;IACrD,+EAA+E;IAC/E,gFAAgF;IAChF,iFAAiF;IACzE,MAAM,CAAU,wBAAwB,GAAG,IAAI,CAAC;IAChD,MAAM,CAAU,SAAS,GAAG,GAAG,CAAC;IAChC,MAAM,CAAU,SAAS,GAAG,CAAC,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E,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,cAAc,CAAC,IAAY;QACvC,mDAAmD;QACnD,+CAA+C;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ContextCompressor.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextCompressor.test.d.ts","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.test.ts"],"names":[],"mappings":""}
@@ -1,25 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { ContextCompressor } from './ContextCompressor.js';
3
- describe('ContextCompressor.compress', () => {
4
- it('returns content unchanged when within token budget (early exit)', () => {
5
- // 4000 token target = 16,000 chars budget. 10,000 chars is well within it —
6
- // must NOT be rechunked/compressed (would break KV prefix-cache reuse).
7
- const content = 'const x = 1;\n'.repeat(770); // ~10,010 chars
8
- const result = ContextCompressor.compress(content, 4000);
9
- expect(result.compressed).toBe(content);
10
- expect(result.compressionRatio).toBe(1);
11
- expect(result.removedSections).toEqual([]);
12
- });
13
- it('compresses content exceeding the char-normalized budget', () => {
14
- // 25,000 chars ≈ 6,250 tokens > 4,000 target * 1.2 margin → must compress
15
- const content = 'some explanation text that goes on. '.repeat(700); // ~25,200 chars
16
- const result = ContextCompressor.compress(content, 4000);
17
- expect(result.compressedSize).toBeLessThan(result.originalSize);
18
- });
19
- it('handles empty context', () => {
20
- const result = ContextCompressor.compress('', 4000);
21
- expect(result.compressed).toBe('');
22
- expect(result.originalSize).toBe(0);
23
- });
24
- });
25
- //# sourceMappingURL=ContextCompressor.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextCompressor.test.js","sourceRoot":"","sources":["../../../src/infra/lib/ContextCompressor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAA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C,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * ProgressTracker - Structured progress tracking for long-running features
3
- * Inspired by Anthropic's "Effective Harnesses for Long-Running Agents"
4
- */
5
- export interface PhaseInfo {
6
- id: number;
7
- name: string;
8
- status: 'pending' | 'in_progress' | 'completed' | 'blocked';
9
- startedAt?: string;
10
- completedAt?: string;
11
- blockers?: string[];
12
- }
13
- export interface ProgressState {
14
- feature: string;
15
- spec: string;
16
- status: 'pending' | 'in_progress' | 'blocked' | 'completed';
17
- currentPhase: number;
18
- totalPhases: number;
19
- phases: PhaseInfo[];
20
- completedTasks: string[];
21
- pendingTasks: string[];
22
- blockers: string[];
23
- lastCommit?: string;
24
- lastUpdated: string;
25
- startedAt: string;
26
- sessionCount: number;
27
- }
28
- /**
29
- * Get progress file path for a project
30
- */
31
- export declare function getProgressPath(projectRoot: string): string;
32
- /**
33
- * Load progress state from file
34
- */
35
- export declare function loadProgress(projectRoot: string): ProgressState | null;
36
- /**
37
- * Save progress state to file
38
- */
39
- export declare function saveProgress(projectRoot: string, progress: ProgressState): void;
40
- /**
41
- * Initialize progress for a new feature
42
- */
43
- export declare function initProgress(projectRoot: string, feature: string, spec: string, phases: string[]): ProgressState;
44
- /**
45
- * Update phase progress
46
- */
47
- export declare function updatePhase(projectRoot: string, phaseNumber: number, status: PhaseInfo['status'], blockers?: string[]): ProgressState | null;
48
- /**
49
- * Add a task to completed list
50
- */
51
- export declare function completeTask(projectRoot: string, task: string): ProgressState | null;
52
- /**
53
- * Record last git commit
54
- */
55
- export declare function recordCommit(projectRoot: string, commitHash: string): ProgressState | null;
56
- /**
57
- * Increment session count (called on session restore)
58
- */
59
- export declare function incrementSession(projectRoot: string): ProgressState | null;
60
- /**
61
- * Format progress for display
62
- */
63
- export declare function formatProgress(progress: ProgressState): string;
64
- /**
65
- * Get progress summary for session startup
66
- */
67
- export declare function getProgressSummary(projectRoot: string): string | null;
68
- /**
69
- * Write plain text progress file (claude-progress.txt)
70
- * Claude가 context compaction 후에도 읽을 수 있는 human-readable 진행 파일
71
- */
72
- export declare function writeProgressText(projectRoot: string): void;
73
- //# sourceMappingURL=ProgressTracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProgressTracker.d.ts","sourceRoot":"","sources":["../../../src/infra/lib/ProgressTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAiBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAWtE;AAED;;GAE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