sqlew 5.0.7 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +100 -242
  3. package/dist/adapters/auth/auth-factory.d.ts +2 -81
  4. package/dist/adapters/auth/auth-factory.d.ts.map +1 -1
  5. package/dist/adapters/auth/auth-factory.js +2 -82
  6. package/dist/adapters/auth/auth-factory.js.map +1 -1
  7. package/dist/adapters/auth/base-auth-provider.d.ts +18 -303
  8. package/dist/adapters/auth/base-auth-provider.d.ts.map +1 -1
  9. package/dist/adapters/auth/base-auth-provider.js +2 -104
  10. package/dist/adapters/auth/base-auth-provider.js.map +1 -1
  11. package/dist/adapters/auth/direct-auth-provider.d.ts +4 -348
  12. package/dist/adapters/auth/direct-auth-provider.d.ts.map +1 -1
  13. package/dist/adapters/auth/direct-auth-provider.js +6 -356
  14. package/dist/adapters/auth/direct-auth-provider.js.map +1 -1
  15. package/dist/adapters/base-adapter.d.ts +31 -598
  16. package/dist/adapters/base-adapter.d.ts.map +1 -1
  17. package/dist/adapters/base-adapter.js +10 -458
  18. package/dist/adapters/base-adapter.js.map +1 -1
  19. package/dist/adapters/index.d.ts +1 -11
  20. package/dist/adapters/index.d.ts.map +1 -1
  21. package/dist/adapters/index.js +1 -11
  22. package/dist/adapters/index.js.map +1 -1
  23. package/dist/adapters/mysql-adapter.d.ts +15 -541
  24. package/dist/adapters/mysql-adapter.d.ts.map +1 -1
  25. package/dist/adapters/mysql-adapter.js +24 -561
  26. package/dist/adapters/mysql-adapter.js.map +1 -1
  27. package/dist/adapters/postgresql-adapter.d.ts +15 -203
  28. package/dist/adapters/postgresql-adapter.d.ts.map +1 -1
  29. package/dist/adapters/postgresql-adapter.js +24 -223
  30. package/dist/adapters/postgresql-adapter.js.map +1 -1
  31. package/dist/adapters/sqlite-adapter.d.ts +4 -28
  32. package/dist/adapters/sqlite-adapter.d.ts.map +1 -1
  33. package/dist/adapters/sqlite-adapter.js +4 -32
  34. package/dist/adapters/sqlite-adapter.js.map +1 -1
  35. package/dist/adapters/types.d.ts +1 -4
  36. package/dist/adapters/types.d.ts.map +1 -1
  37. package/dist/backend/backend-factory.d.ts +3 -3
  38. package/dist/backend/backend-factory.js +3 -3
  39. package/dist/backend/local-backend.d.ts.map +1 -1
  40. package/dist/backend/local-backend.js +0 -5
  41. package/dist/backend/local-backend.js.map +1 -1
  42. package/dist/cli/db-export.d.ts.map +1 -1
  43. package/dist/cli/db-export.js +54 -32
  44. package/dist/cli/db-export.js.map +1 -1
  45. package/dist/cli/db-import.d.ts.map +1 -1
  46. package/dist/cli/db-import.js +32 -31
  47. package/dist/cli/db-import.js.map +1 -1
  48. package/dist/cli/hooks/pr-adr.d.ts +22 -0
  49. package/dist/cli/hooks/pr-adr.d.ts.map +1 -0
  50. package/dist/cli/hooks/pr-adr.js +72 -0
  51. package/dist/cli/hooks/pr-adr.js.map +1 -0
  52. package/dist/cli.d.ts.map +1 -1
  53. package/dist/cli.js +9 -13
  54. package/dist/cli.js.map +1 -1
  55. package/dist/config/cloud-config-loader.d.ts +8 -8
  56. package/dist/config/cloud-config-loader.d.ts.map +1 -1
  57. package/dist/config/cloud-config-loader.js +12 -12
  58. package/dist/config/cloud-config-loader.js.map +1 -1
  59. package/dist/config/global-config.d.ts +17 -45
  60. package/dist/config/global-config.d.ts.map +1 -1
  61. package/dist/config/global-config.js +169 -30
  62. package/dist/config/global-config.js.map +1 -1
  63. package/dist/config/loader.d.ts +1 -18
  64. package/dist/config/loader.d.ts.map +1 -1
  65. package/dist/config/loader.js +1 -89
  66. package/dist/config/loader.js.map +1 -1
  67. package/dist/config/types.d.ts +2 -64
  68. package/dist/config/types.d.ts.map +1 -1
  69. package/dist/config/types.js +0 -18
  70. package/dist/config/types.js.map +1 -1
  71. package/dist/database/index.d.ts +1 -2
  72. package/dist/database/index.d.ts.map +1 -1
  73. package/dist/database/index.js +1 -3
  74. package/dist/database/index.js.map +1 -1
  75. package/dist/database/operations/queries.d.ts +0 -4
  76. package/dist/database/operations/queries.d.ts.map +1 -1
  77. package/dist/database/operations/queries.js +0 -8
  78. package/dist/database/operations/queries.js.map +1 -1
  79. package/dist/index.d.ts +1 -1
  80. package/dist/index.js +4 -4
  81. package/dist/index.js.map +1 -1
  82. package/dist/init-rules.d.ts.map +1 -1
  83. package/dist/init-rules.js +0 -1
  84. package/dist/init-rules.js.map +1 -1
  85. package/dist/knexfile.d.ts.map +1 -1
  86. package/dist/knexfile.js +2 -1
  87. package/dist/knexfile.js.map +1 -1
  88. package/dist/migration/local-to-global.d.ts +19 -0
  89. package/dist/migration/local-to-global.d.ts.map +1 -0
  90. package/dist/migration/local-to-global.js +133 -0
  91. package/dist/migration/local-to-global.js.map +1 -0
  92. package/dist/saas-connector/client/types.d.ts +1 -1
  93. package/dist/saas-connector/client/types.d.ts.map +1 -1
  94. package/dist/schema.js +1 -1
  95. package/dist/server/setup.d.ts.map +1 -1
  96. package/dist/server/setup.js +15 -7
  97. package/dist/server/setup.js.map +1 -1
  98. package/dist/tests/backend/backend-factory.test.js +2 -2
  99. package/dist/tests/backend/backend-factory.test.js.map +1 -1
  100. package/dist/tests/docker/native/constraint-operations.test.d.ts +2 -17
  101. package/dist/tests/docker/native/constraint-operations.test.d.ts.map +1 -1
  102. package/dist/tests/docker/native/constraint-operations.test.js +3 -82
  103. package/dist/tests/docker/native/constraint-operations.test.js.map +1 -1
  104. package/dist/tests/docker/native/db-init.d.ts +3 -34
  105. package/dist/tests/docker/native/db-init.d.ts.map +1 -1
  106. package/dist/tests/docker/native/db-init.js +15 -77
  107. package/dist/tests/docker/native/db-init.js.map +1 -1
  108. package/dist/tests/docker/native/decision-operations.test.d.ts +2 -10
  109. package/dist/tests/docker/native/decision-operations.test.d.ts.map +1 -1
  110. package/dist/tests/docker/native/decision-operations.test.js +2 -84
  111. package/dist/tests/docker/native/decision-operations.test.js.map +1 -1
  112. package/dist/tests/docker/native/help-system.test.d.ts +2 -5
  113. package/dist/tests/docker/native/help-system.test.d.ts.map +1 -1
  114. package/dist/tests/docker/native/help-system.test.js +2 -47
  115. package/dist/tests/docker/native/help-system.test.js.map +1 -1
  116. package/dist/tests/docker/native/suggest-tool.test.d.ts +3 -11
  117. package/dist/tests/docker/native/suggest-tool.test.d.ts.map +1 -1
  118. package/dist/tests/docker/native/suggest-tool.test.js +3 -60
  119. package/dist/tests/docker/native/suggest-tool.test.js.map +1 -1
  120. package/dist/tests/docker/native/test-harness.d.ts +2 -23
  121. package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
  122. package/dist/tests/docker/native/test-harness.js +5 -59
  123. package/dist/tests/docker/native/test-harness.js.map +1 -1
  124. package/dist/tests/feature/decision/analytics.test.js +2 -1
  125. package/dist/tests/feature/decision/analytics.test.js.map +1 -1
  126. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js +2 -7
  127. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js.map +1 -1
  128. package/dist/tests/feature/decision/batch-validation.test.js +2 -1
  129. package/dist/tests/feature/decision/batch-validation.test.js.map +1 -1
  130. package/dist/tests/integration/auto-trigger-suggestions.test.js +4 -37
  131. package/dist/tests/integration/auto-trigger-suggestions.test.js.map +1 -1
  132. package/dist/tests/integration/hybrid-similarity-detection.test.js +2 -1
  133. package/dist/tests/integration/hybrid-similarity-detection.test.js.map +1 -1
  134. package/dist/tests/integration/json-export-import.test.d.ts.map +1 -0
  135. package/dist/tests/integration/json-export-import.test.js.map +1 -0
  136. package/dist/tests/unit/case-insensitive-validator.test.d.ts +0 -7
  137. package/dist/tests/unit/case-insensitive-validator.test.d.ts.map +1 -1
  138. package/dist/tests/unit/case-insensitive-validator.test.js +0 -22
  139. package/dist/tests/unit/case-insensitive-validator.test.js.map +1 -1
  140. package/dist/tests/unit/config/cloud-config-loader.test.js +4 -2
  141. package/dist/tests/unit/config/cloud-config-loader.test.js.map +1 -1
  142. package/dist/tests/unit/config/global-db-migration.test.d.ts +12 -0
  143. package/dist/tests/unit/config/global-db-migration.test.d.ts.map +1 -0
  144. package/dist/tests/unit/config/global-db-migration.test.js +117 -0
  145. package/dist/tests/unit/config/global-db-migration.test.js.map +1 -0
  146. package/dist/tests/unit/constraint-scorer.test.d.ts +2 -7
  147. package/dist/tests/unit/constraint-scorer.test.d.ts.map +1 -1
  148. package/dist/tests/unit/constraint-scorer.test.js +2 -28
  149. package/dist/tests/unit/constraint-scorer.test.js.map +1 -1
  150. package/dist/tests/unit/universal-knex.test.js +9 -0
  151. package/dist/tests/unit/universal-knex.test.js.map +1 -1
  152. package/dist/tests/unit/validation/parameter-validation.test.js +0 -24
  153. package/dist/tests/unit/validation/parameter-validation.test.js.map +1 -1
  154. package/dist/tests/utils/db-config.d.ts.map +1 -1
  155. package/dist/tests/utils/db-config.js +0 -9
  156. package/dist/tests/utils/db-config.js.map +1 -1
  157. package/dist/tests/utils/db-import.d.ts.map +1 -1
  158. package/dist/tests/utils/db-import.js +0 -3
  159. package/dist/tests/utils/db-import.js.map +1 -1
  160. package/dist/tests/utils/db-schema.d.ts.map +1 -1
  161. package/dist/tests/utils/db-schema.js +48 -51
  162. package/dist/tests/utils/db-schema.js.map +1 -1
  163. package/dist/tests/utils/db-seeding.d.ts.map +1 -1
  164. package/dist/tests/utils/db-seeding.js +0 -3
  165. package/dist/tests/utils/db-seeding.js.map +1 -1
  166. package/dist/tests/utils/index.d.ts +0 -1
  167. package/dist/tests/utils/index.d.ts.map +1 -1
  168. package/dist/tests/utils/index.js +0 -2
  169. package/dist/tests/utils/index.js.map +1 -1
  170. package/dist/tests/utils/test-helpers.d.ts +6 -76
  171. package/dist/tests/utils/test-helpers.d.ts.map +1 -1
  172. package/dist/tests/utils/test-helpers.js +56 -162
  173. package/dist/tests/utils/test-helpers.js.map +1 -1
  174. package/dist/tests/utils/test-lifecycle.d.ts +2 -28
  175. package/dist/tests/utils/test-lifecycle.d.ts.map +1 -1
  176. package/dist/tests/utils/test-lifecycle.js +2 -31
  177. package/dist/tests/utils/test-lifecycle.js.map +1 -1
  178. package/dist/tools/context/index.d.ts +0 -1
  179. package/dist/tools/context/index.d.ts.map +1 -1
  180. package/dist/tools/context/index.js +0 -2
  181. package/dist/tools/context/index.js.map +1 -1
  182. package/dist/tools/context/types.d.ts +1 -1
  183. package/dist/tools/context/types.d.ts.map +1 -1
  184. package/dist/types/actions.d.ts +6 -29
  185. package/dist/types/actions.d.ts.map +1 -1
  186. package/dist/types/actions.js +1 -2
  187. package/dist/types/actions.js.map +1 -1
  188. package/dist/types/constraint/params.d.ts +24 -1
  189. package/dist/types/constraint/params.d.ts.map +1 -1
  190. package/dist/types/constraint/params.js +3 -0
  191. package/dist/types/constraint/params.js.map +1 -1
  192. package/dist/types/constraint/responses.d.ts +18 -1
  193. package/dist/types/constraint/responses.d.ts.map +1 -1
  194. package/dist/types/constraint/responses.js +3 -0
  195. package/dist/types/constraint/responses.js.map +1 -1
  196. package/dist/types/decision/batch.d.ts +2 -5
  197. package/dist/types/decision/batch.d.ts.map +1 -1
  198. package/dist/types/decision/batch.js +3 -3
  199. package/dist/types/decision/batch.js.map +1 -1
  200. package/dist/types/decision/params.d.ts +7 -4
  201. package/dist/types/decision/params.d.ts.map +1 -1
  202. package/dist/types/decision/responses.d.ts +49 -35
  203. package/dist/types/decision/responses.d.ts.map +1 -1
  204. package/dist/types/decision/templates.d.ts +2 -18
  205. package/dist/types/decision/templates.d.ts.map +1 -1
  206. package/dist/types/decision/templates.js +3 -3
  207. package/dist/types/decision/templates.js.map +1 -1
  208. package/dist/types/enums.d.ts +11 -13
  209. package/dist/types/enums.d.ts.map +1 -1
  210. package/dist/types/enums.js +5 -13
  211. package/dist/types/enums.js.map +1 -1
  212. package/dist/types/import-export.d.ts +7 -30
  213. package/dist/types/import-export.d.ts.map +1 -1
  214. package/dist/types/import-export.js +1 -2
  215. package/dist/types/import-export.js.map +1 -1
  216. package/dist/types/index.d.ts +18 -22
  217. package/dist/types/index.d.ts.map +1 -1
  218. package/dist/types/index.js +4 -32
  219. package/dist/types/index.js.map +1 -1
  220. package/dist/types/master-entities.d.ts +1 -10
  221. package/dist/types/master-entities.d.ts.map +1 -1
  222. package/dist/types/master-entities.js +1 -2
  223. package/dist/types/master-entities.js.map +1 -1
  224. package/dist/types/transaction-entities.d.ts +2 -21
  225. package/dist/types/transaction-entities.d.ts.map +1 -1
  226. package/dist/types/transaction-entities.js +1 -1
  227. package/dist/types/validation.d.ts +1 -16
  228. package/dist/types/validation.d.ts.map +1 -1
  229. package/dist/types/validation.js +1 -2
  230. package/dist/types/validation.js.map +1 -1
  231. package/dist/types/view-entities.d.ts +3 -12
  232. package/dist/types/view-entities.d.ts.map +1 -1
  233. package/dist/types/view-entities.js +1 -1
  234. package/dist/types.d.ts +4 -718
  235. package/dist/types.d.ts.map +1 -1
  236. package/dist/types.js +5 -39
  237. package/dist/types.js.map +1 -1
  238. package/dist/utils/parameter-validator.d.ts +2 -2
  239. package/dist/utils/parameter-validator.d.ts.map +1 -1
  240. package/dist/utils/parameter-validator.js.map +1 -1
  241. package/docs/ADR_CONCEPTS.md +66 -58
  242. package/docs/CLI_USAGE.md +392 -0
  243. package/docs/CONFIGURATION.md +157 -922
  244. package/docs/CROSS_DATABASE.md +1 -88
  245. package/docs/DATABASE_AUTH.md +24 -47
  246. package/docs/HOOKS_GUIDE.md +40 -112
  247. package/docs/MIGRATION_TO_SAAS.md +3 -3
  248. package/docs/SHARED_DATABASE.md +108 -0
  249. package/package.json +4 -3
  250. package/dist/adapters/auth/auth-types.d.ts +0 -30
  251. package/dist/adapters/auth/auth-types.d.ts.map +0 -1
  252. package/dist/adapters/auth/auth-types.js +0 -30
  253. package/dist/adapters/auth/auth-types.js.map +0 -1
  254. package/dist/cli/db-dump.d.ts +0 -36
  255. package/dist/cli/db-dump.d.ts.map +0 -1
  256. package/dist/cli/db-dump.js +0 -384
  257. package/dist/cli/db-dump.js.map +0 -1
  258. package/dist/database/config/config-ops.d.ts +0 -42
  259. package/dist/database/config/config-ops.d.ts.map +0 -1
  260. package/dist/database/config/config-ops.js +0 -102
  261. package/dist/database/config/config-ops.js.map +0 -1
  262. package/dist/formatters/adr-formatter.d.ts +0 -22
  263. package/dist/formatters/adr-formatter.d.ts.map +0 -1
  264. package/dist/formatters/adr-formatter.js +0 -127
  265. package/dist/formatters/adr-formatter.js.map +0 -1
  266. package/dist/formatters/confluence-formatter.d.ts +0 -26
  267. package/dist/formatters/confluence-formatter.d.ts.map +0 -1
  268. package/dist/formatters/confluence-formatter.js +0 -129
  269. package/dist/formatters/confluence-formatter.js.map +0 -1
  270. package/dist/formatters/index.d.ts +0 -34
  271. package/dist/formatters/index.d.ts.map +0 -1
  272. package/dist/formatters/index.js +0 -57
  273. package/dist/formatters/index.js.map +0 -1
  274. package/dist/formatters/markdown-formatter.d.ts +0 -16
  275. package/dist/formatters/markdown-formatter.d.ts.map +0 -1
  276. package/dist/formatters/markdown-formatter.js +0 -110
  277. package/dist/formatters/markdown-formatter.js.map +0 -1
  278. package/dist/formatters/notion-formatter.d.ts +0 -29
  279. package/dist/formatters/notion-formatter.d.ts.map +0 -1
  280. package/dist/formatters/notion-formatter.js +0 -177
  281. package/dist/formatters/notion-formatter.js.map +0 -1
  282. package/dist/formatters/types.d.ts +0 -31
  283. package/dist/formatters/types.d.ts.map +0 -1
  284. package/dist/formatters/types.js +0 -6
  285. package/dist/formatters/types.js.map +0 -1
  286. package/dist/tests/database/sql-dump/converters.test.d.ts +0 -7
  287. package/dist/tests/database/sql-dump/converters.test.d.ts.map +0 -1
  288. package/dist/tests/database/sql-dump/converters.test.js +0 -314
  289. package/dist/tests/database/sql-dump/converters.test.js.map +0 -1
  290. package/dist/tests/database/sql-dump/default-conversions.test.d.ts +0 -8
  291. package/dist/tests/database/sql-dump/default-conversions.test.d.ts.map +0 -1
  292. package/dist/tests/database/sql-dump/default-conversions.test.js +0 -141
  293. package/dist/tests/database/sql-dump/default-conversions.test.js.map +0 -1
  294. package/dist/tests/database/sql-dump/table-ordering.test.d.ts +0 -27
  295. package/dist/tests/database/sql-dump/table-ordering.test.d.ts.map +0 -1
  296. package/dist/tests/database/sql-dump/table-ordering.test.js +0 -284
  297. package/dist/tests/database/sql-dump/table-ordering.test.js.map +0 -1
  298. package/dist/tests/database/sql-dump/type-conversion.test.d.ts +0 -8
  299. package/dist/tests/database/sql-dump/type-conversion.test.d.ts.map +0 -1
  300. package/dist/tests/database/sql-dump/type-conversion.test.js +0 -361
  301. package/dist/tests/database/sql-dump/type-conversion.test.js.map +0 -1
  302. package/dist/tests/docker/cross-database.test.d.ts +0 -21
  303. package/dist/tests/docker/cross-database.test.d.ts.map +0 -1
  304. package/dist/tests/docker/cross-database.test.js +0 -308
  305. package/dist/tests/docker/cross-database.test.js.map +0 -1
  306. package/dist/tests/docker/dump-import.test.d.ts +0 -15
  307. package/dist/tests/docker/dump-import.test.d.ts.map +0 -1
  308. package/dist/tests/docker/dump-import.test.js +0 -424
  309. package/dist/tests/docker/dump-import.test.js.map +0 -1
  310. package/dist/tests/docker/fk-constraints.test.d.ts +0 -13
  311. package/dist/tests/docker/fk-constraints.test.d.ts.map +0 -1
  312. package/dist/tests/docker/fk-constraints.test.js +0 -381
  313. package/dist/tests/docker/fk-constraints.test.js.map +0 -1
  314. package/dist/tests/docker/indexes.test.d.ts +0 -12
  315. package/dist/tests/docker/indexes.test.d.ts.map +0 -1
  316. package/dist/tests/docker/indexes.test.js +0 -250
  317. package/dist/tests/docker/indexes.test.js.map +0 -1
  318. package/dist/tests/docker/integration.test.d.ts +0 -16
  319. package/dist/tests/docker/integration.test.d.ts.map +0 -1
  320. package/dist/tests/docker/integration.test.js +0 -323
  321. package/dist/tests/docker/integration.test.js.map +0 -1
  322. package/dist/tests/docker/multi-project-migration.test.d.ts +0 -17
  323. package/dist/tests/docker/multi-project-migration.test.d.ts.map +0 -1
  324. package/dist/tests/docker/multi-project-migration.test.js +0 -394
  325. package/dist/tests/docker/multi-project-migration.test.js.map +0 -1
  326. package/dist/tests/docker/schema-migration.test.d.ts +0 -8
  327. package/dist/tests/docker/schema-migration.test.d.ts.map +0 -1
  328. package/dist/tests/docker/schema-migration.test.js +0 -98
  329. package/dist/tests/docker/schema-migration.test.js.map +0 -1
  330. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts +0 -5
  331. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts.map +0 -1
  332. package/dist/tests/integration/e2e-workflow1-debug.test.js +0 -85
  333. package/dist/tests/integration/e2e-workflow1-debug.test.js.map +0 -1
  334. package/dist/tests/integration/suggest-simple.test.d.ts +0 -5
  335. package/dist/tests/integration/suggest-simple.test.d.ts.map +0 -1
  336. package/dist/tests/integration/suggest-simple.test.js +0 -90
  337. package/dist/tests/integration/suggest-simple.test.js.map +0 -1
  338. package/dist/tests/migrations/test-all-versions-real.d.ts +0 -8
  339. package/dist/tests/migrations/test-all-versions-real.d.ts.map +0 -1
  340. package/dist/tests/migrations/test-all-versions-real.js +0 -236
  341. package/dist/tests/migrations/test-all-versions-real.js.map +0 -1
  342. package/dist/tests/migrations/test-all-versions.d.ts +0 -14
  343. package/dist/tests/migrations/test-all-versions.d.ts.map +0 -1
  344. package/dist/tests/migrations/test-all-versions.js +0 -519
  345. package/dist/tests/migrations/test-all-versions.js.map +0 -1
  346. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts +0 -7
  347. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts.map +0 -1
  348. package/dist/tests/migrations/v4/v4-fresh-install.test.js +0 -168
  349. package/dist/tests/migrations/v4/v4-fresh-install.test.js.map +0 -1
  350. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts +0 -13
  351. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts.map +0 -1
  352. package/dist/tests/migrations/v4/v4-migrate-data.test.js +0 -264
  353. package/dist/tests/migrations/v4/v4-migrate-data.test.js.map +0 -1
  354. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts +0 -2
  355. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts.map +0 -1
  356. package/dist/tests/unit/utils/case-insensitive-validator.test.js +0 -97
  357. package/dist/tests/unit/utils/case-insensitive-validator.test.js.map +0 -1
  358. package/dist/tests/utils/json-export-import.test.d.ts.map +0 -1
  359. package/dist/tests/utils/json-export-import.test.js.map +0 -1
  360. package/dist/tests/utils/task-helpers.d.ts +0 -67
  361. package/dist/tests/utils/task-helpers.d.ts.map +0 -1
  362. package/dist/tests/utils/task-helpers.js +0 -134
  363. package/dist/tests/utils/task-helpers.js.map +0 -1
  364. package/dist/tools/context/actions/export.d.ts +0 -35
  365. package/dist/tools/context/actions/export.d.ts.map +0 -1
  366. package/dist/tools/context/actions/export.js +0 -93
  367. package/dist/tools/context/actions/export.js.map +0 -1
  368. package/dist/types/file/params.d.ts +0 -40
  369. package/dist/types/file/params.d.ts.map +0 -1
  370. package/dist/types/file/params.js +0 -6
  371. package/dist/types/file/params.js.map +0 -1
  372. package/dist/types/file/responses.d.ts +0 -2
  373. package/dist/types/file/responses.d.ts.map +0 -1
  374. package/dist/types/file/responses.js +0 -2
  375. package/dist/types/file/responses.js.map +0 -1
  376. package/dist/types/task/params.d.ts +0 -173
  377. package/dist/types/task/params.d.ts.map +0 -1
  378. package/dist/types/task/params.js +0 -8
  379. package/dist/types/task/params.js.map +0 -1
  380. package/dist/types/task/responses.d.ts +0 -334
  381. package/dist/types/task/responses.d.ts.map +0 -1
  382. package/dist/types/task/responses.js +0 -8
  383. package/dist/types/task/responses.js.map +0 -1
  384. package/dist/utils/sql-dump/core/dependency-sort.d.ts +0 -16
  385. package/dist/utils/sql-dump/core/dependency-sort.d.ts.map +0 -1
  386. package/dist/utils/sql-dump/core/dependency-sort.js +0 -105
  387. package/dist/utils/sql-dump/core/dependency-sort.js.map +0 -1
  388. package/dist/utils/sql-dump/core/generate-dump.d.ts +0 -13
  389. package/dist/utils/sql-dump/core/generate-dump.d.ts.map +0 -1
  390. package/dist/utils/sql-dump/core/generate-dump.js +0 -201
  391. package/dist/utils/sql-dump/core/generate-dump.js.map +0 -1
  392. package/dist/utils/sql-dump/core/index-export.d.ts +0 -10
  393. package/dist/utils/sql-dump/core/index-export.d.ts.map +0 -1
  394. package/dist/utils/sql-dump/core/index-export.js +0 -173
  395. package/dist/utils/sql-dump/core/index-export.js.map +0 -1
  396. package/dist/utils/sql-dump/core/sequence-reset.d.ts +0 -6
  397. package/dist/utils/sql-dump/core/sequence-reset.d.ts.map +0 -1
  398. package/dist/utils/sql-dump/core/sequence-reset.js +0 -28
  399. package/dist/utils/sql-dump/core/sequence-reset.js.map +0 -1
  400. package/dist/utils/sql-dump/core/table-export.d.ts +0 -2
  401. package/dist/utils/sql-dump/core/table-export.d.ts.map +0 -1
  402. package/dist/utils/sql-dump/core/table-export.js +0 -4
  403. package/dist/utils/sql-dump/core/table-export.js.map +0 -1
  404. package/dist/utils/sql-dump/core/view-export.d.ts +0 -2
  405. package/dist/utils/sql-dump/core/view-export.d.ts.map +0 -1
  406. package/dist/utils/sql-dump/core/view-export.js +0 -4
  407. package/dist/utils/sql-dump/core/view-export.js.map +0 -1
  408. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts +0 -14
  409. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts.map +0 -1
  410. package/dist/utils/sql-dump/formatters/bulk-insert.js +0 -177
  411. package/dist/utils/sql-dump/formatters/bulk-insert.js.map +0 -1
  412. package/dist/utils/sql-dump/formatters/identifiers.d.ts +0 -6
  413. package/dist/utils/sql-dump/formatters/identifiers.d.ts.map +0 -1
  414. package/dist/utils/sql-dump/formatters/identifiers.js +0 -16
  415. package/dist/utils/sql-dump/formatters/identifiers.js.map +0 -1
  416. package/dist/utils/sql-dump/formatters/value-formatter.d.ts +0 -14
  417. package/dist/utils/sql-dump/formatters/value-formatter.d.ts.map +0 -1
  418. package/dist/utils/sql-dump/formatters/value-formatter.js +0 -281
  419. package/dist/utils/sql-dump/formatters/value-formatter.js.map +0 -1
  420. package/dist/utils/sql-dump/generators/controls.d.ts +0 -10
  421. package/dist/utils/sql-dump/generators/controls.d.ts.map +0 -1
  422. package/dist/utils/sql-dump/generators/controls.js +0 -36
  423. package/dist/utils/sql-dump/generators/controls.js.map +0 -1
  424. package/dist/utils/sql-dump/generators/headers.d.ts +0 -6
  425. package/dist/utils/sql-dump/generators/headers.d.ts.map +0 -1
  426. package/dist/utils/sql-dump/generators/headers.js +0 -19
  427. package/dist/utils/sql-dump/generators/headers.js.map +0 -1
  428. package/dist/utils/sql-dump/index.d.ts +0 -14
  429. package/dist/utils/sql-dump/index.d.ts.map +0 -1
  430. package/dist/utils/sql-dump/index.js +0 -16
  431. package/dist/utils/sql-dump/index.js.map +0 -1
  432. package/dist/utils/sql-dump/schema/indexes.d.ts +0 -20
  433. package/dist/utils/sql-dump/schema/indexes.d.ts.map +0 -1
  434. package/dist/utils/sql-dump/schema/indexes.js +0 -108
  435. package/dist/utils/sql-dump/schema/indexes.js.map +0 -1
  436. package/dist/utils/sql-dump/schema/primary-keys.d.ts +0 -6
  437. package/dist/utils/sql-dump/schema/primary-keys.d.ts.map +0 -1
  438. package/dist/utils/sql-dump/schema/primary-keys.js +0 -41
  439. package/dist/utils/sql-dump/schema/primary-keys.js.map +0 -1
  440. package/dist/utils/sql-dump/schema/tables.d.ts +0 -15
  441. package/dist/utils/sql-dump/schema/tables.d.ts.map +0 -1
  442. package/dist/utils/sql-dump/schema/tables.js +0 -518
  443. package/dist/utils/sql-dump/schema/tables.js.map +0 -1
  444. package/dist/utils/sql-dump/schema/views.d.ts +0 -11
  445. package/dist/utils/sql-dump/schema/views.d.ts.map +0 -1
  446. package/dist/utils/sql-dump/schema/views.js +0 -116
  447. package/dist/utils/sql-dump/schema/views.js.map +0 -1
  448. package/dist/utils/sql-dump/types.d.ts +0 -10
  449. package/dist/utils/sql-dump/types.d.ts.map +0 -1
  450. package/dist/utils/sql-dump/types.js +0 -3
  451. package/dist/utils/sql-dump/types.js.map +0 -1
  452. package/dist/utils/sql-dump-converters.d.ts +0 -188
  453. package/dist/utils/sql-dump-converters.d.ts.map +0 -1
  454. package/dist/utils/sql-dump-converters.js +0 -315
  455. package/dist/utils/sql-dump-converters.js.map +0 -1
  456. package/dist/watcher/gitignore-parser.d.ts +0 -70
  457. package/dist/watcher/gitignore-parser.d.ts.map +0 -1
  458. package/dist/watcher/gitignore-parser.js +0 -195
  459. package/dist/watcher/gitignore-parser.js.map +0 -1
  460. package/dist/watcher/index.d.ts +0 -9
  461. package/dist/watcher/index.d.ts.map +0 -1
  462. package/dist/watcher/index.js +0 -8
  463. package/dist/watcher/index.js.map +0 -1
  464. package/docs/HOW_TO_UNINSTALL.md +0 -199
  465. package/docs/MIGRATION_CLEANUP_GUIDE.md +0 -212
  466. package/docs/SLASH_COMMANDS.md +0 -329
  467. package/docs/cli/DATABASE_MIGRATION.md +0 -290
  468. package/docs/cli/DATA_EXPORT_IMPORT.md +0 -701
  469. package/docs/cli/README.md +0 -276
  470. /package/dist/tests/{utils → integration}/json-export-import.test.d.ts +0 -0
  471. /package/dist/tests/{utils → integration}/json-export-import.test.js +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [5.1.0] - 2026-03-07
