memorylink 1.0.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 (870) hide show
  1. package/.cursorrules +0 -0
  2. package/.github/workflows/buddy-check.yml +105 -0
  3. package/.github/workflows/memorylink-preflight.yml +63 -0
  4. package/.github/workflows/release-on-tag.yml +58 -0
  5. package/.github/workflows/stress-tests.yml +79 -0
  6. package/.memorylinkignore +24 -0
  7. package/5000_SCENARIOS_TEST_RESULTS.md +174 -0
  8. package/ADVANCED_SCENARIOS_TEST_RESULTS.md +377 -0
  9. package/AGGRESSIVE_RANDOM_TEST_RESULTS.md +134 -0
  10. package/AI_CONSENSUS_ANALYSIS.md +138 -0
  11. package/AI_CONSENSUS_ANALYSIS_FINAL.md +345 -0
  12. package/AI_CONSENSUS_ANALYSIS_v2.md +188 -0
  13. package/AI_CONSENSUS_ANALYSIS_v3.md +246 -0
  14. package/AI_CONSENSUS_ANALYSIS_v4.md +309 -0
  15. package/AI_CONSENSUS_ANALYSIS_v5.md +311 -0
  16. package/AI_CONSENSUS_ANALYSIS_v6.md +432 -0
  17. package/AI_PANEL_CLARIFICATION_REQUEST.md +37 -0
  18. package/AI_RESPONSES_BLACKBOX.md +338 -0
  19. package/AI_RESPONSES_CHATGPT.md +379 -0
  20. package/AI_RESPONSES_CLAUDE.md +464 -0
  21. package/AI_RESPONSES_CONSOLIDATED.md +560 -0
  22. package/AI_RESPONSES_DEEPSEEK.md +341 -0
  23. package/AI_RESPONSES_GEMINI.md +262 -0
  24. package/AI_RESPONSES_GROK.md +335 -0
  25. package/AI_RESPONSES_MANUS.md +246 -0
  26. package/AI_RESPONSES_PERPLEXITY.md +295 -0
  27. package/AI_RESPONSES_QWEN.md +335 -0
  28. package/AI_REVIEW_REQUEST.md +333 -0
  29. package/AI_STRATEGIC_CONSENSUS_COMPARISON.md +507 -0
  30. package/AI_VALIDATION_AND_GAP_ANALYSIS.md +410 -0
  31. package/ALL_10_AI_RESPONSES_FINAL.md +435 -0
  32. package/ALL_3_AI_RESPONSES_FINAL.md +305 -0
  33. package/ALL_4_AI_RESPONSES_FINAL.md +335 -0
  34. package/ALL_5_AI_RESPONSES_FINAL.md +349 -0
  35. package/ALL_6_AI_RESPONSES_FINAL.md +354 -0
  36. package/ALL_7_AI_RESPONSES_FINAL.md +369 -0
  37. package/ALL_8_AI_RESPONSES_FINAL.md +381 -0
  38. package/ALL_9_AI_RESPONSES_FINAL.md +398 -0
  39. package/ALL_AI_RESPONSES_TRACKER.md +152 -0
  40. package/ALL_AI_RESPONSES_VALIDATED.md +261 -0
  41. package/ALL_FEATURES_COMPLETE.md +198 -0
  42. package/BREAK_IT_TEST_RESULTS.md +273 -0
  43. package/BUDDY_CHECK_STRESS_TEST_PLAN.md +1089 -0
  44. package/CHANGELOG.md +135 -0
  45. package/CHATGPT_GAP_ANALYSIS.md +286 -0
  46. package/CHATGPT_V2_ANALYSIS.md +109 -0
  47. package/CHECK_MISSING_FEATURES.md +192 -0
  48. package/CI_CD_INTEGRATION.md +421 -0
  49. package/COMPETITIVE_LAUNCH_STRATEGY.md +257 -0
  50. package/COMPLETE_COMPETITIVE_ANALYSIS_ALL_AIS.md +339 -0
  51. package/COMPLETE_DEVELOPMENT_PLAN_ALL_AIS.md +622 -0
  52. package/COMPREHENSIVE_FEATURE_ANALYSIS_100_PERCENT.md +423 -0
  53. package/COMPREHENSIVE_TEST_SUMMARY.md +314 -0
  54. package/CONTINUOUS_TESTING_COMPLETE.md +268 -0
  55. package/CONTINUOUS_TESTING_GUIDE.md +328 -0
  56. package/CONTINUOUS_TEST_FINAL_RESULTS.md +148 -0
  57. package/CONTINUOUS_TEST_INSTRUCTIONS.md +173 -0
  58. package/CONTINUOUS_TEST_RESULTS.md +194 -0
  59. package/CONTINUOUS_TEST_STATUS.md +68 -0
  60. package/CURSOR_AI_BUDDY_CHECK_GUIDE.md +439 -0
  61. package/CURSOR_AI_INTEGRATION_GUIDE.md +775 -0
  62. package/CURSOR_AI_V1.4_NEXT_STEPS.md +314 -0
  63. package/CURSOR_BREAK_IT_TEST.md +389 -0
  64. package/CURSOR_DOCUMENTATION_RULES.md +259 -0
  65. package/CURSOR_HOSTILE_TEST_DOCUMENT.md +343 -0
  66. package/CURSOR_PROMPTS_FOR_TESTING.md +252 -0
  67. package/DEPLOYMENT_GUIDE.md +493 -0
  68. package/DEVELOPMENT_AND_OVERNIGHT_TESTING.md +304 -0
  69. package/DEVELOPMENT_PROGRESS.md +185 -0
  70. package/DOCS_CLEANUP_SUMMARY.md +192 -0
  71. package/DOC_CONFIDENTIALITY_RULES.md +259 -0
  72. package/E2E_TEST_REPORT_v1.3.0.md +196 -0
  73. package/E2E_TEST_RESULTS.md +250 -0
  74. package/E2E_TEST_SCENARIOS.md +357 -0
  75. package/END_TO_END_TEST_REPORT.md +217 -0
  76. package/ENHANCEMENT_RECOMMENDATIONS.md +368 -0
  77. package/EPIPE_FIX_SUMMARY.md +177 -0
  78. package/FEEDBACK_TEMPLATE.md +173 -0
  79. package/FINAL_100_PERCENT_CONFIRMATION.md +319 -0
  80. package/FINAL_8_AI_CONSENSUS_SUMMARY.md +355 -0
  81. package/FINAL_CONFIRMATION.md +143 -0
  82. package/FINAL_E2E_TEST_REPORT.md +248 -0
  83. package/FINAL_E2E_TEST_RESULTS.md +212 -0
  84. package/FINAL_LAUNCH_CLARIFICATION_SUMMARY.md +101 -0
  85. package/FINAL_LAUNCH_PLAN_BASED_ON_AI_CONSENSUS.md +410 -0
  86. package/FINAL_LAUNCH_SUMMARY.md +176 -0
  87. package/FINAL_PRODUCT_TEST.md +316 -0
  88. package/FINAL_PROJECT_STATUS.md +407 -0
  89. package/FINAL_STATUS_REPORT.md +244 -0
  90. package/FINAL_STRATEGIC_PLAN_9_AIS.md +576 -0
  91. package/FINAL_TEST_EXECUTION_REPORT.md +252 -0
  92. package/FINAL_VALIDATION_DOCUMENT.md +238 -0
  93. package/FINAL_VALIDATION_SUMMARY.md +230 -0
  94. package/FIX_SPECIAL_CHARS.sh +13 -0
  95. package/FRESH_SCENARIOS_TEST_RESULTS.md +358 -0
  96. package/GAP_EVALUATION_TEMPLATE.md +146 -0
  97. package/GITHUB_SETUP_GUIDE.md +193 -0
  98. package/HOSTILE_TEST_RESULTS.md +221 -0
  99. package/HOW_MEMORYLINK_HELPS_AI.md +401 -0
  100. package/IMPLEMENTATION_PLANS_DETAILED.md +516 -0
  101. package/LAUNCH_CHECKLIST.md +247 -0
  102. package/LAUNCH_DOCS_FRAMEWORK.md +378 -0
  103. package/LAUNCH_READINESS.md +148 -0
  104. package/LAUNCH_SEQUENCE.md +137 -0
  105. package/LICENSE +67 -0
  106. package/MARKET_ANALYSIS_AND_STRATEGY.md +280 -0
  107. package/MASTER_AI_VERIFICATION_DOCUMENT.md +1085 -0
  108. package/MASTER_VALIDATION_DOCUMENT.md +818 -0
  109. package/MINORITY_OPINION_ANALYSIS.md +464 -0
  110. package/NEW_RANDOM_TEST_RESULTS.md +127 -0
  111. package/NEW_SCENARIOS_TEST_RESULTS.md +272 -0
  112. package/NEXT_ACTIONS_COMPLETE.md +137 -0
  113. package/NEXT_PLAN_BASED_ON_AI_ANALYSES.md +413 -0
  114. package/NEXT_PLAN_BASED_ON_ALL_AI_RESPONSES.md +558 -0
  115. package/NEXT_STEPS.md +120 -0
  116. package/NEXT_STEPS_ACTION_PLAN.md +369 -0
  117. package/NPM_2FA_FIX.md +113 -0
  118. package/NPM_PUBLISH_TROUBLESHOOTING.md +230 -0
  119. package/PERPLEXITY_AI_VALIDATION_REQUEST.md +318 -0
  120. package/PERPLEXITY_AI_VALIDATION_RESPONSE.md +172 -0
  121. package/PERPLEXITY_BREAK_IT_VALIDATION.md +262 -0
  122. package/PERPLEXITY_DOCS_VALIDATION.md +237 -0
  123. package/PERPLEXITY_FEEDBACK_ACTION_PLAN.md +271 -0
  124. package/PERPLEXITY_FINAL_E2E_VALIDATION.md +210 -0
  125. package/PERPLEXITY_FINAL_SUMMARY.md +211 -0
  126. package/PERPLEXITY_PHASE2_VALIDATION.md +270 -0
  127. package/PERPLEXITY_PHASE2_VALIDATION_RESPONSE.md +136 -0
  128. package/PERPLEXITY_PRIORITY2_VALIDATION.md +321 -0
  129. package/PERPLEXITY_TELEMETRY_EXPLANATION.md +174 -0
  130. package/PERPLEXITY_TELEMETRY_VALIDATION.md +118 -0
  131. package/PERPLEXITY_TELEMETRY_VALIDATION_RESPONSE.md +154 -0
  132. package/PERPLEXITY_USER_GUIDE_VALIDATION.md +236 -0
  133. package/PERPLEXITY_VALIDATION_REQUEST.md +427 -0
  134. package/PERPLEXITY_VALIDATION_REQUEST_v1.5.1.md +190 -0
  135. package/PHASE_2_COMPLETE.md +149 -0
  136. package/PRE_LAUNCH_SECURITY_AUDIT.md +155 -0
  137. package/PRE_LAUNCH_TEST_CYCLE.md +326 -0
  138. package/PRE_LAUNCH_TEST_RESULTS.md +148 -0
  139. package/PROJECT_STRUCTURE_PLAN.md +104 -0
  140. package/PUBLIC_DOCS.md +90 -0
  141. package/PUBLISH_CHECKLIST.md +134 -0
  142. package/PUSH_INSTRUCTIONS.md +120 -0
  143. package/QUICK_START_TEST_CYCLE.md +76 -0
  144. package/README.md +557 -0
  145. package/README_TEST_INSTRUCTIONS.md +65 -0
  146. package/README_v1.5.1.md +137 -0
  147. package/REALISTIC_ASSESSMENT.md +186 -0
  148. package/REAL_WORLD_VALIDATION_COMPLETE.md +98 -0
  149. package/RED_TEAM_TESTING_GUIDE.md +302 -0
  150. package/RELEASE_NOTES_v1.0.0.md +125 -0
  151. package/RELEASE_NOTES_v1.5.1.md +105 -0
  152. package/REQUEST_COUNTERS.md +22 -0
  153. package/ROADMAP_v1.6.md +335 -0
  154. package/ROUND3_RANDOM_TEST_RESULTS.md +135 -0
  155. package/SECURITY_MODEL.md +577 -0
  156. package/SESSION_SUMMARY_CURRENT_STATE.md +206 -0
  157. package/SESSION_SUMMARY_REVIEW.md +203 -0
  158. package/SINGLE_RUN_ALL_SCENARIOS_TEST.sh +129 -0
  159. package/STRATEGIC_QUESTIONS_FOR_AI_VALIDATION.md +277 -0
  160. package/STRESS_TEST_CHECK_RESULTS.md +154 -0
  161. package/STRESS_TEST_EXECUTION_GUIDE.md +284 -0
  162. package/STRESS_TEST_IMPLEMENTATION_SUMMARY.md +221 -0
  163. package/TELEMETRY.md +370 -0
  164. package/TELEMETRY_COMPLETE_SUMMARY.md +231 -0
  165. package/TELEMETRY_CONTROL_POLICY.md +135 -0
  166. package/TELEMETRY_DESIGN_SUMMARY.md +210 -0
  167. package/TELEMETRY_FINAL_STATUS.md +178 -0
  168. package/TELEMETRY_NEXT_STEPS.md +258 -0
  169. package/TELEMETRY_TESTING_NOTES.md +217 -0
  170. package/TELEMETRY_WORK_COMPLETE.md +237 -0
  171. package/TEST_PLAN_v1.0.1.md +194 -0
  172. package/TEST_RESULTS_SUMMARY.md +128 -0
  173. package/TREE_SITTER_EXPLANATION.md +303 -0
  174. package/TROUBLESHOOTING.md +62 -0
  175. package/ULTIMATE_SCENARIOS_TEST_RESULTS.md +366 -0
  176. package/USER_FEEDBACK_TEMPLATE.md +104 -0
  177. package/USER_GUIDE.md +809 -0
  178. package/V1.1_DEVELOPMENT_COMPLETE.md +299 -0
  179. package/V1.1_SCENARIOS_ADDED.md +161 -0
  180. package/V1.2_CODE_STRUCTURE_IMPLEMENTATION.md +243 -0
  181. package/V1.3_COMPETITIVE_LAUNCH_COMPLETE.md +253 -0
  182. package/V1.3_COMPETITIVE_LAUNCH_IMPLEMENTATION_PLAN.md +385 -0
  183. package/V1.3_TEAM_PATTERNS_IMPLEMENTATION.md +183 -0
  184. package/V1.4_BUILD_PLAN_IMPLEMENTATION.md +698 -0
  185. package/V1.4_COMPLETE_SUMMARY_FOR_AI_REVIEW.md +516 -0
  186. package/V1.4_COMPLETE_VALIDATION_DOCUMENT.md +601 -0
  187. package/V1.4_DEVELOPMENT_PROGRESS.md +117 -0
  188. package/V1.4_FINAL_STATUS.md +147 -0
  189. package/V1.4_INTEGRATION_COMPLETE.md +207 -0
  190. package/V1.4_INTEGRATION_TEST_RESULTS.md +181 -0
  191. package/V1.4_OBSERVABILITY_AND_OVERRIDE_COMPLETE.md +180 -0
  192. package/V1.4_PHASE_3_COMPLETE.md +135 -0
  193. package/V1.4_RUNTIME_TESTING_GUIDE.md +364 -0
  194. package/V1.4_VERIFICATION_REPORT.md +199 -0
  195. package/V1.5.1_COMPLETE_SUMMARY.md +234 -0
  196. package/V1.5.1_RELEASE_NOTES.md +206 -0
  197. package/V1.5.1_RELEASE_READY.md +198 -0
  198. package/V1.5_COMPLETE_SUMMARY.md +264 -0
  199. package/V1.5_COMPLETE_VERIFICATION.md +183 -0
  200. package/V1.5_DESIGN_NOTES.md +272 -0
  201. package/V1.5_FINAL_STATUS.md +224 -0
  202. package/V1.5_IMPLEMENTATION_SUMMARY.md +113 -0
  203. package/V1.5_IMPROVEMENTS_COMPLETE.md +205 -0
  204. package/V1.5_PHASE1_COMPLETE.md +183 -0
  205. package/V1.5_PHASE1_PROGRESS.md +102 -0
  206. package/V1.5_PHASE2_COMPLETE.md +133 -0
  207. package/V1.5_PHASE2_PLAN.md +185 -0
  208. package/V1.5_PRIORITIZATION.md +313 -0
  209. package/V1.5_PRIORITY2_COMPLETE.md +150 -0
  210. package/V1.5_TESTING_COMPLETE.md +69 -0
  211. package/V1.5_TEST_RESULTS.md +178 -0
  212. package/V1.5_VALIDATION_RESULTS.md +209 -0
  213. package/V1.6_GAP_TRACKING.md +118 -0
  214. package/VALIDATION_SUMMARY_FOR_PERPLEXITY.md +83 -0
  215. package/VERIFICATION_REPORT.md +220 -0
  216. package/VERSION_UPDATE_VERIFICATION.md +76 -0
  217. package/config/tsconfig.json +21 -0
  218. package/dist/cli.d.ts +9 -0
  219. package/dist/cli.d.ts.map +1 -0
  220. package/dist/cli.js +1114 -0
  221. package/dist/cli.js.map +1 -0
  222. package/dist/commands/archive.d.ts +20 -0
  223. package/dist/commands/archive.d.ts.map +1 -0
  224. package/dist/commands/archive.js +231 -0
  225. package/dist/commands/archive.js.map +1 -0
  226. package/dist/commands/auto-context.d.ts +22 -0
  227. package/dist/commands/auto-context.d.ts.map +1 -0
  228. package/dist/commands/auto-context.js +172 -0
  229. package/dist/commands/auto-context.js.map +1 -0
  230. package/dist/commands/auto-log.d.ts +30 -0
  231. package/dist/commands/auto-log.d.ts.map +1 -0
  232. package/dist/commands/auto-log.js +500 -0
  233. package/dist/commands/auto-log.js.map +1 -0
  234. package/dist/commands/change.d.ts +13 -0
  235. package/dist/commands/change.d.ts.map +1 -0
  236. package/dist/commands/change.js +254 -0
  237. package/dist/commands/change.js.map +1 -0
  238. package/dist/commands/checkpoint.d.ts +26 -0
  239. package/dist/commands/checkpoint.d.ts.map +1 -0
  240. package/dist/commands/checkpoint.js +326 -0
  241. package/dist/commands/checkpoint.js.map +1 -0
  242. package/dist/commands/configure.d.ts +21 -0
  243. package/dist/commands/configure.d.ts.map +1 -0
  244. package/dist/commands/configure.js +283 -0
  245. package/dist/commands/configure.js.map +1 -0
  246. package/dist/commands/consolidate.d.ts +19 -0
  247. package/dist/commands/consolidate.d.ts.map +1 -0
  248. package/dist/commands/consolidate.js +236 -0
  249. package/dist/commands/consolidate.js.map +1 -0
  250. package/dist/commands/context.d.ts +10 -0
  251. package/dist/commands/context.d.ts.map +1 -0
  252. package/dist/commands/context.js +571 -0
  253. package/dist/commands/context.js.map +1 -0
  254. package/dist/commands/detect.d.ts +13 -0
  255. package/dist/commands/detect.d.ts.map +1 -0
  256. package/dist/commands/detect.js +187 -0
  257. package/dist/commands/detect.js.map +1 -0
  258. package/dist/commands/doctor.d.ts +19 -0
  259. package/dist/commands/doctor.d.ts.map +1 -0
  260. package/dist/commands/doctor.js +1272 -0
  261. package/dist/commands/doctor.js.map +1 -0
  262. package/dist/commands/export.d.ts +3 -0
  263. package/dist/commands/export.d.ts.map +1 -0
  264. package/dist/commands/export.js +95 -0
  265. package/dist/commands/export.js.map +1 -0
  266. package/dist/commands/graph.d.ts +25 -0
  267. package/dist/commands/graph.d.ts.map +1 -0
  268. package/dist/commands/graph.js +208 -0
  269. package/dist/commands/graph.js.map +1 -0
  270. package/dist/commands/hooks.d.ts +9 -0
  271. package/dist/commands/hooks.d.ts.map +1 -0
  272. package/dist/commands/hooks.js +240 -0
  273. package/dist/commands/hooks.js.map +1 -0
  274. package/dist/commands/impact.d.ts +18 -0
  275. package/dist/commands/impact.d.ts.map +1 -0
  276. package/dist/commands/impact.js +163 -0
  277. package/dist/commands/impact.js.map +1 -0
  278. package/dist/commands/index-vector.d.ts +13 -0
  279. package/dist/commands/index-vector.d.ts.map +1 -0
  280. package/dist/commands/index-vector.js +103 -0
  281. package/dist/commands/index-vector.js.map +1 -0
  282. package/dist/commands/index.d.ts +37 -0
  283. package/dist/commands/index.d.ts.map +1 -0
  284. package/dist/commands/index.js +105 -0
  285. package/dist/commands/index.js.map +1 -0
  286. package/dist/commands/init.d.ts +8 -0
  287. package/dist/commands/init.d.ts.map +1 -0
  288. package/dist/commands/init.js +200 -0
  289. package/dist/commands/init.js.map +1 -0
  290. package/dist/commands/inject.d.ts +22 -0
  291. package/dist/commands/inject.d.ts.map +1 -0
  292. package/dist/commands/inject.js +394 -0
  293. package/dist/commands/inject.js.map +1 -0
  294. package/dist/commands/learn.d.ts +13 -0
  295. package/dist/commands/learn.d.ts.map +1 -0
  296. package/dist/commands/learn.js +282 -0
  297. package/dist/commands/learn.js.map +1 -0
  298. package/dist/commands/lock.d.ts +35 -0
  299. package/dist/commands/lock.d.ts.map +1 -0
  300. package/dist/commands/lock.js +308 -0
  301. package/dist/commands/lock.js.map +1 -0
  302. package/dist/commands/memory.d.ts +15 -0
  303. package/dist/commands/memory.d.ts.map +1 -0
  304. package/dist/commands/memory.js +366 -0
  305. package/dist/commands/memory.js.map +1 -0
  306. package/dist/commands/migrate.d.ts +22 -0
  307. package/dist/commands/migrate.d.ts.map +1 -0
  308. package/dist/commands/migrate.js +458 -0
  309. package/dist/commands/migrate.js.map +1 -0
  310. package/dist/commands/patterns.d.ts +18 -0
  311. package/dist/commands/patterns.d.ts.map +1 -0
  312. package/dist/commands/patterns.js +120 -0
  313. package/dist/commands/patterns.js.map +1 -0
  314. package/dist/commands/protect.d.ts +12 -0
  315. package/dist/commands/protect.d.ts.map +1 -0
  316. package/dist/commands/protect.js +181 -0
  317. package/dist/commands/protect.js.map +1 -0
  318. package/dist/commands/quickstart.d.ts +11 -0
  319. package/dist/commands/quickstart.d.ts.map +1 -0
  320. package/dist/commands/quickstart.js +256 -0
  321. package/dist/commands/quickstart.js.map +1 -0
  322. package/dist/commands/repair.d.ts +13 -0
  323. package/dist/commands/repair.d.ts.map +1 -0
  324. package/dist/commands/repair.js +157 -0
  325. package/dist/commands/repair.js.map +1 -0
  326. package/dist/commands/resolve.d.ts +19 -0
  327. package/dist/commands/resolve.d.ts.map +1 -0
  328. package/dist/commands/resolve.js +355 -0
  329. package/dist/commands/resolve.js.map +1 -0
  330. package/dist/commands/roadmap.d.ts +5 -0
  331. package/dist/commands/roadmap.d.ts.map +1 -0
  332. package/dist/commands/roadmap.js +23 -0
  333. package/dist/commands/roadmap.js.map +1 -0
  334. package/dist/commands/scopes.d.ts +10 -0
  335. package/dist/commands/scopes.d.ts.map +1 -0
  336. package/dist/commands/scopes.js +80 -0
  337. package/dist/commands/scopes.js.map +1 -0
  338. package/dist/commands/search.d.ts +9 -0
  339. package/dist/commands/search.d.ts.map +1 -0
  340. package/dist/commands/search.js +313 -0
  341. package/dist/commands/search.js.map +1 -0
  342. package/dist/commands/setup.d.ts +13 -0
  343. package/dist/commands/setup.d.ts.map +1 -0
  344. package/dist/commands/setup.js +405 -0
  345. package/dist/commands/setup.js.map +1 -0
  346. package/dist/commands/snippet.d.ts +23 -0
  347. package/dist/commands/snippet.d.ts.map +1 -0
  348. package/dist/commands/snippet.js +235 -0
  349. package/dist/commands/snippet.js.map +1 -0
  350. package/dist/commands/stats.d.ts +15 -0
  351. package/dist/commands/stats.d.ts.map +1 -0
  352. package/dist/commands/stats.js +502 -0
  353. package/dist/commands/stats.js.map +1 -0
  354. package/dist/commands/status.d.ts +8 -0
  355. package/dist/commands/status.d.ts.map +1 -0
  356. package/dist/commands/status.js +134 -0
  357. package/dist/commands/status.js.map +1 -0
  358. package/dist/commands/suggest-tags.d.ts +9 -0
  359. package/dist/commands/suggest-tags.d.ts.map +1 -0
  360. package/dist/commands/suggest-tags.js +95 -0
  361. package/dist/commands/suggest-tags.js.map +1 -0
  362. package/dist/commands/sync-rules.d.ts +14 -0
  363. package/dist/commands/sync-rules.d.ts.map +1 -0
  364. package/dist/commands/sync-rules.js +211 -0
  365. package/dist/commands/sync-rules.js.map +1 -0
  366. package/dist/commands/sync.d.ts +24 -0
  367. package/dist/commands/sync.d.ts.map +1 -0
  368. package/dist/commands/sync.js +330 -0
  369. package/dist/commands/sync.js.map +1 -0
  370. package/dist/commands/telemetry-test.d.ts +24 -0
  371. package/dist/commands/telemetry-test.d.ts.map +1 -0
  372. package/dist/commands/telemetry-test.js +84 -0
  373. package/dist/commands/telemetry-test.js.map +1 -0
  374. package/dist/commands/template.d.ts +16 -0
  375. package/dist/commands/template.d.ts.map +1 -0
  376. package/dist/commands/template.js +122 -0
  377. package/dist/commands/template.js.map +1 -0
  378. package/dist/commands/validate.d.ts +11 -0
  379. package/dist/commands/validate.d.ts.map +1 -0
  380. package/dist/commands/validate.js +144 -0
  381. package/dist/commands/validate.js.map +1 -0
  382. package/dist/commands/watch-preferences.d.ts +17 -0
  383. package/dist/commands/watch-preferences.d.ts.map +1 -0
  384. package/dist/commands/watch-preferences.js +172 -0
  385. package/dist/commands/watch-preferences.js.map +1 -0
  386. package/dist/commands/watch.d.ts +11 -0
  387. package/dist/commands/watch.d.ts.map +1 -0
  388. package/dist/commands/watch.js +223 -0
  389. package/dist/commands/watch.js.map +1 -0
  390. package/dist/config/thresholds.d.ts +8 -0
  391. package/dist/config/thresholds.d.ts.map +1 -0
  392. package/dist/config/thresholds.js +10 -0
  393. package/dist/config/thresholds.js.map +1 -0
  394. package/dist/index.d.ts +9 -0
  395. package/dist/index.d.ts.map +1 -0
  396. package/dist/index.js +31 -0
  397. package/dist/index.js.map +1 -0
  398. package/dist/memorylink.d.ts +91 -0
  399. package/dist/memorylink.d.ts.map +1 -0
  400. package/dist/memorylink.js +208 -0
  401. package/dist/memorylink.js.map +1 -0
  402. package/dist/search/local-embeddings.d.ts +21 -0
  403. package/dist/search/local-embeddings.d.ts.map +1 -0
  404. package/dist/search/local-embeddings.js +87 -0
  405. package/dist/search/local-embeddings.js.map +1 -0
  406. package/dist/search/vector-search.d.ts +58 -0
  407. package/dist/search/vector-search.d.ts.map +1 -0
  408. package/dist/search/vector-search.js +535 -0
  409. package/dist/search/vector-search.js.map +1 -0
  410. package/dist/server/mcp-server.d.ts +18 -0
  411. package/dist/server/mcp-server.d.ts.map +1 -0
  412. package/dist/server/mcp-server.js +293 -0
  413. package/dist/server/mcp-server.js.map +1 -0
  414. package/dist/telemetry.d.ts +92 -0
  415. package/dist/telemetry.d.ts.map +1 -0
  416. package/dist/telemetry.js +339 -0
  417. package/dist/telemetry.js.map +1 -0
  418. package/dist/telemetry.test.d.ts +13 -0
  419. package/dist/telemetry.test.d.ts.map +1 -0
  420. package/dist/telemetry.test.js +324 -0
  421. package/dist/telemetry.test.js.map +1 -0
  422. package/dist/test-runner/TestRunner.d.ts +68 -0
  423. package/dist/test-runner/TestRunner.d.ts.map +1 -0
  424. package/dist/test-runner/TestRunner.js +384 -0
  425. package/dist/test-runner/TestRunner.js.map +1 -0
  426. package/dist/test-runner/performance-test.d.ts +36 -0
  427. package/dist/test-runner/performance-test.d.ts.map +1 -0
  428. package/dist/test-runner/performance-test.js +163 -0
  429. package/dist/test-runner/performance-test.js.map +1 -0
  430. package/dist/test-runner/run-tests.d.ts +7 -0
  431. package/dist/test-runner/run-tests.d.ts.map +1 -0
  432. package/dist/test-runner/run-tests.js +167 -0
  433. package/dist/test-runner/run-tests.js.map +1 -0
  434. package/dist/types.d.ts +400 -0
  435. package/dist/types.d.ts.map +1 -0
  436. package/dist/types.js +81 -0
  437. package/dist/types.js.map +1 -0
  438. package/dist/utils/batch-commits.d.ts +48 -0
  439. package/dist/utils/batch-commits.d.ts.map +1 -0
  440. package/dist/utils/batch-commits.js +164 -0
  441. package/dist/utils/batch-commits.js.map +1 -0
  442. package/dist/utils/code-structure.d.ts +62 -0
  443. package/dist/utils/code-structure.d.ts.map +1 -0
  444. package/dist/utils/code-structure.js +582 -0
  445. package/dist/utils/code-structure.js.map +1 -0
  446. package/dist/utils/commit-patterns.d.ts +24 -0
  447. package/dist/utils/commit-patterns.d.ts.map +1 -0
  448. package/dist/utils/commit-patterns.js +78 -0
  449. package/dist/utils/commit-patterns.js.map +1 -0
  450. package/dist/utils/observability.d.ts +47 -0
  451. package/dist/utils/observability.d.ts.map +1 -0
  452. package/dist/utils/observability.js +137 -0
  453. package/dist/utils/observability.js.map +1 -0
  454. package/dist/utils/quality.d.ts +32 -0
  455. package/dist/utils/quality.d.ts.map +1 -0
  456. package/dist/utils/quality.js +207 -0
  457. package/dist/utils/quality.js.map +1 -0
  458. package/dist/utils/semantic-search.d.ts +29 -0
  459. package/dist/utils/semantic-search.d.ts.map +1 -0
  460. package/dist/utils/semantic-search.js +167 -0
  461. package/dist/utils/semantic-search.js.map +1 -0
  462. package/dist/utils/streaming.d.ts +24 -0
  463. package/dist/utils/streaming.d.ts.map +1 -0
  464. package/dist/utils/streaming.js +121 -0
  465. package/dist/utils/streaming.js.map +1 -0
  466. package/dist/utils/tag-suggestions.d.ts +18 -0
  467. package/dist/utils/tag-suggestions.d.ts.map +1 -0
  468. package/dist/utils/tag-suggestions.js +103 -0
  469. package/dist/utils/tag-suggestions.js.map +1 -0
  470. package/dist/utils/team-patterns.d.ts +48 -0
  471. package/dist/utils/team-patterns.d.ts.map +1 -0
  472. package/dist/utils/team-patterns.js +413 -0
  473. package/dist/utils/team-patterns.js.map +1 -0
  474. package/dist/utils/templates.d.ts +36 -0
  475. package/dist/utils/templates.d.ts.map +1 -0
  476. package/dist/utils/templates.js +200 -0
  477. package/dist/utils/templates.js.map +1 -0
  478. package/dist/utils/tree-sitter-parser.d.ts +20 -0
  479. package/dist/utils/tree-sitter-parser.d.ts.map +1 -0
  480. package/dist/utils/tree-sitter-parser.js +259 -0
  481. package/dist/utils/tree-sitter-parser.js.map +1 -0
  482. package/dist/utils/v1.6-patterns.d.ts +117 -0
  483. package/dist/utils/v1.6-patterns.d.ts.map +1 -0
  484. package/dist/utils/v1.6-patterns.js +201 -0
  485. package/dist/utils/v1.6-patterns.js.map +1 -0
  486. package/dist/utils.d.ts +176 -0
  487. package/dist/utils.d.ts.map +1 -0
  488. package/dist/utils.js +822 -0
  489. package/dist/utils.js.map +1 -0
  490. package/docs/1000_SCENARIOS_TEST_RESULTS.md +138 -0
  491. package/docs/1000_UNIQUE_SCENARIOS_TEST.md +171 -0
  492. package/docs/100_PERCENT_PASS_RATE_VERIFICATION.md +111 -0
  493. package/docs/5000_SCENARIOS_ISSUE_ANALYSIS.md +96 -0
  494. package/docs/5000_SCENARIOS_TEST_PLAN.md +281 -0
  495. package/docs/AGENT_CONTRACT.md +240 -0
  496. package/docs/AI_RESPONSE_ANALYZER.md +157 -0
  497. package/docs/AI_RESPONSE_TRACKER.md +923 -0
  498. package/docs/AI_TESTING_PROMPT.md +307 -0
  499. package/docs/AI_VALIDATION_PROMPTS.md +366 -0
  500. package/docs/ALL_AI_ANALYSES_CONSOLIDATED.md +354 -0
  501. package/docs/ALL_AI_CONSOLIDATION_FINAL.md +372 -0
  502. package/docs/ALL_AI_TEST_CONSOLIDATION.md +290 -0
  503. package/docs/ALL_AI_VALIDATION_SYNTHESIS.md +241 -0
  504. package/docs/BEST_TESTING_SOLUTION.md +227 -0
  505. package/docs/BLACKBOX_AI_ANALYSIS.md +288 -0
  506. package/docs/BLACKBOX_AI_CLARIFICATION.md +55 -0
  507. package/docs/BLACKBOX_AI_STRATEGIC_VALIDATION.md +283 -0
  508. package/docs/BLACKBOX_AI_VALIDATION_RESPONSE.md +251 -0
  509. package/docs/BLACKBOX_AI_VALIDATION_RESPONSE_v2.md +402 -0
  510. package/docs/BLACKBOX_LAUNCH_VALIDATION.md +25 -0
  511. package/docs/BLACKBOX_SUPERMEMORY_VALIDATION_AND_PLAN.md +50 -0
  512. package/docs/CAPACITY_AND_ALTERNATIVES_ANALYSIS.md +289 -0
  513. package/docs/CHATGPT_AI_CLARIFICATION.md +65 -0
  514. package/docs/CHATGPT_FINAL_VALIDATION.md +348 -0
  515. package/docs/CHATGPT_IMPLEMENTATION_GUIDE.md +325 -0
  516. package/docs/CHATGPT_LAUNCH_VALIDATION.md +47 -0
  517. package/docs/CHATGPT_MEMORY_QUALITY_AND_VSCODE_CHECK.md +43 -0
  518. package/docs/CHATGPT_SCOPE_REALITY_CHECK.md +35 -0
  519. package/docs/CHATGPT_STRATEGIC_VALIDATION.md +329 -0
  520. package/docs/CHATGPT_VALIDATION_RESPONSE.md +332 -0
  521. package/docs/CHATGPT_VALIDATION_RESPONSE_v2.md +294 -0
  522. package/docs/CHATGPT_VALIDATION_RESULTS.md +143 -0
  523. package/docs/CLAUDE_AI_ANALYSIS.md +692 -0
  524. package/docs/CLAUDE_AI_CLARIFICATION.md +67 -0
  525. package/docs/CLAUDE_AI_STRATEGIC_VALIDATION.md +578 -0
  526. package/docs/CLAUDE_AI_VALIDATION_RESPONSE.md +374 -0
  527. package/docs/CLAUDE_AI_VALIDATION_RESPONSE_v2.md +463 -0
  528. package/docs/CLAUDE_FINAL_VALIDATION.md +679 -0
  529. package/docs/CLAUDE_LAUNCH_VALIDATION.md +27 -0
  530. package/docs/CLAUDE_SUPERMEMORY_LAUNCH_PRIORITIES.md +44 -0
  531. package/docs/CLAUDE_UNIVERSAL_VISION.md +18 -0
  532. package/docs/COMPLETE_AI_VALIDATION_SYNTHESIS.md +229 -0
  533. package/docs/COMPLETE_MEMORY_ANALYSIS_SUMMARY.md +323 -0
  534. package/docs/COMPLETE_STRATEGIC_LAUNCH_PLAN.md +241 -0
  535. package/docs/COPILOT_LANGCHAIN_MEMORY_COMPARISON_AND_PLAN.md +43 -0
  536. package/docs/CRITICAL_FIXES_ACTION_PLAN.md +251 -0
  537. package/docs/CRITICAL_MEMORY_USAGE_PROMPTS.md +290 -0
  538. package/docs/CURSOR_AI_MEMORY_ANALYSIS.md +479 -0
  539. package/docs/CURSOR_AI_MEMORY_WORKFLOW_ANALYSIS.md +267 -0
  540. package/docs/CURSOR_AI_TEST_RESULTS.md +298 -0
  541. package/docs/DEEPSEEK_AI_CLARIFICATION.md +52 -0
  542. package/docs/DEEPSEEK_AI_IMPLEMENTATION_GUIDE.md +398 -0
  543. package/docs/DEEPSEEK_AI_STRATEGIC_VALIDATION.md +348 -0
  544. package/docs/DEEPSEEK_AI_VALIDATION_RESPONSE.md +276 -0
  545. package/docs/DEEPSEEK_AI_VALIDATION_RESPONSE_v2.md +325 -0
  546. package/docs/DEEPSEEK_FINAL_VALIDATION.md +337 -0
  547. package/docs/DEEPSEEK_LAUNCH_VALIDATION.md +55 -0
  548. package/docs/DEEPSEEK_SCOPE_REALITY_CHECK.md +30 -0
  549. package/docs/DEEPSEEK_SUPERMEMORY_ADOPTION_AND_VSCODE_PIVOT.md +47 -0
  550. package/docs/DEEPSEEK_VALIDATION_RESULTS.md +165 -0
  551. package/docs/DEVELOPMENT_TESTING_PROTOCOL.md +378 -0
  552. package/docs/E2E_TEST_RESULTS.md +102 -0
  553. package/docs/END_TO_END_MEMORY_ISSUE_ANALYSIS.md +442 -0
  554. package/docs/FEATURE_1_GIT_SYNC_PLAN.md +228 -0
  555. package/docs/FEATURE_2_AUTO_LOGGING_PLAN.md +239 -0
  556. package/docs/FEATURE_3_CODE_SNIPPET_PLAN.md +249 -0
  557. package/docs/FEATURE_4_TAG_NORMALIZATION_PLAN.md +211 -0
  558. package/docs/FEATURE_5_WINDOWS_PATH_HANDLING_PLAN.md +199 -0
  559. package/docs/FEATURE_6_CONFLICT_DETECTION_PLAN.md +126 -0
  560. package/docs/FEATURE_IMPLEMENTATION_REPORT.md +203 -0
  561. package/docs/FINAL_COMPLETE_LAUNCH_DECISION.md +255 -0
  562. package/docs/FINAL_LAUNCH_DECISION.md +235 -0
  563. package/docs/FINAL_LAUNCH_DECISION_ALL_AIS.md +226 -0
  564. package/docs/FINAL_SCENARIO_VERIFICATION.md +363 -0
  565. package/docs/FIX_100_PERCENT_ANALYSIS.md +133 -0
  566. package/docs/FRAMEWORK_STRUCTURE.md +94 -0
  567. package/docs/GEMINI_AI_ANALYSIS.md +156 -0
  568. package/docs/GEMINI_AI_CLARIFICATION.md +47 -0
  569. package/docs/GEMINI_AI_STRATEGIC_VALIDATION.md +235 -0
  570. package/docs/GEMINI_AI_VALIDATION_RESPONSE.md +238 -0
  571. package/docs/GEMINI_AI_VALIDATION_RESPONSE_v2.md +168 -0
  572. package/docs/GEMINI_FINAL_VALIDATION.md +204 -0
  573. package/docs/GEMINI_LAUNCH_VALIDATION.md +30 -0
  574. package/docs/GEMINI_SCOPE_AND_UNIVERSALITY_DEBATE.md +25 -0
  575. package/docs/GEMINI_SUPERMEMORY_TREE_SITTER_MANDATE.md +43 -0
  576. package/docs/GEMINI_VALIDATION_RESULTS.md +183 -0
  577. package/docs/GROK_AI_ANALYSIS.md +278 -0
  578. package/docs/GROK_AI_CLARIFICATION.md +52 -0
  579. package/docs/GROK_AI_STRATEGIC_VALIDATION.md +306 -0
  580. package/docs/GROK_AI_VALIDATION_RESPONSE.md +252 -0
  581. package/docs/GROK_AI_VALIDATION_RESPONSE_v2.md +264 -0
  582. package/docs/GROK_FINAL_VALIDATION.md +251 -0
  583. package/docs/GROK_LAUNCH_VALIDATION.md +24 -0
  584. package/docs/GROK_SCOPE_REALITY_CHECK.md +28 -0
  585. package/docs/GROK_SUPERMEMORY_LAUNCH_ANALYSIS.md +44 -0
  586. package/docs/GROK_VALIDATION_RESULTS.md +180 -0
  587. package/docs/IMPLEMENTATION_PLAN_16_CRITICAL_FIXES.md +641 -0
  588. package/docs/LANGCHAIN_AND_LANGGRAPH_INTEGRATION_PLAN.md +51 -0
  589. package/docs/LAUNCH_DECISION_FINAL.md +243 -0
  590. package/docs/MANUS_AI_ANALYSIS.md +171 -0
  591. package/docs/MANUS_AI_CLARIFICATION.md +43 -0
  592. package/docs/MANUS_AI_VALIDATION_RESPONSE.md +335 -0
  593. package/docs/MANUS_AI_VALIDATION_RESPONSE_v2.md +226 -0
  594. package/docs/MANUS_FINAL_VALIDATION.md +257 -0
  595. package/docs/MANUS_VALIDATION_RESULTS.md +237 -0
  596. package/docs/MCP_SERVER_SETUP.md +167 -0
  597. package/docs/MEMORYLINK_7AI_FINAL_CONFIRMATION.md +210 -0
  598. package/docs/MEMORYLINK_CURSOR_AI_DEVELOPMENT_GUIDE.md +1092 -0
  599. package/docs/MEMORYLINK_DEVELOPMENT_PLAN_CURSOR_AI.md +629 -0
  600. package/docs/MEMORYLINK_FINAL_7AI_CLARIFICATION.md +184 -0
  601. package/docs/MEMORYLINK_MASTER_DOCUMENT_v4.md +1338 -0
  602. package/docs/MEMORYLINK_NAMING_ANALYSIS.md +427 -0
  603. package/docs/MEMORYLINK_REAL_WORLD_SCENARIOS.md +3517 -0
  604. package/docs/MEMORYLINK_STORAGE_COMPARISON.md +498 -0
  605. package/docs/MEMORYLINK_V1.0_FINAL_IMPLEMENTATION_PLAN.md +285 -0
  606. package/docs/MEMORYLINK_VALIDATION_COMPLETE_ANALYSIS.md +207 -0
  607. package/docs/MEMORYLINK_VS_MEMORY_APPS_ANALYSIS.md +667 -0
  608. package/docs/MEMORYLINK_v1.0_BUILD_DOCUMENT_FINAL.md +1928 -0
  609. package/docs/MEMORY_USAGE_FIX_IMPLEMENTATION.md +314 -0
  610. package/docs/MISTRAL_AI_ANALYSIS.md +189 -0
  611. package/docs/MISTRAL_AI_CLARIFICATION.md +57 -0
  612. package/docs/MISTRAL_AI_STRATEGIC_VALIDATION.md +334 -0
  613. package/docs/MISTRAL_AI_TESTING_REQUEST.md +261 -0
  614. package/docs/MISTRAL_AI_VALIDATION_RESPONSE.md +446 -0
  615. package/docs/MISTRAL_AI_VALIDATION_RESPONSE_v2.md +227 -0
  616. package/docs/MISTRAL_FINAL_VALIDATION.md +398 -0
  617. package/docs/MISTRAL_LAUNCH_VALIDATION.md +32 -0
  618. package/docs/MISTRAL_SCOPE_REALITY_CHECK.md +32 -0
  619. package/docs/MISTRAL_SUPERMEMORY_LAUNCH_ANALYSIS.md +43 -0
  620. package/docs/MISTRAL_VALIDATION_RESULTS.md +371 -0
  621. package/docs/NEXT_PLAN.md +300 -0
  622. package/docs/PERPLEXITY_AI_ANALYSIS.md +285 -0
  623. package/docs/PERPLEXITY_AI_CLARIFICATION.md +57 -0
  624. package/docs/PERPLEXITY_AI_STRATEGIC_VALIDATION.md +288 -0
  625. package/docs/PERPLEXITY_AI_VALIDATION_RESPONSE.md +350 -0
  626. package/docs/PERPLEXITY_AI_VALIDATION_RESPONSE_v2.md +260 -0
  627. package/docs/PERPLEXITY_FINAL_VALIDATION.md +320 -0
  628. package/docs/PERPLEXITY_LAUNCH_VALIDATION.md +42 -0
  629. package/docs/PERPLEXITY_MEMORY_QUALITY_AND_VSCODE_PLAN.md +56 -0
  630. package/docs/PERPLEXITY_SCOPE_REALITY_CHECK.md +31 -0
  631. package/docs/PERPLEXITY_VALIDATION_RESULTS.md +154 -0
  632. package/docs/PRE_LAUNCH_GAP_ANALYSIS.md +663 -0
  633. package/docs/PROJECT_STRUCTURE_PLAN.md +104 -0
  634. package/docs/QWEN_AI_ANALYSIS.md +176 -0
  635. package/docs/QWEN_AI_CLARIFICATION.md +60 -0
  636. package/docs/QWEN_AI_STRATEGIC_VALIDATION.md +241 -0
  637. package/docs/QWEN_AI_VALIDATION_RESPONSE.md +197 -0
  638. package/docs/QWEN_AI_VALIDATION_RESPONSE_v2.md +186 -0
  639. package/docs/QWEN_FINAL_VALIDATION.md +284 -0
  640. package/docs/QWEN_LAUNCH_VALIDATION.md +26 -0
  641. package/docs/QWEN_SCENARIOS_TEST_RESULTS.md +244 -0
  642. package/docs/QWEN_SCOPE_REALITY_CHECK.md +26 -0
  643. package/docs/QWEN_SUPERMEMORY_LAUNCH_AND_ENFORCEMENT_PLAN.md +56 -0
  644. package/docs/QWEN_VALIDATION_RESULTS.md +185 -0
  645. package/docs/README.md +479 -0
  646. package/docs/REAL_PRODUCT_LAUNCH_DECISION.md +185 -0
  647. package/docs/RECIPES.md +424 -0
  648. package/docs/RELEASE_NOTES_v1.0.0.md +193 -0
  649. package/docs/SCENARIO_INVENTORY_AND_VERIFICATION.md +284 -0
  650. package/docs/SINGLE_RUN_1018_SCENARIOS_RESULTS.md +142 -0
  651. package/docs/TESTING.md +256 -0
  652. package/docs/TESTING_STRATEGY.md +194 -0
  653. package/docs/TROUBLESHOOTING.md +188 -0
  654. package/docs/ULTIMATE_LAUNCH_DECISION.md +246 -0
  655. package/docs/WHAT_WE_BUILT.md +504 -0
  656. package/docs/v1.0_LAUNCH_CHECKLIST.md +104 -0
  657. package/examples/README.md +199 -0
  658. package/examples/chatgpt-context.js +161 -0
  659. package/examples/ci-integration.js +288 -0
  660. package/examples/sync-from-cursor.js +196 -0
  661. package/extensions/vscode/README.md +25 -0
  662. package/extensions/vscode/out/buddy-check.js +208 -0
  663. package/extensions/vscode/out/buddy-check.js.map +1 -0
  664. package/extensions/vscode/out/extension.js +413 -0
  665. package/extensions/vscode/out/extension.js.map +1 -0
  666. package/extensions/vscode/out/sidebar.js +409 -0
  667. package/extensions/vscode/out/sidebar.js.map +1 -0
  668. package/extensions/vscode/package.json +92 -0
  669. package/extensions/vscode/src/buddy-check.ts +220 -0
  670. package/extensions/vscode/src/extension.ts +425 -0
  671. package/extensions/vscode/src/shims-vscode.d.ts +2 -0
  672. package/extensions/vscode/src/sidebar.ts +431 -0
  673. package/extensions/vscode/tsconfig.json +14 -0
  674. package/k6-load-test.js +86 -0
  675. package/package.json +68 -0
  676. package/run-professional-tests.sh +72 -0
  677. package/scripts/monitor-continuous-test.sh +17 -0
  678. package/scripts/reorganize-project.sh +164 -0
  679. package/scripts/run-tests-parallel.sh +111 -0
  680. package/scripts/run-tests.sh +30 -0
  681. package/scripts/setup-framework.sh +139 -0
  682. package/scripts/setup-testing.sh +96 -0
  683. package/scripts/stress-test/README.md +86 -0
  684. package/scripts/stress-test/create-all-scenarios.sh +17 -0
  685. package/scripts/stress-test/create-remaining-scenarios.sh +3 -0
  686. package/scripts/stress-test/dev-test.sh +21 -0
  687. package/scripts/stress-test/monitor-continuous.sh +149 -0
  688. package/scripts/stress-test/overnight-test.sh +30 -0
  689. package/scripts/stress-test/quick-test.sh +21 -0
  690. package/scripts/stress-test/run-all-tests.sh +157 -0
  691. package/scripts/stress-test/run-continuous.sh +300 -0
  692. package/scripts/stress-test/run-stress-test.sh +153 -0
  693. package/scripts/stress-test/set1/1_1_mass_refactoring.sh +117 -0
  694. package/scripts/stress-test/set1/1_1_mass_refactoring_simple.sh +117 -0
  695. package/scripts/stress-test/set1/1_2_function_rename.sh +95 -0
  696. package/scripts/stress-test/set1/1_3_feature_flags.sh +93 -0
  697. package/scripts/stress-test/set1/1_4_feature_removal.sh +57 -0
  698. package/scripts/stress-test/set1/1_5_schema_changes.sh +42 -0
  699. package/scripts/stress-test/set1/1_6_dependency_update.sh +47 -0
  700. package/scripts/stress-test/set1/1_7_config_modification.sh +53 -0
  701. package/scripts/stress-test/set2/2_1_payment_logging.sh +49 -0
  702. package/scripts/stress-test/set2/2_2_test_data_generation.sh +43 -0
  703. package/scripts/stress-test/set2/2_3_documentation_leak.sh +45 -0
  704. package/scripts/stress-test/set2/2_4_api_key_rotation.sh +45 -0
  705. package/scripts/stress-test/set2/2_5_hardcoded_secrets.sh +45 -0
  706. package/scripts/stress-test/set2/2_6_debug_output.sh +49 -0
  707. package/scripts/stress-test/set3/3_1_billing_modification.sh +47 -0
  708. package/scripts/stress-test/set3/3_2_migration_deletion.sh +43 -0
  709. package/scripts/stress-test/set3/3_3_auth_middleware.sh +52 -0
  710. package/scripts/stress-test/set3/3_4_permission_bypass.sh +48 -0
  711. package/scripts/stress-test/set3/3_5_config_modification.sh +43 -0
  712. package/scripts/stress-test/set3/3_6_core_library.sh +51 -0
  713. package/scripts/stress-test/set3/3_7_test_infrastructure.sh +49 -0
  714. package/scripts/stress-test/set4/4_1_concurrent_features.sh +49 -0
  715. package/scripts/stress-test/set4/4_2_lock_acquisition.sh +32 -0
  716. package/scripts/stress-test/set4/4_3_migration_hotfix.sh +43 -0
  717. package/scripts/stress-test/set4/4_4_overlapping_scopes.sh +50 -0
  718. package/scripts/stress-test/set4/4_5_lock_timeout.sh +34 -0
  719. package/scripts/stress-test/set4/4_6_concurrent_stats.sh +33 -0
  720. package/scripts/stress-test/set5/5_1_wrong_decision.sh +41 -0
  721. package/scripts/stress-test/set5/5_2_outdated_docs.sh +40 -0
  722. package/scripts/stress-test/set5/5_3_conflicting_memories.sh +34 -0
  723. package/scripts/stress-test/set5/5_4_deleted_file_references.sh +38 -0
  724. package/scripts/stress-test/set5/5_5_old_pattern.sh +41 -0
  725. package/scripts/stress-test/set5/5_6_wrong_architecture.sh +42 -0
  726. package/scripts/stress-test/set5/5_7_high_trust_stale.sh +46 -0
  727. package/scripts/stress-test/set5/5_8_observability_stale.sh +36 -0
  728. package/scripts/stress-test/setup-test-repo-simple.sh +144 -0
  729. package/scripts/stress-test/setup-test-repo.sh +154 -0
  730. package/scripts/stress-test/start-continuous.sh +48 -0
  731. package/scripts/stress-test/stop-continuous.sh +42 -0
  732. package/scripts/stress-test/template-scenario.sh +115 -0
  733. package/scripts/test-advanced-scenarios.sh +411 -0
  734. package/scripts/test-continuous-30min.sh +307 -0
  735. package/scripts/test-continuous-enhanced.sh +250 -0
  736. package/scripts/test-e2e-comprehensive.sh +114 -0
  737. package/scripts/test-e2e-random.sh +359 -0
  738. package/scripts/test-fresh-scenarios.sh +412 -0
  739. package/scripts/test-new-scenarios.sh +374 -0
  740. package/scripts/test-quick-random.sh +97 -0
  741. package/scripts/test-runtime.sh +129 -0
  742. package/scripts/test-telemetry-local.sh +193 -0
  743. package/scripts/test-ultimate-scenarios.sh +428 -0
  744. package/scripts/test-v1.5-complete.sh +225 -0
  745. package/scripts/test-v1.5-phase1.sh +222 -0
  746. package/src/cli.ts +1259 -0
  747. package/src/commands/archive.ts +252 -0
  748. package/src/commands/auto-context.ts +159 -0
  749. package/src/commands/auto-log.ts +531 -0
  750. package/src/commands/change.ts +298 -0
  751. package/src/commands/checkpoint.ts +390 -0
  752. package/src/commands/configure.ts +297 -0
  753. package/src/commands/consolidate.ts +263 -0
  754. package/src/commands/context.ts +618 -0
  755. package/src/commands/detect.ts +181 -0
  756. package/src/commands/doctor.ts +1468 -0
  757. package/src/commands/export.ts +77 -0
  758. package/src/commands/graph.ts +214 -0
  759. package/src/commands/hooks.ts +245 -0
  760. package/src/commands/impact.ts +163 -0
  761. package/src/commands/index-vector.ts +126 -0
  762. package/src/commands/index.ts +57 -0
  763. package/src/commands/init.ts +194 -0
  764. package/src/commands/inject.ts +440 -0
  765. package/src/commands/learn.ts +328 -0
  766. package/src/commands/lock.ts +345 -0
  767. package/src/commands/memory.ts +415 -0
  768. package/src/commands/migrate.ts +540 -0
  769. package/src/commands/patterns.ts +158 -0
  770. package/src/commands/protect.ts +199 -0
  771. package/src/commands/quickstart.ts +259 -0
  772. package/src/commands/resolve.ts +373 -0
  773. package/src/commands/roadmap.ts +25 -0
  774. package/src/commands/scopes.ts +113 -0
  775. package/src/commands/search.ts +365 -0
  776. package/src/commands/setup.ts +430 -0
  777. package/src/commands/snippet.ts +271 -0
  778. package/src/commands/stats.ts +591 -0
  779. package/src/commands/status.ts +127 -0
  780. package/src/commands/suggest-tags.ts +122 -0
  781. package/src/commands/sync-rules.ts +218 -0
  782. package/src/commands/sync.ts +363 -0
  783. package/src/commands/telemetry-test.ts +97 -0
  784. package/src/commands/template.ts +166 -0
  785. package/src/commands/validate.ts +191 -0
  786. package/src/commands/watch-preferences.ts +162 -0
  787. package/src/commands/watch.ts +239 -0
  788. package/src/config/thresholds.ts +14 -0
  789. package/src/index.ts +12 -0
  790. package/src/memorylink.ts +308 -0
  791. package/src/search/local-embeddings.ts +94 -0
  792. package/src/search/vector-search.ts +608 -0
  793. package/src/server/mcp-server.ts +355 -0
  794. package/src/telemetry.ts +391 -0
  795. package/src/test-runner/TestRunner.ts +421 -0
  796. package/src/test-runner/performance-test.ts +161 -0
  797. package/src/test-runner/run-tests.ts +152 -0
  798. package/src/types.ts +533 -0
  799. package/src/utils/batch-commits.ts +162 -0
  800. package/src/utils/code-structure.ts +686 -0
  801. package/src/utils/commit-patterns.ts +87 -0
  802. package/src/utils/observability.ts +149 -0
  803. package/src/utils/quality.ts +230 -0
  804. package/src/utils/semantic-search.ts +222 -0
  805. package/src/utils/streaming.ts +109 -0
  806. package/src/utils/tag-suggestions.ts +117 -0
  807. package/src/utils/team-patterns.ts +499 -0
  808. package/src/utils/templates.ts +181 -0
  809. package/src/utils/tree-sitter-parser.ts +246 -0
  810. package/src/utils/v1.6-patterns.ts +227 -0
  811. package/src/utils.ts +885 -0
  812. package/test-all-features.sh +102 -0
  813. package/test-all-implemented-features.sh +209 -0
  814. package/test-all-new-features.sh +171 -0
  815. package/test-auto-log.txt +1 -0
  816. package/test-batch-commits.sh +47 -0
  817. package/test-conflict-resolution.sh +47 -0
  818. package/test-e2e.sh +22 -0
  819. package/test-end-to-end.sh +151 -0
  820. package/test-enhanced-autocapture.sh +164 -0
  821. package/test-inject.sh +44 -0
  822. package/test-mcp-server.sh +67 -0
  823. package/test-pagination.sh +37 -0
  824. package/test-python-go-structure.sh +164 -0
  825. package/test-quality-validation.sh +167 -0
  826. package/test-results-quick-smoke.json +13 -0
  827. package/test-results-targeted-perf.json +23 -0
  828. package/test-results.json +2272 -0
  829. package/test-scenarios/payment-logging.ts +17 -0
  830. package/test-scenarios/test-config.ts +13 -0
  831. package/test-semantic-search.sh +161 -0
  832. package/test-tag-intelligence.sh +49 -0
  833. package/test-vector-search.sh +64 -0
  834. package/test-vscode-extension.sh +144 -0
  835. package/test-watcher-file.txt +2 -0
  836. package/test-watcher-file2.txt +1 -0
  837. package/test-watcher.sh +103 -0
  838. package/test_qwen_scenarios.sh +285 -0
  839. package/tests/scenarios/4000_HARD_SCENARIOS.sh +4137 -0
  840. package/tests/scenarios/ADD_V1.1_SCENARIOS.sh +93 -0
  841. package/tests/scenarios/AGGRESSIVE_RANDOM_E2E_TEST.sh +474 -0
  842. package/tests/scenarios/COMPLETE_PRODUCT_VALIDATION.sh +227 -0
  843. package/tests/scenarios/COMPREHENSIVE_E2E_TEST.sh +426 -0
  844. package/tests/scenarios/CONTINUOUS_RANDOM_STRESS_TEST.sh +240 -0
  845. package/tests/scenarios/EXECUTE_10000_SCENARIOS.sh +61 -0
  846. package/tests/scenarios/EXECUTE_1000_UNIQUE_SCENARIOS.sh +190 -0
  847. package/tests/scenarios/EXECUTE_5000_SCENARIOS_SPLIT.sh +192 -0
  848. package/tests/scenarios/EXECUTE_5000_TOTAL_SCENARIOS.sh +162 -0
  849. package/tests/scenarios/EXECUTE_5040_SCENARIOS_WITH_V1.1.sh +251 -0
  850. package/tests/scenarios/EXECUTE_8_BATCHES_500.sh +51 -0
  851. package/tests/scenarios/EXECUTE_QUICK_SMOKE.sh +9 -0
  852. package/tests/scenarios/EXECUTE_SINGLE_BATCH.sh +117 -0
  853. package/tests/scenarios/EXECUTE_TARGETED_PERF.sh +19 -0
  854. package/tests/scenarios/GENERATE_1000_SCENARIOS.sh +235 -0
  855. package/tests/scenarios/GENERATE_4000_HARD_SCENARIOS.sh +266 -0
  856. package/tests/scenarios/GENERATE_4000_HARD_SCENARIOS_FIXED.sh +267 -0
  857. package/tests/scenarios/GENERATE_4000_HARD_SCENARIOS_FIXED_V2.sh +267 -0
  858. package/tests/scenarios/NEW_RANDOM_E2E_TEST.sh +422 -0
  859. package/tests/scenarios/QUICK_SMOKE_200.sh +38 -0
  860. package/tests/scenarios/QUICK_SMOKE_MINI.sh +3 -0
  861. package/tests/scenarios/RANDOM_REAL_WORLD_SCENARIOS.sh +372 -0
  862. package/tests/scenarios/ROUND3_RANDOM_E2E_TEST.sh +446 -0
  863. package/tests/scenarios/RUN_AGGRESSIVE_AND_SUMMARY.sh +51 -0
  864. package/tests/scenarios/RUN_ALL_1018_SCENARIOS.sh +161 -0
  865. package/tests/scenarios/TARGETED_PERF.sh +75 -0
  866. package/tests/scenarios/V1.1_FEATURES_SCENARIOS.sh +145 -0
  867. package/tests/unit/utils.test.ts +52 -0
  868. package/tests/v1.1-features-scenarios.sh +276 -0
  869. package/tsconfig.json +21 -0
  870. package/v1.6_FEATURE_REQUESTS.md +79 -0