11
+
12
+ ### Changed
13
+
14
+ **📁 `.sqlew.env` relocated to `~/.config/sqlew/.sqlew.env`**
15
+
16
+ The cloud API key file (`~/.sqlew.env`) has been moved to `~/.config/sqlew/.sqlew.env` to align with the v5.1 unified global config path. Automatic migration copies the old file and deletes it (API key security: no stale copies). `saveCachedProjectId()` now calls `ensureGlobalConfigDir()` for directory safety.
17
+
18
+ **🔒 db:export Project Scope Auto-Detection (Security)**
19
+
20
+ `db:export` no longer exports all projects by default. With the global shared database (v5.1.0), the default "export everything" behavior risked leaking other projects' decision data.
21
+
22
+ - **Auto-detect**: Project name resolved from `.sqlew/config.toml` `[project].name` when no `project=` option is given
23
+ - **Explicit all**: `project=all` required to export all projects (escape hatch)
24
+ - **Error on ambiguity**: If no project name is found (no CLI arg, no config.toml), the command exits with an actionable error message
25
+ - **Breaking change**: Previously, omitting `project=` exported all projects silently
26
+
27
+ ### Resolution Priority
28
+
29
+ ```
30
+ 1. CLI argument: project=<name> (highest)
31
+ 2. config.toml: [project].name
32
+ 3. Error exit (lowest)
33
+ ```
34
+
35
+ ---
36
+
10
37
  ## [5.0.6] - 2026-02-14
11
38
 
12
39
  ### Changed
package/README.md CHANGED
@@ -5,176 +5,62 @@
5
5
  [![npm version](https://img.shields.io/npm/v/sqlew.svg)](https://www.npmjs.com/package/sqlew)
6
6
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
7
 
8
- > **ADR (Architecture Decision Record) for AI Agents** An MCP server that enables AI agents to create, query, and maintain architecture decision records in a structured SQL database
8
+ > **Design decisions, remembered by SQL** an MCP server for AI agents
9
9
 
10
- ## 🚀 Quick Start
10
+ ## What is sqlew?
11
11
 
12
- ### 1. Install MCP Server
12
+ ### The Problem
13
13
 
14
- ```bash
15
- npm install -g sqlew
16
- ```
14
+ Every AI coding session starts from scratch. Your agent doesn't remember that you chose PostgreSQL over MongoDB last week, or that the team agreed on a specific API versioning strategy. Without persistent memory, agents repeat mistakes, contradict earlier decisions, and waste tokens re-discovering context.
17
15
 
18
- ### 2. Install Plugin (Recommended)
16
+ ### The Solution
19
17
 
20
- In Claude Code, run the following commands:
18
+ sqlew stores your architectural decisions in a structured SQL database. When a new session starts, the AI agent queries past decisions in milliseconds — not by reading through scattered Markdown files, but through efficient SQL lookups with metadata, tags, and similarity detection.
21
19
 
22
- ```bash
23
- claude plugin marketplace add sqlew-io/sqlew-plugin
24
- claude plugin install sqlew
20
+ ```
21
+ ┌─────────────────────────────────────────────────────────────┐
22
+ │ Before sqlew │ After sqlew
23
+ │───────────────────────────────│─────────────────────────────│
24
+ │ Session 1: "Use PostgreSQL" │ Session 1: "Use PostgreSQL"│
25
+ │ Session 2: "Use MongoDB?" │ → decision recorded │
26
+ │ Session 3: "Use PostgreSQL" │ Session 2: query → got it │
27
+ │ (same debate, every time) │ Session 3: query → got it │
28
+ │ │ (instant recall) │
29
+ └─────────────────────────────────────────────────────────────┘
25
30
  ```
26
31
 
27
- **That's it!** The plugin automatically sets up everything:
28
-
29
- - ✅ MCP server config (`.mcp.json`)
30
- - ✅ Claude Code Skills (Plan Mode guidance)
31
- - ✅ Claude Code Hooks (automatic decision capture)
32
-
33
- > **Note:** Plan mode enforcement is handled by the plugin's `UserPromptSubmit` hook — no manual configuration needed.
32
+ sqlew is built on the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP), so it works with any MCP-compatible AI coding tool.
34
33
 
35
- ### 3. Connect to sqlew.io (For Teams) 🌐
34
+ > _This software does not send any data to external networks. We NEVER collect any data or usage statistics._
36
35
 
37
- **NEW in v5.0.0**: Connect to the cloud for team-shared decisions!
36
+ ## Quick Start
38
37
 
39
- **Step 1: Get your API key** (one-time setup)
40
-
41
- Visit [sqlew.io](https://sqlew.io) and save your API key:
38
+ ### 1. Install
42
39
 
43
40
  ```bash
44
- # ~/.sqlew.env (shared across all projects)
45
- SQLEW_API_KEY=your-api-key
46
- ```
47
-
48
- **Step 2: Configure each project**
49
-
50
- ```toml
51
- # .sqlew/config.toml (per-project)
52
- [database]
53
- type = "cloud"
54
-
55
- [project]
56
- name = "your-project-name"
41
+ npm install -g sqlew
57
42
  ```
58
43
 
59
- > **Note:** Each project needs its own `.sqlew/config.toml` to specify the project name.
60
-
61
- **Benefits:**
62
- - 👥 **Team sharing** - All team members share the same decision database
63
- - 🌳 **Git worktree ready** - Works seamlessly with multiple branches
64
- - ⚡ **Zero setup** - No local database required
65
-
66
- ### Alternative: Local Database (Offline)
44
+ ### 2. Setup
67
45
 
68
- For offline or single-developer use, **no setup required**:
46
+ Choose the setup that matches your environment:
69
47
 
70
- - Database (`.sqlew/sqlew.db`) is auto-created on first MCP server start
71
- - Config file (`.sqlew/config.toml`) is auto-generated with detected project name
72
-
73
- Just start using Claude Code - everything initializes automatically!
74
-
75
- ### 4. Just use Plan Mode!
76
-
77
- **That's it!** Now every time you:
78
-
79
- 1. Create a plan in Claude Code
80
- 2. Get user approval (ExitPlanMode)
81
-
82
- → Your architectural decisions are **automatically recorded** as ADR knowledge.
83
-
84
- No special commands needed. Just plan your work normally, and sqlew captures the decisions in the background.
85
-
86
- ### Optional: /sqlew command
87
-
88
- For manual queries and explicit decision recording:
48
+ #### Claude Code (Plugin)
89
49
 
90
50
  ```bash
91
- /sqlew # Show status
92
- /sqlew search auth # Search past decisions
93
- /sqlew record use Redis # Record a decision manually
51
+ claude plugin marketplace add sqlew-io/sqlew-plugin
52
+ claude plugin install sqlew
94
53
  ```
95
54
 
96
- ---
97
-
98
- ## What is sqlew?
99
-
100
- **sqlew** is a Model Context Protocol (MCP) server that brings ADR (Architecture Decision Record) capabilities to AI agents through a shared SQL-backed repository.
101
-
102
- ### The Problem: AI Agents Lack Decision Memory
103
-
104
- Every AI session starts with zero context. Agents must re-learn architectural decisions, can reintroduce previously rejected patterns, and have no systematic way to understand WHY past choices were made.
105
-
106
- Traditional ADR approaches use Markdown files scattered across repositories. While human-readable, this format creates challenges for AI agents:
107
-
108
- - **No structured querying** – AI must read entire files to find relevant decisions
109
- - **Context explosion** – Token costs grow linearly with decision history
110
- - **No duplicate detection** – AI cannot easily identify similar or conflicting decisions
111
- - **Poor discoverability** – Finding related decisions requires full-text search across many files
112
-
113
- ### _sqlew_ brings structured ADR to AI agents
114
-
115
- sqlew transforms ADR from static documentation into a **queryable, AI-native decision database**:
116
-
117
- - **Structured records** – Decisions stored as relational data with metadata, tags, and relationships
118
- - **Efficient querying** – AI agents retrieve only relevant decisions via SQL queries
119
- - **Smart suggestions** – Three-tier similarity system detects duplicate or related decisions
120
- - **Constraint tracking** – Architectural rules and principles as first-class entities
121
- - **Auto-capture** – Claude Code Hooks automatically record decisions from Plan Mode
122
-
123
- > _This software does not send any data to external networks. We NEVER collect any data or usage statistics. Please use it with complete security._
124
-
125
- ## Why sqlew?
126
-
127
- AI agents automatically accumulate project knowledge through Plan Mode. Decisions are stored in SQL for efficient querying.
128
-
129
- ### 🌐 Team Development Made Easy (NEW in v5.0.0)
130
-
131
- - **Shared decision database** - All team members see the same architectural decisions
132
- - **Multiple AI agents** - Work simultaneously without conflicts
133
- - **No local setup** - Just add your API key and start
134
-
135
- ### 🌳 Perfect for Git Worktree Workflows
55
+ The plugin automatically configures MCP server, Skills (Plan Mode guidance), and Hooks (automatic decision capture).
136
56
 
137
- - **Automatic worktree detection** - Each worktree shares the same context
138
- - **Config inheritance** - Main repository settings apply everywhere
139
- - **Independent sessions** - Each worktree has its own cache
57
+ #### Codex CLI
140
58
 
141
- **Perfect for:**
59
+ See [sqlew-codex](https://github.com/sqlew-io/sqlew-codex) for Codex CLI integration.
142
60
 
143
- - 🏢 Large-scale projects with many architectural decisions
144
- - 🔧 Long-term maintenance where context must persist across sessions
145
- - 👥 **Team environments** where multiple AI agents share knowledge
146
- - 🌳 **Git worktree** workflows with multiple concurrent branches
61
+ #### Manual
147
62
 
148
- **Key benefits:**
149
-
150
- - ⚡ **60-75% token reduction** vs reading Markdown ADRs
151
- - 🔍 **Millisecond queries** (2-50ms) even with thousands of decisions
152
- - 🛡️ **Duplicate prevention** via similarity detection
153
- - 📚 **Persistent memory** across all AI sessions
154
- - 👥 **Team sync** via sqlew.io cloud backend
155
-
156
- → See [ADR Concepts](docs/ADR_CONCEPTS.md) for detailed architecture.
157
-
158
- ---
159
-
160
- **Technical Features**: 7 MCP tools (3 core: decision, constraint, suggest + 4 utility: help, example, use_case, queue), three-tier similarity detection (0-100 point scoring), ACID transaction support, multi-database backend (SQLite/PostgreSQL/MySQL/Cloud), metadata-driven organization with layers and tags
161
-
162
- ## Installation
163
-
164
- ### Requirements
165
-
166
- - Node.js 20.0.0 or higher
167
- - npm or npx
168
-
169
- ### Recommended: Global Install
170
-
171
- ```bash
172
- npm install -g sqlew
173
- ```
174
-
175
- > **Why global install?** Claude Code Hooks call `sqlew` directly from shell. Global install ensures hooks work correctly without npx overhead.
176
-
177
- Then add to `.mcp.json` in your project root:
63
+ Add to `.mcp.json` in your project root:
178
64
 
179
65
  ```json
180
66
  {
@@ -186,147 +72,119 @@ Then add to `.mcp.json` in your project root:
186
72
  }
187
73
  ```
188
74
 
189
- ### Alternative: npx (Not Recommended)
190
-
191
- **⚠️ Not recommended**: npx usage prevents Claude Code Hooks from working, disabling Plan-to-ADR automatic decision capture. Use global install instead.
192
-
193
- **Note**: First run initializes the database. Restart Claude Code to load the MCP server.
194
-
195
- Each project maintains its own context database in `.sqlew/sqlew.db`.
75
+ The database (`~/.config/sqlew/sqlew-shared.db`) and config are auto-created on first run. See [Shared Database](docs/SHARED_DATABASE.md) for details.
196
76
 
197
- **Custom database path:** Add path as argument: `"args": ["sqlew", "/path/to/db.db"]`
198
- **Default location:** `.sqlew/sqlew.db`
77
+ ### 3. Just use Plan Mode!
199
78
 
200
- ## Configuration
79
+ That's it. Every time you create a plan and get user approval, your architectural decisions are **automatically recorded**.
201
80
 
202
- sqlew supports multiple database backends:
81
+ No special commands needed — just plan your work normally, and sqlew captures the decisions in the background.
203
82
 
204
- | Database | Use Case | Status |
205
- | ---------------------------- | ------------------------ | ------------ |
206
- | **SQLite** | Personal/small projects | ✅ Default |
207
- | **MySQL 8.0+ / MariaDB 10+** | Production, team sharing | ✅ Supported |
208
- | **PostgreSQL 12+** | Production, team sharing | ✅ Supported |
83
+ ## Features
209
84
 
210
- Configuration is managed via `.sqlew/config.toml` file and CLI arguments.
211
-
212
- **[Full Configuration Guide](docs/CONFIGURATION.md)** - All options, database setup, validation rules
213
-
214
- ## Documentation
85
+ - **Structured Records** Decisions stored as relational data with metadata, tags, layers, and version history
86
+ - **Fast Queries** — 2-50ms retrieval via SQL, even with thousands of decisions
87
+ - **Duplicate Detection** — Three-tier similarity scoring (0-100) prevents redundant decisions
88
+ - **Constraint Tracking** — Architectural rules and principles as first-class entities
89
+ - **Auto-Capture** — Hooks automatically record decisions from Plan Mode (Claude Code plugin)
90
+ - **Multi-Database** — SQLite (default), PostgreSQL, MySQL/MariaDB, or Cloud
91
+ - **Git Worktree Ready** — Each worktree shares the same context database
215
92
 
216
- Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
93
+ ## For Teams (sqlew.io)
217
94
 
218
- And `action: "use_case"` shows how to use the tool in a real-world scenario.
95
+ Connect to [sqlew.io](https://sqlew.io) for team-shared decisions:
219
96
 
220
- ### On-Demand Documentation
97
+ **Step 1: Get your API key**
221
98
 
222
- All tools support:
223
-
224
- - `action: "help"` - Parameter reference and descriptions
225
- - `action: "example"` - Usage scenarios and examples
226
- - `action: "use_case"` - Real-world usage examples
227
-
228
- ### For AI Agents
229
-
230
- **Essential Guides:**
231
-
232
- **Advanced Features:**
99
+ Visit [sqlew.io](https://sqlew.io) and save your API key:
233
100
 
234
- - [Hooks Guide](docs/HOOKS_GUIDE.md) - Claude Code Hooks integration
235
- - [Cross Database](docs/CROSS_DATABASE.md) - Multi-database support
101
+ ```bash
102
+ # ~/.config/sqlew/.sqlew.env (shared across all projects)
103
+ SQLEW_API_KEY=your-api-key
104
+ ```
236
105
 
237
- **Reference:**
106
+ **Step 2: Configure each project**
238
107
 
239
- - [Configuration](docs/CONFIGURATION.md) - Config file setup, all options
108
+ ```toml
109
+ # .sqlew/config.toml
110
+ [database]
111
+ type = "cloud"
240
112
 
241
- ### Advanced Usage
113
+ [project]
114
+ name = "your-project-name"
115
+ ```
242
116
 
243
- - [Configuration Guide](docs/CONFIGURATION.md) - TOML config file setup
244
- - [CLI Mode Overview](docs/cli/README.md) - Database migration, export/import commands
117
+ **Benefits:**
118
+ - All team members share the same decision database
119
+ - Works seamlessly with Git worktree workflows
120
+ - No local database setup required
245
121
 
246
- ### Upgrade Guides
122
+ ## Performance
247
123
 
248
- - **[Upgrade from v4 to v5](docs/MIGRATION_CLEANUP_GUIDE.md)** - Cleanup legacy files after plugin migration
249
- - **[Migrating Local Data to SaaS](docs/MIGRATION_TO_SAAS.md)** - Export local v3.x/v4.x data to sqlew.io cloud
250
- - [Migration from v2](docs/MIGRATION_v2.md) - Version upgrade guides
124
+ | Metric | Value |
125
+ |--------|-------|
126
+ | Query speed | 2-50ms |
127
+ | Concurrent agents | 5+ simultaneous |
128
+ | Storage efficiency | ~140 bytes/decision |
129
+ | Token savings | 60-75% vs Markdown ADRs |
251
130
 
252
131
  ## Use Cases
253
132
 
254
- ### ADR-Driven Development with AI
255
-
256
- - **Architecture Evolution** Document major architectural decisions with full context and alternatives
257
- - **Pattern Standardization** Establish coding patterns as constraints, enforce via AI code generation
258
- - **Technical Debt Tracking** Record temporary decisions with deprecation paths and future plans
259
- - **Onboarding Acceleration** – New AI sessions instantly understand architectural history
133
+ - **Architecture Evolution** — Document major decisions with full context and alternatives considered
134
+ - **Pattern Standardization** — Establish coding patterns as constraints, enforce via AI code generation
135
+ - **Cross-Session Continuity** AI maintains context across days/weeks without re-reading docs
136
+ - **Multi-Agent Coordination** Multiple AI agents share architectural understanding
137
+ - **Onboarding Acceleration** New AI sessions instantly understand project history
260
138
 
261
- ### Cross-Session AI Workflows
139
+ ## Documentation
262
140
 
263
- - **Multi-Session Projects** AI maintains context across days/weeks without re-reading documentation
264
- - **Multi-Agent Coordination** – Multiple AI agents share architectural understanding through ADR database
265
- - **Breaking Change Management** Document API changes, deprecations, and migration paths systematically
266
- - **Refactoring Guidance** AI references past decisions to maintain architectural consistency during refactors
141
+ | Guide | Description |
142
+ |-------|-------------|
143
+ | [ADR Concepts](docs/ADR_CONCEPTS.md) | Architecture Decision Records explained |
144
+ | [Configuration](docs/CONFIGURATION.md) | Config file setup, database options |
145
+ | [Hooks Guide](docs/HOOKS_GUIDE.md) | Claude Code Hooks integration |
146
+ | [Cross Database](docs/CROSS_DATABASE.md) | Multi-database support |
147
+ | [CLI Usage](docs/CLI_USAGE.md) | Database migration, export/import |
267
148
 
268
- ### Real-World Examples
149
+ ### Upgrade Guides
269
150
 
270
- ```bash
271
- # Document an architectural decision with alternatives
272
- /sqlew record we use PostgreSQL over MongoDB. MongoDB was rejected due to lack of ACID transactions for our financial data requirements.
151
+ - [Migrating to SaaS](docs/MIGRATION_TO_SAAS.md) — Export local data to sqlew.io cloud
273
152
 
274
- # Search for past decisions before making new ones
275
- /sqlew search why did we choose JWT authentication
276
153
 
277
- # Create constraint to guide AI code generation
278
- /sqlew add constraint all API endpoints must use /v2/ prefix for versioning
154
+ ### MCP Tools
279
155
 
280
- # Plan implementation of a decision
281
- /sqlew plan implementing the PostgreSQL connection pool with pgBouncer
282
- ```
156
+ 7 action-based tools: `decision`, `constraint`, `suggest`, `help`, `example`, `use_case`, `queue`
283
157
 
284
- ## Performance
285
-
286
- - **Query speed**: 2-50ms
287
- - **Concurrent agents**: 5+ simultaneous
288
- - **Storage efficiency**: ~140 bytes per decision
289
- - **Token savings**: 60-75% in typical projects
158
+ All tools support `action: "help"` for documentation.
290
159
 
291
160
  ## Support
292
161
 
293
- Support development via [GitHub Sponsors](https://github.com/sponsors/sqlew-io) - One-time or monthly options available.
162
+ Support development via [GitHub Sponsors](https://github.com/sponsors/sqlew-io).
294
163
 
295
164
  ## Version
296
165
 
297
- Current version: **5.0.6**
298
- See [CHANGELOG.md](CHANGELOG.md) for release history.
166
+ Current version: **5.0.8**
299
167
 
300
- **What's New in v5.0.6:**
168
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
301
169
 
302
- - 🧹 **CLAUDE.md injection removed** - Plan mode enforcement via `UserPromptSubmit` hook (no more global file pollution)
303
- - 🔌 **Plugin-first Architecture** - Simplified setup via sqlew-plugin
304
- - 🌐 **SaaS Backend** - Connect to [sqlew.io](https://sqlew.io) for team-shared decisions
305
- - 🌳 **Git Worktree Support** - Seamless multi-branch development
170
+ **What's New in v5.0.8:**
306
171
 
307
- See [docs/HOOKS_GUIDE.md](docs/HOOKS_GUIDE.md) for Claude Code Hooks details.
172
+ - **PR ADR enforcement** PreToolUse Hook blocks `gh pr create` without ADR markers, file-grouped format
173
+ - **Codex CLI support** — Works beyond Claude Code via [sqlew-codex](https://github.com/sqlew-io/sqlew-codex)
174
+ - **Plugin-first architecture** — Simplified setup via sqlew-plugin
175
+ - **Cloud backend** — Connect to [sqlew.io](https://sqlew.io) for team-shared decisions
308
176
 
309
177
  ## License
310
178
 
311
- Apache License 2.0 - Free for commercial and personal use. See [LICENSE](LICENSE) for details.
179
+ Apache License 2.0 Free for commercial and personal use. See [LICENSE](LICENSE) for details.
312
180
 
313
181
  ## Links
314
182
 
315
183
  - [npm package](https://www.npmjs.com/package/sqlew)
316
- - [GitHub repository](https://github.com/sqlew-io/sqlew)
184
+ - [GitHub](https://github.com/sqlew-io/sqlew)
185
+ - [Issues](https://github.com/sqlew-io/sqlew/issues)
317
186
  - [Model Context Protocol](https://modelcontextprotocol.io/)
318
187
 
319
- ## Support & Documentation
320
-
321
- - Issues: [GitHub Issues](https://github.com/sqlew-io/sqlew/issues)
322
- - Docs: [docs/](docs/) directory
323
-
324
- ## Acknowledgments
325
-
326
- Built with [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk), [better-sqlite3](https://github.com/WiseLibs/better-sqlite3), and TypeScript.
327
-
328
- **Author**: sqlew-io
329
-
330
188
  ---
331
189
 
332
- <!-- Git Hooks Integration Test: 2025-12-22 - This line tests post-merge hook triggering mark-done --auto -->
190
+ Built with [MCP SDK](https://github.com/modelcontextprotocol/sdk), [better-sqlite3](https://github.com/WiseLibs/better-sqlite3), and TypeScript.
@@ -1,86 +1,7 @@
1
- /**
2
- * @fileoverview Authentication Provider Factory
3
- *
4
- * Factory module for creating appropriate authentication providers based on database configuration.
5
- * Supports direct connections and future IAM-based authentication.
6
- *
7
- * **Note:** SSH tunneling is not supported. Users must set up SSH tunnels manually.
8
- *
9
- * @module adapters/auth/auth-factory
10
- */
11
1
  import { BaseAuthProvider } from './base-auth-provider.js';
12
2
  import type { DatabaseConfig } from '../../config/types.js';
13
- /**
14
- * Create an authentication provider based on database configuration.
15
- *
16
- * Provider selection logic:
17
- * - SQLite: Returns null (no authentication needed for file-based database)
18
- * - MySQL/PostgreSQL: Returns DirectAuthProvider
19
- *
20
- * @param config - Database configuration
21
- * @returns Authentication provider instance or null for SQLite
22
- * @throws Error if database type is invalid
23
- *
24
- * @example
25
- * // Direct connection
26
- * const config: DatabaseConfig = {
27
- * type: 'mysql',
28
- * connection: {
29
- * host: 'localhost',
30
- * port: 3306,
31
- * database: 'mydb'
32
- * },
33
- * auth: {
34
- * type: 'direct',
35
- * user: 'dbuser',
36
- * password: 'dbpass'
37
- * }
38
- * };
39
- * const provider = createAuthProvider(config);
40
- * // Returns DirectAuthProvider instance
41
- *
42
- * @example
43
- * // Connection via manual SSH tunnel
44
- * // Step 1: Set up tunnel manually:
45
- * // ssh -L 3307:db.internal.company.com:3306 user@bastion.example.com
46
- * // Step 2: Configure to use localhost:
47
- * const config: DatabaseConfig = {
48
- * type: 'mysql',
49
- * connection: {
50
- * host: 'localhost', // Tunnel endpoint
51
- * port: 3307, // Forwarded port
52
- * database: 'mydb'
53
- * },
54
- * auth: {
55
- * type: 'direct',
56
- * user: 'dbuser',
57
- * password: 'dbpass'
58
- * }
59
- * };
60
- * const provider = createAuthProvider(config);
61
- * // Returns DirectAuthProvider for localhost connection
62
- *
63
- * @example
64
- * // SQLite (no authentication)
65
- * const sqliteConfig: DatabaseConfig = {
66
- * type: 'sqlite',
67
- * path: './data.db'
68
- * };
69
- * const provider = createAuthProvider(sqliteConfig);
70
- * // Returns null
71
- */
3
+ /** Create an authentication provider based on database configuration. */
72
4
  export declare function createAuthProvider(config: DatabaseConfig): BaseAuthProvider | null;
73
- /**
74
- * Check if database type requires authentication.
75
- *
76
- * @param config - Database configuration
77
- * @returns True if authentication is required (MySQL/PostgreSQL)
78
- *
79
- * @example
80
- * if (requiresAuthentication(config)) {
81
- * const provider = createAuthProvider(config);
82
- * await provider!.authenticate();
83
- * }
84
- */
5
+ /** Check if database type requires authentication. */
85
6
  export declare function requiresAuthentication(config: DatabaseConfig): boolean;
86
7
  //# sourceMappingURL=auth-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-factory.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/auth-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,IAAI,CAmBlF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEtE"}
1
+ {"version":3,"file":"auth-factory.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/auth-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,IAAI,CAkBlF;AAED,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEtE"}
@@ -1,73 +1,5 @@
1
- /**
2
- * @fileoverview Authentication Provider Factory
3
- *
4
- * Factory module for creating appropriate authentication providers based on database configuration.
5
- * Supports direct connections and future IAM-based authentication.
6
- *
7
- * **Note:** SSH tunneling is not supported. Users must set up SSH tunnels manually.
8
- *
9
- * @module adapters/auth/auth-factory
10
- */
11
1
  import { DirectAuthProvider } from './direct-auth-provider.js';
12
- /**
13
- * Create an authentication provider based on database configuration.
14
- *
15
- * Provider selection logic:
16
- * - SQLite: Returns null (no authentication needed for file-based database)
17
- * - MySQL/PostgreSQL: Returns DirectAuthProvider
18
- *
19
- * @param config - Database configuration
20
- * @returns Authentication provider instance or null for SQLite
21
- * @throws Error if database type is invalid
22
- *
23
- * @example
24
- * // Direct connection
25
- * const config: DatabaseConfig = {
26
- * type: 'mysql',
27
- * connection: {
28
- * host: 'localhost',
29
- * port: 3306,
30
- * database: 'mydb'
31
- * },
32
- * auth: {
33
- * type: 'direct',
34
- * user: 'dbuser',
35
- * password: 'dbpass'
36
- * }
37
- * };
38
- * const provider = createAuthProvider(config);
39
- * // Returns DirectAuthProvider instance
40
- *
41
- * @example
42
- * // Connection via manual SSH tunnel
43
- * // Step 1: Set up tunnel manually:
44
- * // ssh -L 3307:db.internal.company.com:3306 user@bastion.example.com
45
- * // Step 2: Configure to use localhost:
46
- * const config: DatabaseConfig = {
47
- * type: 'mysql',
48
- * connection: {
49
- * host: 'localhost', // Tunnel endpoint
50
- * port: 3307, // Forwarded port
51
- * database: 'mydb'
52
- * },
53
- * auth: {
54
- * type: 'direct',
55
- * user: 'dbuser',
56
- * password: 'dbpass'
57
- * }
58
- * };
59
- * const provider = createAuthProvider(config);
60
- * // Returns DirectAuthProvider for localhost connection
61
- *
62
- * @example
63
- * // SQLite (no authentication)
64
- * const sqliteConfig: DatabaseConfig = {
65
- * type: 'sqlite',
66
- * path: './data.db'
67
- * };
68
- * const provider = createAuthProvider(sqliteConfig);
69
- * // Returns null
70
- */
2
+ /** Create an authentication provider based on database configuration. */
71
3
  export function createAuthProvider(config) {
72
4
  // Validate database type
73
5
  if (!config.type) {
@@ -82,21 +14,9 @@ export function createAuthProvider(config) {
82
14
  return null;
83
15
  }
84
16
  // MySQL/PostgreSQL use direct authentication
85
- // (Users must set up SSH tunnels manually if needed)
86
17
  return new DirectAuthProvider(config);
87
18
  }
88
- /**
89
- * Check if database type requires authentication.
90
- *
91
- * @param config - Database configuration
92
- * @returns True if authentication is required (MySQL/PostgreSQL)
93
- *
94
- * @example
95
- * if (requiresAuthentication(config)) {
96
- * const provider = createAuthProvider(config);
97
- * await provider!.authenticate();
98
- * }
99
- */
19
+ /** Check if database type requires authentication. */
100
20
  export function requiresAuthentication(config) {
101
21
  return config.type !== 'sqlite';
102
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth-factory.js","sourceRoot":"","sources":["../../../src/adapters/auth/auth-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,yBAAyB;IACzB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,IAAI,qBAAqB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,kDAAkD;IAClD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6CAA6C;IAC7C,qDAAqD;IACrD,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAsB;IAC3D,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"auth-factory.js","sourceRoot":"","sources":["../../../src/adapters/auth/auth-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,yBAAyB;IACzB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,IAAI,qBAAqB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,kDAAkD;IAClD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6CAA6C;IAC7C,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,sBAAsB,CAAC,MAAsB;IAC3D,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC"}