package/src/cli.ts ADDED
@@ -0,0 +1,1259 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MemoryLink CLI
4
+ * Universal memory layer for AI coding assistants
5
+ *
6
+ * Cross-AI sharing • Audit trails • Learning tracking • File protection
7
+ */
8
+
9
+ import { Command } from 'commander';
10
+ import { execSync } from 'child_process';
11
+ import {
12
+ initCommand,
13
+ protectCommand,
14
+ unprotectCommand,
15
+ listProtectedCommand,
16
+ memoryCommand,
17
+ listMemoryCommand,
18
+ clearMemoryCommand,
19
+ changeCommand,
20
+ listChangesCommand,
21
+ clearChangesCommand,
22
+ learnCommand,
23
+ listLearningsCommand,
24
+ clearLearningsCommand,
25
+ watchCommand,
26
+ statusCommand,
27
+ doctorCommand,
28
+ getContextCommand,
29
+ exportContextCommand,
30
+ hooksInstallCommand,
31
+ hooksUninstallCommand,
32
+ hooksStatusCommand,
33
+ configureCommand,
34
+ quickConfigureCommand,
35
+ injectCommand,
36
+ quickInjectCommand,
37
+ setupCursorCommand,
38
+ setupClaudeCommand,
39
+ setupChatGPTCommand,
40
+ setupCopilotCommand,
41
+ setupAllCommand,
42
+ quickstartCommand,
43
+ migrateCommand,
44
+ searchCommand,
45
+ syncCommand,
46
+ autoLogInstallCommand,
47
+ autoLogUninstallCommand,
48
+ autoLogStatusCommand,
49
+ autoLogCommitCommand,
50
+ snippetCommand,
51
+ syncRulesCommand,
52
+ roadmapCommand,
53
+ validateCommand,
54
+ templateListCommand,
55
+ templateShowCommand,
56
+ templateCreateCommand,
57
+ templateDeleteCommand,
58
+ } from './commands/index.js';
59
+ import {
60
+ checkpointCreateCommand,
61
+ checkpointListCommand,
62
+ checkpointDiffCommand,
63
+ checkpointRestoreCommand,
64
+ } from './commands/checkpoint.js';
65
+ import {
66
+ lockAcquireCommand,
67
+ lockReleaseCommand,
68
+ lockStatusCommand,
69
+ lockRenewCommand,
70
+ } from './commands/lock.js';
71
+ import { statsCommand } from './commands/stats.js';
72
+ import { scopesListCommand } from './commands/scopes.js';
73
+ import { telemetryTestCommand } from './commands/telemetry-test.js';
74
+ import { DEFAULT_THRESHOLDS } from './config/thresholds.js';
75
+ import { startMCPServer } from './server/mcp-server.js';
76
+ import type { LearningStatus } from './types.js';
77
+
78
+ const program = new Command();
79
+
80
+ function validateEnvironment(thisCommand: Command) {
81
+ const cmdName = thisCommand.name();
82
+ // Skip global checks for purely informational commands
83
+ const skip = new Set(['help', 'server']);
84
+ if (skip.has(cmdName)) {
85
+ return;
86
+ }
87
+
88
+ // Basic Node.js version check
89
+ const nodeVersion = process.versions.node.split('.')[0];
90
+ const nodeMajor = parseInt(nodeVersion, 10);
91
+ if (Number.isFinite(nodeMajor) && nodeMajor < 16) {
92
+ console.error('\x1b[31m✗\x1b[0m Node.js 16 or higher is required to run MemoryLink.');
93
+ console.error(`Detected Node.js version: ${process.version}`);
94
+ console.error('Please upgrade Node.js from https://nodejs.org/');
95
+ process.exit(1);
96
+ }
97
+
98
+ // Git availability check – many commands rely on Git for hooks and sync
99
+ try {
100
+ execSync('git --version', { stdio: 'ignore' });
101
+ } catch {
102
+ console.error('\x1b[31m✗\x1b[0m Git is required for MemoryLink to manage hooks and share memory via your repo.');
103
+ console.error('Please install Git from https://git-scm.com/downloads and try again.');
104
+ process.exit(1);
105
+ }
106
+ }
107
+
108
+ // ASCII art logo
109
+ const LOGO = `
110
+ \x1b[36m╔══════════════════════════════════════════════════════════╗
111
+ ║ ║
112
+ ║ 🧠 MemoryLink v1.0.0 ║
113
+ ║ Universal memory layer for AI coding assistants ║
114
+ ║ ║
115
+ ╚══════════════════════════════════════════════════════════╝\x1b[0m
116
+ `;
117
+
118
+ program
119
+ .name('memorylink')
120
+ .description('Universal memory layer for AI coding assistants')
121
+ .version('1.0.0')
122
+ .option('-v, --verbose', 'Enable verbose output')
123
+ .hook('preAction', (thisCommand) => {
124
+ const opts = thisCommand.opts();
125
+ if (opts.verbose) {
126
+ console.log('\x1b[90m[verbose mode enabled]\x1b[0m');
127
+ }
128
+ // Basic environment validation for most commands
129
+ validateEnvironment(thisCommand);
130
+ });
131
+
132
+ // ============================================
133
+ // INIT COMMAND
134
+ // ============================================
135
+ program
136
+ .command('init')
137
+ .description('Initialize MemoryLink in current directory')
138
+ .action(async () => {
139
+ const opts = program.opts();
140
+ await initCommand({ verbose: opts.verbose });
141
+ });
142
+
143
+ // ============================================
144
+ // QUICKSTART COMMAND (Recommended by Qwen - reduces friction)
145
+ // ============================================
146
+ program
147
+ .command('quickstart')
148
+ .description('One-command setup: init + protect + hooks + AI config')
149
+ .option('-t, --tool <tool>', 'Primary AI tool (cursor, claude, chatgpt, copilot)', 'cursor')
150
+ .option('--skip-hooks', 'Skip Git hooks installation')
151
+ .action(async (cmdOpts: { tool?: string; skipHooks?: boolean }) => {
152
+ const opts = program.opts();
153
+ await quickstartCommand({
154
+ verbose: opts.verbose,
155
+ tool: cmdOpts.tool,
156
+ skipHooks: cmdOpts.skipHooks,
157
+ });
158
+ });
159
+
160
+ // ============================================
161
+ // PROTECT COMMANDS
162
+ // ============================================
163
+ program
164
+ .command('protect <file>')
165
+ .description('Add a file to the protected list')
166
+ .option('-r, --reason <reason>', 'Reason for protection')
167
+ .action(async (file: string, cmdOpts: { reason?: string }) => {
168
+ const opts = program.opts();
169
+ await protectCommand(file, { verbose: opts.verbose, ...cmdOpts });
170
+ });
171
+
172
+ program
173
+ .command('unprotect <file>')
174
+ .description('Remove a file from the protected list')
175
+ .action(async (file: string) => {
176
+ const opts = program.opts();
177
+ await unprotectCommand(file, { verbose: opts.verbose });
178
+ });
179
+
180
+ program
181
+ .command('protected')
182
+ .description('List all protected files')
183
+ .action(async () => {
184
+ const opts = program.opts();
185
+ await listProtectedCommand({ verbose: opts.verbose });
186
+ });
187
+
188
+ // ============================================
189
+ // ROADMAP
190
+ // ============================================
191
+ program
192
+ .command('roadmap')
193
+ .description('Show launch roadmap and build thresholds (Tree-sitter, dashboard, VS Code)')
194
+ .action(async () => {
195
+ await roadmapCommand();
196
+ });
197
+
198
+ // ============================================
199
+ // VALIDATE COMMAND (v1.3 - Week 5: Memory Quality Validation)
200
+ // ============================================
201
+ program
202
+ .command('validate')
203
+ .description('Validate memory quality and generate quality report')
204
+ .option('--fix', 'Show fix suggestions (not yet implemented)')
205
+ .action(async (cmdOpts: { fix?: boolean }) => {
206
+ const opts = program.opts();
207
+ await validateCommand({ verbose: opts.verbose, fix: cmdOpts.fix || false });
208
+ });
209
+
210
+ // ============================================
211
+ // TEMPLATE COMMANDS (v1.3 - Week 6: Enhanced Auto-Capture)
212
+ // ============================================
213
+ const templateCmd = program
214
+ .command('template')
215
+ .description('Template management commands');
216
+
217
+ templateCmd
218
+ .command('list')
219
+ .alias('ls')
220
+ .description('List all available templates')
221
+ .action(async () => {
222
+ const opts = program.opts();
223
+ await templateListCommand({ verbose: opts.verbose });
224
+ });
225
+
226
+ templateCmd
227
+ .command('show <name>')
228
+ .alias('get')
229
+ .description('Show template details')
230
+ .action(async (name: string) => {
231
+ const opts = program.opts();
232
+ await templateShowCommand(name, { verbose: opts.verbose });
233
+ });
234
+
235
+ templateCmd
236
+ .command('create <name>')
237
+ .description('Create a custom template')
238
+ .option('--description <desc>', 'Template description')
239
+ .option('--type <type>', 'Template type: memory or learning', 'memory')
240
+ .option('--fields <json>', 'Template fields as JSON string')
241
+ .action(async (name: string, cmdOpts: { description?: string; type?: string; fields?: string }) => {
242
+ const opts = program.opts();
243
+ await templateCreateCommand(name, {
244
+ verbose: opts.verbose,
245
+ description: cmdOpts.description,
246
+ type: cmdOpts.type as 'memory' | 'learning',
247
+ fields: cmdOpts.fields,
248
+ });
249
+ });
250
+
251
+ templateCmd
252
+ .command('delete <name>')
253
+ .alias('rm')
254
+ .description('Delete a custom template')
255
+ .action(async (name: string) => {
256
+ const opts = program.opts();
257
+ await templateDeleteCommand(name, { verbose: opts.verbose });
258
+ });
259
+
260
+ // ============================================
261
+ // EXPORT COMMAND
262
+ // ============================================
263
+ program
264
+ .command('export')
265
+ .description('Export context to file or stdout')
266
+ .option('-o, --output <file>', 'Output file (defaults to stdout)')
267
+ .option('-f, --format <format>', 'Format: json or jsonl', 'json')
268
+ .option('-l, --limit <n>', 'Optional cap per section', '0')
269
+ .action(async (cmdOpts: { output?: string; format?: string; limit?: string }) => {
270
+ const opts = program.opts();
271
+ const limit = cmdOpts.limit ? parseInt(cmdOpts.limit, 10) : undefined;
272
+ await exportContextCommand(cmdOpts.output, { verbose: opts.verbose, format: cmdOpts.format as any, limit: limit === 0 ? undefined : limit });
273
+ });
274
+
275
+ // ============================================
276
+ // MEMORY COMMANDS
277
+ // ============================================
278
+ program
279
+ .command('memory <message>')
280
+ .description('Add an entry to the shared memory log (v1.5 Phase 2: add --scope for project scoping)')
281
+ .option('-t, --tags <tags>', 'Comma-separated tags')
282
+ .option('--type <type>', 'Entry type: note, decision, doc_ref, context, rule', 'note')
283
+ .option('-f, --force', 'Bypass secret detection (use with caution)')
284
+ .option('--scope <scope>', 'v1.5 Phase 2: Project scope (e.g., "frontend", "backend", "auth-module")')
285
+ .action(async (message: string, cmdOpts: { tags?: string; type?: string; force?: boolean; scope?: string }) => {
286
+ const opts = program.opts();
287
+ await memoryCommand(message, {
288
+ verbose: opts.verbose,
289
+ tags: cmdOpts.tags,
290
+ type: cmdOpts.type as any,
291
+ force: cmdOpts.force,
292
+ scope: cmdOpts.scope,
293
+ });
294
+ });
295
+
296
+ program
297
+ .command('memories')
298
+ .description('List memory entries')
299
+ .option('-l, --limit <n>', 'Number of entries to show', '20')
300
+ .option('--tag <tag>', 'Filter by tag')
301
+ .option('--since <duration>', 'Filter by time (e.g., 7d, 2w, 1m)')
302
+ .option('--json', 'Output as JSON')
303
+ .action(async (cmdOpts: { limit?: string; tag?: string; since?: string; json?: boolean }) => {
304
+ const opts = program.opts();
305
+ await listMemoryCommand({
306
+ verbose: opts.verbose,
307
+ limit: parseInt(cmdOpts.limit || '20', 10),
308
+ tag: cmdOpts.tag,
309
+ since: cmdOpts.since,
310
+ json: cmdOpts.json,
311
+ });
312
+ });
313
+
314
+ // ============================================
315
+ // SNIPPET COMMAND (Code Snippet Data Type)
316
+ // ============================================
317
+ program
318
+ .command('snippet <description>')
319
+ .description('Add a code snippet to memory')
320
+ .option('--code <code>', 'Code content (or use --file)')
321
+ .option('--file <path>', 'Read code from file')
322
+ .option('--lines <range>', 'Line range (e.g., "42" or "42-50")')
323
+ .option('--language <lang>', 'Programming language')
324
+ .option('--context <text>', 'Why this snippet is important')
325
+ .option('-t, --tags <tags>', 'Comma-separated tags')
326
+ .option('-f, --force', 'Bypass secret detection (use with caution)')
327
+ .action(async (description: string, cmdOpts: { code?: string; file?: string; lines?: string; language?: string; context?: string; tags?: string; force?: boolean }) => {
328
+ const opts = program.opts();
329
+ await snippetCommand(description, {
330
+ verbose: opts.verbose,
331
+ code: cmdOpts.code,
332
+ file: cmdOpts.file,
333
+ lines: cmdOpts.lines,
334
+ language: cmdOpts.language,
335
+ context: cmdOpts.context,
336
+ tags: cmdOpts.tags,
337
+ force: cmdOpts.force,
338
+ });
339
+ });
340
+
341
+ // ============================================
342
+ // CHANGE COMMANDS
343
+ // ============================================
344
+ program
345
+ .command('change <file> <reason>')
346
+ .description('Log a file change to the audit trail')
347
+ .option('-a, --agent <agent>', 'AI agent that made the change', 'user')
348
+ .option('--action <action>', 'Action type: created, edited, deleted, renamed', 'edited')
349
+ .option('-f, --force', 'Bypass secret detection (use with caution)')
350
+ .option('--justification <text>', 'Detailed justification for the change')
351
+ .option('--reviewed-by <name>', 'Person who reviewed the change')
352
+ .option('--tested <status>', 'Testing status/notes (e.g., "Yes - 42 tests pass")')
353
+ .option('--impact <description>', 'Human-readable impact description')
354
+ .action(async (file: string, reason: string, cmdOpts: {
355
+ agent?: string;
356
+ action?: string;
357
+ force?: boolean;
358
+ justification?: string;
359
+ reviewedBy?: string;
360
+ tested?: string;
361
+ impact?: string;
362
+ }) => {
363
+ const opts = program.opts();
364
+ await changeCommand(file, reason, {
365
+ verbose: opts.verbose,
366
+ agent: cmdOpts.agent,
367
+ action: cmdOpts.action as any,
368
+ force: cmdOpts.force,
369
+ justification: cmdOpts.justification,
370
+ reviewedBy: cmdOpts.reviewedBy,
371
+ tested: cmdOpts.tested,
372
+ impact: cmdOpts.impact,
373
+ });
374
+ });
375
+
376
+ program
377
+ .command('changes')
378
+ .description('List change entries')
379
+ .option('-l, --limit <n>', 'Number of entries to show', '20')
380
+ .option('--file <file>', 'Filter by file')
381
+ .option('--since <duration>', 'Filter by time (e.g., 7d, 2w, 1m)')
382
+ .option('--json', 'Output as JSON')
383
+ .action(async (cmdOpts: { limit?: string; file?: string; since?: string; json?: boolean }) => {
384
+ const opts = program.opts();
385
+ await listChangesCommand({
386
+ verbose: opts.verbose,
387
+ limit: parseInt(cmdOpts.limit || '20', 10),
388
+ file: cmdOpts.file,
389
+ since: cmdOpts.since,
390
+ json: cmdOpts.json,
391
+ });
392
+ });
393
+
394
+ // ============================================
395
+ // LEARN COMMANDS
396
+ // ============================================
397
+ program
398
+ .command('learn <problem> <solution>')
399
+ .description('Track a solution attempt')
400
+ .requiredOption('-s, --status <status>', 'SUCCESS or FAILED')
401
+ .option('-t, --tags <tags>', 'Comma-separated tags')
402
+ .option('-r, --reason <reason>', 'Why it succeeded/failed')
403
+ .option('-f, --force', 'Bypass secret detection (use with caution)')
404
+ .action(async (problem: string, solution: string, cmdOpts: { status: string; tags?: string; reason?: string; force?: boolean }) => {
405
+ const opts = program.opts();
406
+ const status = cmdOpts.status.toUpperCase() as LearningStatus;
407
+ if (status !== 'SUCCESS' && status !== 'FAILED') {
408
+ console.error('\x1b[31m✗\x1b[0m Status must be SUCCESS or FAILED');
409
+ process.exit(1);
410
+ }
411
+ await learnCommand(problem, solution, {
412
+ verbose: opts.verbose,
413
+ status,
414
+ tags: cmdOpts.tags,
415
+ reason: cmdOpts.reason,
416
+ force: cmdOpts.force,
417
+ });
418
+ });
419
+
420
+ program
421
+ .command('learnings')
422
+ .description('List learnings')
423
+ .option('-l, --limit <n>', 'Number of entries to show', '20')
424
+ .option('-s, --status <status>', 'Filter by SUCCESS or FAILED')
425
+ .option('--tag <tag>', 'Filter by tag')
426
+ .option('--since <duration>', 'Filter by time (e.g., 7d, 2w, 1m)')
427
+ .option('--json', 'Output as JSON')
428
+ .action(async (cmdOpts: { limit?: string; status?: string; tag?: string; since?: string; json?: boolean }) => {
429
+ const opts = program.opts();
430
+ await listLearningsCommand({
431
+ verbose: opts.verbose,
432
+ limit: parseInt(cmdOpts.limit || '20', 10),
433
+ status: cmdOpts.status?.toUpperCase() as LearningStatus | undefined,
434
+ tag: cmdOpts.tag,
435
+ since: cmdOpts.since,
436
+ json: cmdOpts.json,
437
+ });
438
+ });
439
+
440
+ // ============================================
441
+ // WATCH COMMAND
442
+ // ============================================
443
+ program
444
+ .command('watch')
445
+ .description('Start file watcher for real-time protection and auto-logging')
446
+ .option('-i, --ignore <patterns...>', 'Additional patterns to ignore')
447
+ .option('--no-auto-log', 'Disable auto-logging to memory.log (default: enabled)')
448
+ .action(async (cmdOpts: { ignore?: string[]; autoLog?: boolean }) => {
449
+ const opts = program.opts();
450
+ await watchCommand({
451
+ verbose: opts.verbose,
452
+ ignore: cmdOpts.ignore,
453
+ autoLog: cmdOpts.autoLog !== false // Default to true
454
+ });
455
+ });
456
+
457
+ // ============================================
458
+ // DETECT COMMAND
459
+ // ============================================
460
+ program
461
+ .command('detect')
462
+ .description('Auto-detect AI tools configured in the project')
463
+ .action(async () => {
464
+ const opts = program.opts();
465
+ const { detectCommand } = await import('./commands/detect.js');
466
+ await detectCommand({ verbose: opts.verbose });
467
+ });
468
+
469
+ // ============================================
470
+ // WATCH-PREFERENCES COMMAND
471
+ // ============================================
472
+ program
473
+ .command('watch-preferences')
474
+ .description('Watch for preference/rule changes and auto-reload AI tool configs')
475
+ .action(async () => {
476
+ const opts = program.opts();
477
+ const { watchPreferencesCommand } = await import('./commands/watch-preferences.js');
478
+ await watchPreferencesCommand({ verbose: opts.verbose });
479
+ });
480
+
481
+ // ============================================
482
+ // STATUS COMMAND
483
+ // ============================================
484
+ program
485
+ .command('status')
486
+ .description('Show MemoryLink status')
487
+ .action(async () => {
488
+ const opts = program.opts();
489
+ await statusCommand({ verbose: opts.verbose });
490
+ });
491
+
492
+ // ============================================
493
+ // DOCTOR COMMAND (includes secret scanning - All 7 AIs require)
494
+ // ============================================
495
+ program
496
+ .command('doctor')
497
+ .description('Run health checks, diagnostics, and security scanning (v1.4: add --preflight or --postflight for Buddy-Check)')
498
+ .option('--scan-secrets', 'Scan for potential secrets in logs (default: true)')
499
+ .option('--auto-fix', 'Show auto-fix suggestions for issues')
500
+ .option('--preflight', 'v1.4: Run preflight check before AI operations')
501
+ .option('--postflight', 'v1.4: Run postflight check after AI operations')
502
+ .option('--changed', 'v1.4: Only check changed files (for postflight)')
503
+ .option('--fix', 'v1.4: Auto-fix memory records (for postflight)')
504
+ .option('--json', 'v1.4: Output as JSON')
505
+ .option('--for <agent>', 'v1.4: Agent/user ID for preflight')
506
+ .option('--pr <number>', 'v1.4: PR number for preflight')
507
+ .option('--branch <branch>', 'v1.4: Branch name for preflight')
508
+ .action(async (cmdOpts: {
509
+ scanSecrets?: boolean;
510
+ autoFix?: boolean;
511
+ preflight?: boolean;
512
+ postflight?: boolean;
513
+ changed?: boolean;
514
+ fix?: boolean;
515
+ json?: boolean;
516
+ for?: string;
517
+ pr?: string;
518
+ branch?: string;
519
+ }) => {
520
+ const opts = program.opts();
521
+ await doctorCommand({
522
+ verbose: opts.verbose,
523
+ scanSecrets: cmdOpts.scanSecrets !== false,
524
+ autoFix: cmdOpts.autoFix || false,
525
+ preflight: cmdOpts.preflight || false,
526
+ postflight: cmdOpts.postflight || false,
527
+ changed: cmdOpts.changed || false,
528
+ fix: cmdOpts.fix || false,
529
+ json: cmdOpts.json || false,
530
+ for: cmdOpts.for,
531
+ pr: cmdOpts.pr,
532
+ branch: cmdOpts.branch,
533
+ });
534
+ });
535
+
536
+ // ============================================
537
+ // CONFIGURE COMMAND
538
+ // ============================================
539
+ program
540
+ .command('configure')
541
+ .description('Interactive setup wizard')
542
+ .option('-q, --quick', 'Quick config with defaults')
543
+ .option('--ai-tools <tools>', 'AI tools (comma-separated)')
544
+ .option('--project-type <type>', 'Project type (node, react, python, general)')
545
+ .action(async (cmdOpts: { quick?: boolean; aiTools?: string; projectType?: string }) => {
546
+ const opts = program.opts();
547
+ if (cmdOpts.quick) {
548
+ await quickConfigureCommand({
549
+ verbose: opts.verbose,
550
+ aiTools: cmdOpts.aiTools,
551
+ projectType: cmdOpts.projectType,
552
+ });
553
+ } else {
554
+ await configureCommand({ verbose: opts.verbose });
555
+ }
556
+ });
557
+
558
+ // ============================================
559
+ // GET-CONTEXT COMMAND
560
+ // ============================================
561
+ program
562
+ .command('get-context [tagOrFile]')
563
+ .description('Get filtered context for AI (v1.5 Phase 1: --smart, Phase 2: --scope)')
564
+ .option('-l, --limit <n>', 'Limit entries per section', '50')
565
+ .option('--since <date>', 'Filter by date (ISO format or relative: 7d, 2w, 1m)')
566
+ .option('--tag <tag>', 'Filter by tag')
567
+ .option('--smart', 'v1.5 Phase 1: Smart filtering with ranking (trust, recency, relevance)')
568
+ .option('--task <description>', 'v1.5 Phase 1: Task description for smart filtering')
569
+ .option('--scope <scope>', 'v1.5 Phase 2: Filter by project scope (e.g., "frontend", "backend")')
570
+ .action(async (tagOrFile: string | undefined, cmdOpts: { limit?: string; since?: string; tag?: string; smart?: boolean; task?: string; scope?: string }) => {
571
+ const opts = program.opts();
572
+ await getContextCommand(tagOrFile, {
573
+ verbose: opts.verbose,
574
+ limit: parseInt(cmdOpts.limit || '50', 10),
575
+ since: cmdOpts.since,
576
+ tag: cmdOpts.tag,
577
+ smart: cmdOpts.smart,
578
+ task: cmdOpts.task,
579
+ scope: cmdOpts.scope,
580
+ });
581
+ });
582
+
583
+ // ============================================
584
+ // INJECT COMMAND (1-click clipboard copy)
585
+ // ============================================
586
+ program
587
+ .command('inject')
588
+ .description('Copy context to clipboard for easy pasting (with OS notifications)')
589
+ .option('-l, --limit <n>', 'Limit entries', '20')
590
+ .option('--since <date>', 'Filter by date (7d, 2w, etc.)')
591
+ .option('--tag <tag>', 'Filter by tag')
592
+ .option('--type <type>', 'Filter by memory type')
593
+ .option('-r, --raw', 'Raw format without markdown')
594
+ .option('-q, --quick', 'Quick inject (minimal context)')
595
+ .option('--no-notify', 'Disable OS notifications')
596
+ .option('--auto', 'Auto mode: copy and exit silently')
597
+ .action(async (cmdOpts: { limit?: string; since?: string; tag?: string; type?: string; raw?: boolean; quick?: boolean; notify?: boolean; auto?: boolean }) => {
598
+ const opts = program.opts();
599
+ if (cmdOpts.quick) {
600
+ await quickInjectCommand({ verbose: opts.verbose, notify: cmdOpts.notify !== false });
601
+ } else {
602
+ await injectCommand({
603
+ verbose: opts.verbose,
604
+ limit: parseInt(cmdOpts.limit || '20', 10),
605
+ since: cmdOpts.since,
606
+ tag: cmdOpts.tag,
607
+ type: cmdOpts.type as any,
608
+ raw: cmdOpts.raw,
609
+ notify: cmdOpts.notify !== false,
610
+ auto: cmdOpts.auto,
611
+ });
612
+ }
613
+ });
614
+
615
+ // ============================================
616
+ // SETUP COMMANDS (AI-specific)
617
+ // ============================================
618
+ const setup = program
619
+ .command('setup')
620
+ .description('Setup MemoryLink for specific AI tools');
621
+
622
+ setup
623
+ .command('cursor')
624
+ .description('Create .cursorrules for Cursor AI')
625
+ .action(async () => {
626
+ const opts = program.opts();
627
+ await setupCursorCommand({ verbose: opts.verbose });
628
+ });
629
+
630
+ setup
631
+ .command('claude')
632
+ .description('Create CLAUDE_INSTRUCTIONS.md')
633
+ .action(async () => {
634
+ const opts = program.opts();
635
+ await setupClaudeCommand({ verbose: opts.verbose });
636
+ });
637
+
638
+ setup
639
+ .command('chatgpt')
640
+ .description('Create CHATGPT_INSTRUCTIONS.md')
641
+ .action(async () => {
642
+ const opts = program.opts();
643
+ await setupChatGPTCommand({ verbose: opts.verbose });
644
+ });
645
+
646
+ setup
647
+ .command('copilot')
648
+ .description('Create .github/copilot-instructions.md')
649
+ .action(async () => {
650
+ const opts = program.opts();
651
+ await setupCopilotCommand({ verbose: opts.verbose });
652
+ });
653
+
654
+ setup
655
+ .command('all')
656
+ .description('Setup for all AI tools')
657
+ .action(async () => {
658
+ const opts = program.opts();
659
+ await setupAllCommand({ verbose: opts.verbose });
660
+ });
661
+
662
+ // ============================================
663
+ // MCP SERVER COMMAND
664
+ // ============================================
665
+ program
666
+ .command('server')
667
+ .description('Start MCP server for Claude Desktop and Cursor integration')
668
+ .option('--stdio', 'Use stdio transport (default for Claude Desktop)', true)
669
+ .action(async () => {
670
+ await startMCPServer();
671
+ });
672
+
673
+ // ============================================
674
+ // MIGRATE COMMAND (v1.0 - Convert legacy text format to JSONL)
675
+ // ============================================
676
+ program
677
+ .command('migrate')
678
+ .description('Migrate logs to newer format (v1.0 or v1.4)')
679
+ .option('--to <version>', 'Target version: 1.0 or 1.4 (default: 1.0)', '1.0')
680
+ .option('--no-backup', 'Skip creating backup files')
681
+ .option('--dry-run', 'Preview migration without making changes')
682
+ .action(async (cmdOpts: { to?: string; backup?: boolean; dryRun?: boolean }) => {
683
+ const opts = program.opts();
684
+ await migrateCommand({
685
+ verbose: opts.verbose,
686
+ to: cmdOpts.to || '1.0',
687
+ backup: cmdOpts.backup !== false,
688
+ dryRun: cmdOpts.dryRun,
689
+ });
690
+ });
691
+
692
+ // ============================================
693
+ // INDEX COMMAND (v1.1 - Build vector index for semantic search)
694
+ // ============================================
695
+ program
696
+ .command('index')
697
+ .description('Build vector index for semantic search')
698
+ .option('--vector', 'Build vector index using embeddings')
699
+ .option('--local', 'Use local embeddings (offline, requires @xenova/transformers)')
700
+ .option('--rebuild', 'Rebuild existing index')
701
+ .action(async (cmdOpts: { vector?: boolean; local?: boolean; rebuild?: boolean }) => {
702
+ const opts = program.opts();
703
+ const { indexCommand } = await import('./commands/index-vector.js');
704
+ await indexCommand({
705
+ verbose: opts.verbose,
706
+ vector: cmdOpts.vector,
707
+ local: cmdOpts.local,
708
+ rebuild: cmdOpts.rebuild,
709
+ });
710
+ });
711
+
712
+ // ============================================
713
+ // SUGGEST-TAGS COMMAND (v1.1 - Tag Intelligence)
714
+ // ============================================
715
+ program
716
+ .command('suggest-tags <content>')
717
+ .description('Intelligently suggest tags based on content and existing tags')
718
+ .action(async (content: string) => {
719
+ const opts = program.opts();
720
+ const { suggestTagsCommand } = await import('./commands/suggest-tags.js');
721
+ await suggestTagsCommand(content, { verbose: opts.verbose });
722
+ });
723
+
724
+ // ============================================
725
+ // RESOLVE COMMAND (v1.1 - Conflict Resolution Helper)
726
+ // ============================================
727
+ program
728
+ .command('resolve')
729
+ .description('Detect and resolve Git merge conflicts in JSONL files')
730
+ .option('--file <file>', 'Resolve conflicts in specific file')
731
+ .option('--strategy <strategy>', 'Resolution strategy: ours, theirs, both, merge (default: merge)', 'merge')
732
+ .option('--interactive', 'Interactive conflict resolution (not implemented yet)')
733
+ .option('--list', 'List conflicts without resolving')
734
+ .action(async (cmdOpts: { file?: string; strategy?: string; interactive?: boolean; list?: boolean }) => {
735
+ const opts = program.opts();
736
+ const { resolveCommand } = await import('./commands/resolve.js');
737
+ await resolveCommand({
738
+ verbose: opts.verbose,
739
+ file: cmdOpts.file,
740
+ strategy: cmdOpts.strategy as 'ours' | 'theirs' | 'both' | 'merge',
741
+ interactive: cmdOpts.interactive,
742
+ list: cmdOpts.list,
743
+ });
744
+ });
745
+
746
+ // ============================================
747
+ // SEARCH COMMAND (v1.0 - Unified search across all logs)
748
+ // ============================================
749
+ program
750
+ .command('search <keyword>')
751
+ .description('Search across all logs by keyword (use --semantic for TF-IDF or --vector for embeddings)')
752
+ .option('--tag <tag>', 'Filter by tag')
753
+ .option('--since <duration>', 'Filter by time (e.g., 7d, 2w, 1m)')
754
+ .option('-l, --limit <n>', 'Maximum results to show', '50')
755
+ .option('-t, --type <type>', 'Log type: memory, learning, change, or all', 'all')
756
+ .option('--semantic', 'Use semantic search (TF-IDF + similarity) instead of keyword matching')
757
+ .option('--vector', 'Use vector search (embeddings) - requires index (memorylink index --vector)')
758
+ .option('--threshold <number>', 'Semantic similarity threshold (0-1, default 0.1 for semantic, 0.5 for vector)', parseFloat)
759
+ .option('--json', 'Output as JSON')
760
+ .action(async (keyword: string, cmdOpts: { tag?: string; since?: string; limit?: string; type?: string; semantic?: boolean; vector?: boolean; threshold?: number; json?: boolean }) => {
761
+ const opts = program.opts();
762
+ await searchCommand(keyword, {
763
+ verbose: opts.verbose,
764
+ tag: cmdOpts.tag,
765
+ since: cmdOpts.since,
766
+ limit: parseInt(cmdOpts.limit || '50', 10),
767
+ type: cmdOpts.type,
768
+ semantic: cmdOpts.semantic,
769
+ vector: cmdOpts.vector,
770
+ threshold: cmdOpts.threshold,
771
+ json: cmdOpts.json,
772
+ });
773
+ });
774
+
775
+ // ============================================
776
+ // SYNC COMMAND (Git sync for team collaboration)
777
+ // ============================================
778
+ program
779
+ .command('sync')
780
+ .description('Auto-stage, commit, and push .memorylink/ files to Git')
781
+ .option('--no-push', 'Commit without pushing to remote')
782
+ .option('--check', 'Check sync status (conflicts, behind/ahead)')
783
+ .option('-m, --message <message>', 'Custom commit message')
784
+ .option('--force', 'Force push (use with caution)')
785
+ .option('--batch', 'Enable batch commits (group multiple changes into one commit)')
786
+ .option('--batch-size <n>', 'Commit after N changes (default: 10)', parseInt)
787
+ .option('--batch-timeout <seconds>', 'Commit after N seconds (default: 300 = 5min)', parseInt)
788
+ .option('--force-commit', 'Force commit immediately (clear batch state)')
789
+ .action(async (cmdOpts: { noPush?: boolean; check?: boolean; message?: string; force?: boolean; batch?: boolean; batchSize?: number; batchTimeout?: number; forceCommit?: boolean }) => {
790
+ const opts = program.opts();
791
+ await syncCommand({
792
+ verbose: opts.verbose,
793
+ noPush: cmdOpts.noPush,
794
+ check: cmdOpts.check,
795
+ message: cmdOpts.message,
796
+ force: cmdOpts.force,
797
+ batch: cmdOpts.batch,
798
+ batchSize: cmdOpts.batchSize,
799
+ batchTimeout: cmdOpts.batchTimeout,
800
+ forceCommit: cmdOpts.forceCommit,
801
+ });
802
+ });
803
+
804
+ // ============================================
805
+ // CLEAR COMMAND
806
+ // ============================================
807
+ program
808
+ .command('clear <log>')
809
+ .description('Clear a specific log (memory, changes, learnings)')
810
+ .action(async (log: string) => {
811
+ const opts = program.opts();
812
+ switch (log.toLowerCase()) {
813
+ case 'memory':
814
+ await clearMemoryCommand({ verbose: opts.verbose });
815
+ break;
816
+ case 'changes':
817
+ await clearChangesCommand({ verbose: opts.verbose });
818
+ break;
819
+ case 'learnings':
820
+ await clearLearningsCommand({ verbose: opts.verbose });
821
+ break;
822
+ default:
823
+ console.error('\x1b[31m✗\x1b[0m Unknown log type. Use: memory, changes, or learnings');
824
+ process.exit(1);
825
+ }
826
+ });
827
+
828
+ // ============================================
829
+ // HOOKS COMMANDS
830
+ // ============================================
831
+ const hooks = program
832
+ .command('hooks')
833
+ .description('Manage Git hooks');
834
+
835
+ hooks
836
+ .command('install')
837
+ .description('Install Git pre-commit hook for protection')
838
+ .action(async () => {
839
+ const opts = program.opts();
840
+ await hooksInstallCommand({ verbose: opts.verbose });
841
+ });
842
+
843
+ hooks
844
+ .command('uninstall')
845
+ .description('Remove Git pre-commit hook')
846
+ .action(async () => {
847
+ const opts = program.opts();
848
+ await hooksUninstallCommand({ verbose: opts.verbose });
849
+ });
850
+
851
+ hooks
852
+ .command('status')
853
+ .description('Show Git hooks status')
854
+ .action(async () => {
855
+ const opts = program.opts();
856
+ await hooksStatusCommand({ verbose: opts.verbose });
857
+ });
858
+
859
+ // ============================================
860
+ // AUTO-LOG COMMANDS (Auto-logging via Git hooks)
861
+ // ============================================
862
+ const autoLog = program
863
+ .command('auto-log')
864
+ .description('Auto-logging: Automatically log changes via Git hooks');
865
+
866
+ autoLog
867
+ .command('install')
868
+ .description('Install Git post-commit hook for auto-logging')
869
+ .action(async () => {
870
+ const opts = program.opts();
871
+ await autoLogInstallCommand({ verbose: opts.verbose });
872
+ });
873
+
874
+ autoLog
875
+ .command('uninstall')
876
+ .description('Remove Git post-commit hook for auto-logging')
877
+ .action(async () => {
878
+ const opts = program.opts();
879
+ await autoLogUninstallCommand({ verbose: opts.verbose });
880
+ });
881
+
882
+ autoLog
883
+ .command('status')
884
+ .description('Show auto-logging hook status')
885
+ .action(async () => {
886
+ const opts = program.opts();
887
+ await autoLogStatusCommand({ verbose: opts.verbose });
888
+ });
889
+
890
+ autoLog
891
+ .command('commit <commit> <message> <files>')
892
+ .description('Process commit and log changes (called from hook)')
893
+ .action(async (commit: string, message: string, files: string) => {
894
+ const opts = program.opts();
895
+ await autoLogCommitCommand({
896
+ verbose: opts.verbose,
897
+ commit,
898
+ message,
899
+ files,
900
+ });
901
+ });
902
+
903
+ // ============================================
904
+ // ARCHIVE COMMAND
905
+ // ============================================
906
+ program
907
+ .command('archive')
908
+ .description('Archive or expire old entries based on TTL or date filters')
909
+ .option('--before <date>', 'Archive entries before this date (ISO or relative like "30d", "6m")')
910
+ .option('--ttl <duration>', 'Time-to-live (e.g., "90d", "1y")')
911
+ .option('--dry-run', 'Show what would be archived without actually archiving')
912
+ .option('--status <status>', 'Status to set archived entries to (DEPRECATED or DELETED)', 'DEPRECATED')
913
+ .action(async (options: any) => {
914
+ const opts = program.opts();
915
+ const { archiveCommand } = await import('./commands/archive.js');
916
+ await archiveCommand({
917
+ verbose: opts.verbose,
918
+ before: options.before,
919
+ ttl: options.ttl,
920
+ dryRun: options.dryRun,
921
+ status: options.status,
922
+ });
923
+ });
924
+
925
+ // ============================================
926
+ // CONSOLIDATE COMMAND
927
+ // ============================================
928
+ program
929
+ .command('consolidate')
930
+ .description('Merge duplicate or similar memory entries')
931
+ .option('--threshold <number>', 'Similarity threshold (0-1, default 0.8)', parseFloat)
932
+ .option('--dry-run', 'Show what would be consolidated without actually doing it')
933
+ .option('--auto-merge', 'Automatically merge without confirmation')
934
+ .action(async (options: any) => {
935
+ const opts = program.opts();
936
+ const { consolidateCommand } = await import('./commands/consolidate.js');
937
+ await consolidateCommand({
938
+ verbose: opts.verbose,
939
+ threshold: options.threshold,
940
+ dryRun: options.dryRun,
941
+ autoMerge: options.autoMerge,
942
+ });
943
+ });
944
+
945
+ // ============================================
946
+ // SYNC-RULES COMMAND (P0: Memory Usage Fix)
947
+ // ============================================
948
+ program
949
+ .command('sync-rules')
950
+ .description('Generate .memorylink/rules.md from memory.log (type=rule|preference, status=ACTIVE)')
951
+ .action(async () => {
952
+ const opts = program.opts();
953
+ await syncRulesCommand({ verbose: opts.verbose });
954
+ });
955
+
956
+ // ============================================
957
+ // AUTO-CONTEXT COMMAND (DeepSeek's Path C)
958
+ // ============================================
959
+ const autoContext = program
960
+ .command('auto-context')
961
+ .description('Enable/disable automatic context injection for AI tools');
962
+
963
+ autoContext
964
+ .command('enable')
965
+ .description('Enable auto-context mode (auto-sync rules on memory changes)')
966
+ .action(async () => {
967
+ const opts = program.opts();
968
+ const { autoContextEnableCommand } = await import('./commands/auto-context.js');
969
+ await autoContextEnableCommand({ verbose: opts.verbose });
970
+ });
971
+
972
+ autoContext
973
+ .command('disable')
974
+ .description('Disable auto-context mode')
975
+ .action(async () => {
976
+ const opts = program.opts();
977
+ const { autoContextDisableCommand } = await import('./commands/auto-context.js');
978
+ await autoContextDisableCommand({ verbose: opts.verbose });
979
+ });
980
+
981
+ autoContext
982
+ .command('status')
983
+ .description('Check auto-context mode status')
984
+ .action(async () => {
985
+ const opts = program.opts();
986
+ const { autoContextStatusCommand } = await import('./commands/auto-context.js');
987
+ await autoContextStatusCommand({ verbose: opts.verbose });
988
+ });
989
+
990
+ // ============================================
991
+ // GRAPH COMMAND (v1.2 - Code Structure Memory)
992
+ // ============================================
993
+ const graphCommand = program
994
+ .command('graph')
995
+ .description('Code structure memory commands');
996
+
997
+ graphCommand
998
+ .command('build')
999
+ .description('Build code dependency graph')
1000
+ .option('--rebuild', 'Force rebuild even if graph exists')
1001
+ .option('--silent', 'Suppress output')
1002
+ .action(async (cmdOpts: { rebuild?: boolean; silent?: boolean }) => {
1003
+ const opts = program.opts();
1004
+ const { graphBuildCommand } = await import('./commands/graph.js');
1005
+ await graphBuildCommand({
1006
+ verbose: opts.verbose,
1007
+ rebuild: cmdOpts.rebuild,
1008
+ silent: cmdOpts.silent,
1009
+ });
1010
+ });
1011
+
1012
+ program
1013
+ .command('graph-query <file>')
1014
+ .description('Query file dependencies and structure')
1015
+ .option('--visual', 'Show visual tree output')
1016
+ .action(async (file: string, cmdOpts: { visual?: boolean }) => {
1017
+ const opts = program.opts();
1018
+ const { graphQueryCommand } = await import('./commands/graph.js');
1019
+ await graphQueryCommand(file, { verbose: opts.verbose, visual: cmdOpts.visual });
1020
+ });
1021
+
1022
+ // ============================================
1023
+ // IMPACT COMMAND (v1.2 - Change Impact Analysis)
1024
+ // ============================================
1025
+ program
1026
+ .command('impact <file>')
1027
+ .description('Analyze change impact for a file')
1028
+ .option('--change <description>', 'Description of proposed change')
1029
+ .option('--rebuild', 'Rebuild graph before analysis')
1030
+ .action(async (file: string, cmdOpts: { change?: string; rebuild?: boolean }) => {
1031
+ const opts = program.opts();
1032
+ const { impactCommand } = await import('./commands/impact.js');
1033
+ await impactCommand(file, {
1034
+ verbose: opts.verbose,
1035
+ change: cmdOpts.change,
1036
+ rebuild: cmdOpts.rebuild,
1037
+ });
1038
+ });
1039
+
1040
+ // ============================================
1041
+ // PATTERNS COMMAND (v1.3 - Team Pattern Detection)
1042
+ // ============================================
1043
+ const patternsCommand = program
1044
+ .command('patterns')
1045
+ .description('Team pattern detection commands');
1046
+
1047
+ patternsCommand
1048
+ .command('detect')
1049
+ .description('Detect team coding patterns from learnings')
1050
+ .action(async () => {
1051
+ const opts = program.opts();
1052
+ const { patternsDetectCommand } = await import('./commands/patterns.js');
1053
+ await patternsDetectCommand({ verbose: opts.verbose });
1054
+ });
1055
+
1056
+ program
1057
+ .command('patterns-suggest <context>')
1058
+ .description('Suggest team patterns for a given context')
1059
+ .action(async (context: string) => {
1060
+ const opts = program.opts();
1061
+ const { patternsSuggestCommand } = await import('./commands/patterns.js');
1062
+ await patternsSuggestCommand(context, { verbose: opts.verbose });
1063
+ });
1064
+
1065
+ // ============================================
1066
+ // CHECKPOINT COMMANDS (v1.5)
1067
+ // ============================================
1068
+ program
1069
+ .command('checkpoint')
1070
+ .description('Create, list, compare, or restore memory checkpoints (v1.5)')
1071
+ .argument('[action]', 'Action: create, list, diff, or restore (default: list)', 'list')
1072
+ .argument('[checkpoint1]', 'First checkpoint for diff, or checkpoint name for restore')
1073
+ .argument('[checkpoint2]', 'Second checkpoint for diff')
1074
+ .option('--name <name>', 'Checkpoint name (for create)')
1075
+ .option('--message <message>', 'Checkpoint message (for create)')
1076
+ .action(async (action: string, checkpoint1?: string, checkpoint2?: string, cmdOpts?: { name?: string; message?: string }) => {
1077
+ const opts = program.opts();
1078
+ const { error } = await import('./utils.js');
1079
+ if (action === 'create') {
1080
+ await checkpointCreateCommand({
1081
+ verbose: opts.verbose,
1082
+ name: cmdOpts?.name,
1083
+ message: cmdOpts?.message,
1084
+ });
1085
+ } else if (action === 'list') {
1086
+ await checkpointListCommand({ verbose: opts.verbose });
1087
+ } else if (action === 'diff') {
1088
+ if (!checkpoint1 || !checkpoint2) {
1089
+ error('Both checkpoint names required for diff');
1090
+ process.exit(1);
1091
+ }
1092
+ await checkpointDiffCommand(checkpoint1, checkpoint2, { verbose: opts.verbose });
1093
+ } else if (action === 'restore') {
1094
+ if (!checkpoint1) {
1095
+ error('Checkpoint name required for restore');
1096
+ process.exit(1);
1097
+ }
1098
+ await checkpointRestoreCommand(checkpoint1, { verbose: opts.verbose });
1099
+ } else {
1100
+ error(`Unknown action: ${action}. Use: create, list, diff, or restore`);
1101
+ process.exit(1);
1102
+ }
1103
+ });
1104
+
1105
+ // ============================================
1106
+ // LOCK COMMANDS (v1.5)
1107
+ // ============================================
1108
+ program
1109
+ .command('lock')
1110
+ .description('Agent locking commands (v1.5)')
1111
+ .argument('[action]', 'Action: acquire, release, renew, or status (default: status)', 'status')
1112
+ .option('--agent <id>', 'Agent ID (for acquire)')
1113
+ .option('--files <files>', 'Comma-separated list of files (for acquire)')
1114
+ .option('--timeout <minutes>', 'Lock timeout in minutes (default: 30)', '30')
1115
+ .action(async (action: string, cmdOpts?: { agent?: string; files?: string; timeout?: string }) => {
1116
+ const opts = program.opts();
1117
+ const { error } = await import('./utils.js');
1118
+ const timeout = cmdOpts?.timeout ? parseInt(cmdOpts.timeout, 10) : undefined;
1119
+ if (action === 'acquire') {
1120
+ await lockAcquireCommand({
1121
+ verbose: opts.verbose,
1122
+ agent: cmdOpts?.agent,
1123
+ files: cmdOpts?.files,
1124
+ timeout,
1125
+ });
1126
+ } else if (action === 'release') {
1127
+ await lockReleaseCommand({ verbose: opts.verbose });
1128
+ } else if (action === 'renew') {
1129
+ await lockRenewCommand({
1130
+ verbose: opts.verbose,
1131
+ timeout,
1132
+ });
1133
+ } else if (action === 'status') {
1134
+ await lockStatusCommand({ verbose: opts.verbose });
1135
+ } else {
1136
+ error(`Unknown action: ${action}. Use: acquire, release, renew, or status`);
1137
+ process.exit(1);
1138
+ }
1139
+ });
1140
+
1141
+ // ============================================
1142
+ // SCOPES COMMAND (v1.5 Phase 2 Enhancement)
1143
+ // ============================================
1144
+ program
1145
+ .command('scopes')
1146
+ .description('List and manage project scopes (v1.5 Phase 2)')
1147
+ .argument('[action]', 'Action: list (default: list)', 'list')
1148
+ .action(async (action: string) => {
1149
+ const opts = program.opts();
1150
+ if (action === 'list') {
1151
+ await scopesListCommand({ verbose: opts.verbose });
1152
+ } else {
1153
+ const { error } = await import('./utils.js');
1154
+ error(`Unknown action: ${action}. Use: list`);
1155
+ process.exit(1);
1156
+ }
1157
+ });
1158
+
1159
+ // ============================================
1160
+ // STATS COMMAND (v1.5 Phase 2)
1161
+ // ============================================
1162
+ program
1163
+ .command('stats')
1164
+ .description('Enhanced observability: statistics and analytics (v1.5 Phase 2)')
1165
+ .option('--since <duration>', 'Filter by time: 7d, 2w, 1m')
1166
+ .option('--format <format>', 'Output format: default, json, csv, markdown', 'default')
1167
+ .option('--no-recommendations', 'Skip recommendations in output (v1.5.1)')
1168
+ .action(async (cmdOpts?: { since?: string; format?: string; noRecommendations?: boolean }) => {
1169
+ const opts = program.opts();
1170
+ await statsCommand({
1171
+ verbose: opts.verbose,
1172
+ since: cmdOpts?.since,
1173
+ format: cmdOpts?.format as any,
1174
+ noRecommendations: cmdOpts?.noRecommendations || false,
1175
+ });
1176
+ });
1177
+
1178
+ // ============================================
1179
+ // TELEMETRY TEST COMMAND (v1.6 - Internal/Debug Only)
1180
+ // ============================================
1181
+ program
1182
+ .command('telemetry-test')
1183
+ .description('INTERNAL: Trigger a test telemetry event (v1.6+)')
1184
+ .option('--outcome <outcome>', 'Outcome: success or error', 'success')
1185
+ .option('--error-kind <kind>', 'Error kind if outcome is error', 'TEST_ERROR')
1186
+ .action(async (cmdOpts: { outcome: 'success' | 'error'; errorKind: string }) => {
1187
+ const opts = program.opts();
1188
+ await telemetryTestCommand({ verbose: opts.verbose });
1189
+ });
1190
+
1191
+ // Hide the telemetry-test command from the main help output
1192
+ // This is a workaround as Commander.js doesn't have a direct 'hidden' option for commands
1193
+ const telemetryTestCommandObj = program.commands.find(cmd => cmd.name() === 'telemetry-test');
1194
+ if (telemetryTestCommandObj) {
1195
+ telemetryTestCommandObj.helpOption(false); // Hide help option for this command
1196
+ // Further hiding might involve custom help output or not adding it to program.commands directly
1197
+ // For now, this makes it less discoverable.
1198
+ }
1199
+
1200
+ // ============================================
1201
+ // HELP COMMAND (enhanced)
1202
+ // ============================================
1203
+ program
1204
+ .command('help')
1205
+ .description('Show help with examples')
1206
+ .action(() => {
1207
+ console.log(LOGO);
1208
+ console.log('\x1b[1mQuick Start:\x1b[0m');
1209
+ console.log(' memorylink init # Initialize in project');
1210
+ console.log(' memorylink protect src/config.ts # Protect a file');
1211
+ console.log(' memorylink memory "Uses React 18" # Add context');
1212
+ console.log(' memorylink watch # Start watcher');
1213
+ console.log('');
1214
+ console.log('\x1b[1mCore Commands:\x1b[0m');
1215
+ console.log(' init Initialize .memorylink/ directory');
1216
+ console.log(' protect <file> Add file to protected list');
1217
+ console.log(' unprotect <file> Remove file from protected list');
1218
+ console.log(' protected List protected files');
1219
+ console.log(' memory <message> Add to shared memory');
1220
+ console.log(' memories List memory entries');
1221
+ console.log(' change <file> <why> Log a file change');
1222
+ console.log(' changes List change audit trail');
1223
+ console.log(' learn <prob> <sol> Track solution (--status SUCCESS|FAILED)');
1224
+ console.log(' learnings List learnings');
1225
+ console.log(' watch Start real-time watcher');
1226
+ console.log(' status Show current state');
1227
+ console.log(' doctor Health check');
1228
+ console.log(' get-context [tag] Get filtered context for AI');
1229
+ console.log(' search <keyword> Search across all logs');
1230
+ console.log(' export [file] Export all data');
1231
+ console.log(' clear <log> Clear a log file');
1232
+ console.log(' hooks install Install Git protection hook');
1233
+ console.log(' migrate Convert legacy logs to JSONL (v1.0)');
1234
+ console.log('');
1235
+ console.log('\x1b[1mExamples:\x1b[0m');
1236
+ console.log(' memorylink memory "Auth uses JWT tokens" --tags auth,security');
1237
+ console.log(' memorylink learn "API timeout" "Increased to 30s" --status SUCCESS');
1238
+ console.log(' memorylink get-context auth');
1239
+ console.log(' memorylink change src/api.ts "Fixed auth bug" --agent cursor');
1240
+ console.log('');
1241
+ console.log('\x1b[1mFor AI Assistants:\x1b[0m');
1242
+ console.log(' Read .memorylink/protected.txt before editing any file');
1243
+ console.log(' Read .memorylink/memory.log for project context');
1244
+ console.log(' Check .memorylink/learnings.log for past solutions');
1245
+ console.log(' Log your changes to .memorylink/changes.log');
1246
+ console.log('');
1247
+ console.log('\x1b[36mDocs: https://github.com/memorylink/memorylink\x1b[0m');
1248
+ console.log('');
1249
+ });
1250
+
1251
+ // Default action (no command)
1252
+ program.action(() => {
1253
+ console.log(LOGO);
1254
+ program.help();
1255
+ });
1256
+
1257
+ // Parse and run
1258
+ program.parse(process.argv);
1259
+