sqlew 3.6.10 → 3.7.1

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 (372) hide show
  1. package/CHANGELOG.md +346 -0
  2. package/README.md +54 -39
  3. package/assets/config.example.toml +93 -0
  4. package/assets/kanban-visualizer.png +0 -0
  5. package/assets/sample-agents/sqlew-architect.md +32 -13
  6. package/assets/sample-agents/sqlew-researcher.md +70 -17
  7. package/assets/sample-agents/sqlew-scrum-master.md +60 -25
  8. package/assets/schema.sql +2 -2
  9. package/dist/adapters/auth/auth-factory.d.ts +86 -0
  10. package/dist/adapters/auth/auth-factory.d.ts.map +1 -0
  11. package/dist/adapters/auth/auth-factory.js +103 -0
  12. package/dist/adapters/auth/auth-factory.js.map +1 -0
  13. package/dist/adapters/auth/auth-types.d.ts +30 -0
  14. package/dist/adapters/auth/auth-types.d.ts.map +1 -0
  15. package/dist/adapters/auth/auth-types.js +30 -0
  16. package/dist/adapters/auth/auth-types.js.map +1 -0
  17. package/dist/adapters/auth/base-auth-provider.d.ts +327 -0
  18. package/dist/adapters/auth/base-auth-provider.d.ts.map +1 -0
  19. package/dist/adapters/auth/base-auth-provider.js +111 -0
  20. package/dist/adapters/auth/base-auth-provider.js.map +1 -0
  21. package/dist/adapters/auth/direct-auth-provider.d.ts +356 -0
  22. package/dist/adapters/auth/direct-auth-provider.d.ts.map +1 -0
  23. package/dist/adapters/auth/direct-auth-provider.js +406 -0
  24. package/dist/adapters/auth/direct-auth-provider.js.map +1 -0
  25. package/dist/adapters/base-adapter.d.ts +638 -0
  26. package/dist/adapters/base-adapter.d.ts.map +1 -0
  27. package/dist/adapters/base-adapter.js +557 -0
  28. package/dist/adapters/base-adapter.js.map +1 -0
  29. package/dist/adapters/index.d.ts +13 -2
  30. package/dist/adapters/index.d.ts.map +1 -1
  31. package/dist/adapters/index.js +27 -5
  32. package/dist/adapters/index.js.map +1 -1
  33. package/dist/adapters/mysql-adapter.d.ts +547 -6
  34. package/dist/adapters/mysql-adapter.d.ts.map +1 -1
  35. package/dist/adapters/mysql-adapter.js +651 -32
  36. package/dist/adapters/mysql-adapter.js.map +1 -1
  37. package/dist/adapters/postgresql-adapter.d.ts +15 -4
  38. package/dist/adapters/postgresql-adapter.d.ts.map +1 -1
  39. package/dist/adapters/postgresql-adapter.js +19 -2
  40. package/dist/adapters/postgresql-adapter.js.map +1 -1
  41. package/dist/adapters/sqlite-adapter.d.ts +35 -5
  42. package/dist/adapters/sqlite-adapter.d.ts.map +1 -1
  43. package/dist/adapters/sqlite-adapter.js +57 -18
  44. package/dist/adapters/sqlite-adapter.js.map +1 -1
  45. package/dist/cli/db-dump.d.ts +32 -0
  46. package/dist/cli/db-dump.d.ts.map +1 -0
  47. package/dist/cli/db-dump.js +409 -0
  48. package/dist/cli/db-dump.js.map +1 -0
  49. package/dist/cli.js +24 -14
  50. package/dist/cli.js.map +1 -1
  51. package/dist/config/knex/bootstrap/20251025020452_create_master_tables.d.ts.map +1 -0
  52. package/dist/{migrations → config}/knex/bootstrap/20251025020452_create_master_tables.js +7 -2
  53. package/dist/config/knex/bootstrap/20251025020452_create_master_tables.js.map +1 -0
  54. package/dist/config/knex/bootstrap/20251025021152_create_transaction_tables.d.ts.map +1 -0
  55. package/dist/{migrations → config}/knex/bootstrap/20251025021152_create_transaction_tables.js +49 -50
  56. package/dist/config/knex/bootstrap/20251025021152_create_transaction_tables.js.map +1 -0
  57. package/dist/config/knex/bootstrap/20251025021351_create_indexes.d.ts.map +1 -0
  58. package/dist/config/knex/bootstrap/20251025021351_create_indexes.js.map +1 -0
  59. package/dist/config/knex/bootstrap/20251025021416_seed_master_data.d.ts.map +1 -0
  60. package/dist/{migrations → config}/knex/bootstrap/20251025021416_seed_master_data.js +11 -6
  61. package/dist/config/knex/bootstrap/20251025021416_seed_master_data.js.map +1 -0
  62. package/dist/config/knex/bootstrap/20251025070349_create_views.d.ts.map +1 -0
  63. package/dist/{migrations → config}/knex/bootstrap/20251025070349_create_views.js +66 -14
  64. package/dist/config/knex/bootstrap/20251025070349_create_views.js.map +1 -0
  65. package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts.map +1 -0
  66. package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js +22 -0
  67. package/dist/config/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js.map +1 -0
  68. package/dist/config/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts.map +1 -0
  69. package/dist/config/knex/enhancements/20251025082220_fix_task_dependencies_columns.js.map +1 -0
  70. package/dist/config/knex/enhancements/20251025090000_create_help_system_tables.d.ts.map +1 -0
  71. package/dist/{migrations → config}/knex/enhancements/20251025090000_create_help_system_tables.js +6 -0
  72. package/dist/config/knex/enhancements/20251025090000_create_help_system_tables.js.map +1 -0
  73. package/dist/config/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts.map +1 -0
  74. package/dist/{migrations → config}/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js +6 -0
  75. package/dist/config/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js.map +1 -0
  76. package/dist/config/knex/enhancements/20251025100000_seed_help_metadata.d.ts.map +1 -0
  77. package/dist/{migrations → config}/knex/enhancements/20251025100000_seed_help_metadata.js +6 -0
  78. package/dist/config/knex/enhancements/20251025100000_seed_help_metadata.js.map +1 -0
  79. package/dist/config/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts.map +1 -0
  80. package/dist/config/knex/enhancements/20251025100100_seed_remaining_use_cases.js.map +1 -0
  81. package/dist/config/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts.map +1 -0
  82. package/dist/{migrations → config}/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js +7 -0
  83. package/dist/config/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js.map +1 -0
  84. package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts.map +1 -0
  85. package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.js +62 -0
  86. package/dist/config/knex/enhancements/20251027000000_add_agent_reuse_system.js.map +1 -0
  87. package/dist/config/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts.map +1 -0
  88. package/dist/config/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js.map +1 -0
  89. package/dist/config/knex/enhancements/20251027020000_update_agent_reusability.d.ts.map +1 -0
  90. package/dist/{migrations → config}/knex/enhancements/20251027020000_update_agent_reusability.js +6 -0
  91. package/dist/config/knex/enhancements/20251027020000_update_agent_reusability.js.map +1 -0
  92. package/dist/config/knex/enhancements/20251028000000_simplify_agent_system.d.ts.map +1 -0
  93. package/dist/{migrations → config}/knex/enhancements/20251028000000_simplify_agent_system.js +6 -0
  94. package/dist/config/knex/enhancements/20251028000000_simplify_agent_system.js.map +1 -0
  95. package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.d.ts +13 -0
  96. package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.d.ts.map +1 -0
  97. package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.js +48 -0
  98. package/dist/config/knex/enhancements/20251031000000_drop_orphaned_message_view.js.map +1 -0
  99. package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.d.ts +24 -0
  100. package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.d.ts.map +1 -0
  101. package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.js +189 -0
  102. package/dist/config/knex/enhancements/20251104000003_rename_constraints_created_by_to_agent_id.js.map +1 -0
  103. package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.d.ts +16 -0
  104. package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.d.ts.map +1 -0
  105. package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.js +65 -0
  106. package/dist/config/knex/enhancements/20251105000000_add_token_usage_table.js.map +1 -0
  107. package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.d.ts +23 -0
  108. package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.d.ts.map +1 -0
  109. package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.js +118 -0
  110. package/dist/config/knex/enhancements/20251105000001_rename_decision_context_decided_by_to_agent_id.js.map +1 -0
  111. package/dist/config/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts.map +1 -0
  112. package/dist/config/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js.map +1 -0
  113. package/dist/config/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts.map +1 -0
  114. package/dist/config/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js.map +1 -0
  115. package/dist/config/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts.map +1 -0
  116. package/dist/config/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js.map +1 -0
  117. package/dist/config/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts.map +1 -0
  118. package/dist/config/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js.map +1 -0
  119. package/dist/config/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts.map +1 -0
  120. package/dist/config/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js.map +1 -0
  121. package/dist/config/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts.map +1 -0
  122. package/dist/config/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js.map +1 -0
  123. package/dist/config/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts.map +1 -0
  124. package/dist/config/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js.map +1 -0
  125. package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.d.ts +49 -0
  126. package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.d.ts.map +1 -0
  127. package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.js +864 -0
  128. package/dist/config/knex/upgrades/20251104000000_add_multi_project_v3_7_0.js.map +1 -0
  129. package/dist/config/loader.d.ts +19 -1
  130. package/dist/config/loader.d.ts.map +1 -1
  131. package/dist/config/loader.js +149 -4
  132. package/dist/config/loader.js.map +1 -1
  133. package/dist/config/types.d.ts +261 -2
  134. package/dist/config/types.d.ts.map +1 -1
  135. package/dist/config/types.js.map +1 -1
  136. package/dist/config/writer.d.ts +65 -0
  137. package/dist/config/writer.d.ts.map +1 -0
  138. package/dist/config/writer.js +139 -0
  139. package/dist/config/writer.js.map +1 -0
  140. package/dist/database.d.ts +11 -2
  141. package/dist/database.d.ts.map +1 -1
  142. package/dist/database.js +62 -6
  143. package/dist/database.js.map +1 -1
  144. package/dist/index.js +173 -39
  145. package/dist/index.js.map +1 -1
  146. package/dist/knexfile.d.ts.map +1 -1
  147. package/dist/knexfile.js +88 -12
  148. package/dist/knexfile.js.map +1 -1
  149. package/dist/tests/all-features.test.js +15 -3
  150. package/dist/tests/all-features.test.js.map +1 -1
  151. package/dist/tests/config-loader.test.d.ts +6 -0
  152. package/dist/tests/config-loader.test.d.ts.map +1 -0
  153. package/dist/tests/config-loader.test.js +201 -0
  154. package/dist/tests/config-loader.test.js.map +1 -0
  155. package/dist/tests/connection-manager-integration.test.d.ts +2 -0
  156. package/dist/tests/connection-manager-integration.test.d.ts.map +1 -0
  157. package/dist/tests/connection-manager-integration.test.js +431 -0
  158. package/dist/tests/connection-manager-integration.test.js.map +1 -0
  159. package/dist/tests/connection-manager.test.d.ts +2 -0
  160. package/dist/tests/connection-manager.test.d.ts.map +1 -0
  161. package/dist/tests/connection-manager.test.js +361 -0
  162. package/dist/tests/connection-manager.test.js.map +1 -0
  163. package/dist/tests/dump-import.test.d.ts +15 -0
  164. package/dist/tests/dump-import.test.d.ts.map +1 -0
  165. package/dist/tests/dump-import.test.js +430 -0
  166. package/dist/tests/dump-import.test.js.map +1 -0
  167. package/dist/tests/migration-idempotency.test.d.ts +2 -0
  168. package/dist/tests/migration-idempotency.test.d.ts.map +1 -0
  169. package/dist/tests/migration-idempotency.test.js +330 -0
  170. package/dist/tests/migration-idempotency.test.js.map +1 -0
  171. package/dist/tests/migration-upgrade-paths.test.d.ts +2 -0
  172. package/dist/tests/migration-upgrade-paths.test.d.ts.map +1 -0
  173. package/dist/tests/migration-upgrade-paths.test.js +248 -0
  174. package/dist/tests/migration-upgrade-paths.test.js.map +1 -0
  175. package/dist/tests/migrations/test-all-versions-real.js +3 -0
  176. package/dist/tests/migrations/test-all-versions-real.js.map +1 -1
  177. package/dist/tests/multi-project-migration.test.d.ts +17 -0
  178. package/dist/tests/multi-project-migration.test.d.ts.map +1 -0
  179. package/dist/tests/multi-project-migration.test.js +399 -0
  180. package/dist/tests/multi-project-migration.test.js.map +1 -0
  181. package/dist/tests/multi-project.test.d.ts +5 -0
  182. package/dist/tests/multi-project.test.d.ts.map +1 -0
  183. package/dist/tests/multi-project.test.js +238 -0
  184. package/dist/tests/multi-project.test.js.map +1 -0
  185. package/dist/tests/schema-migration.test.d.ts +8 -0
  186. package/dist/tests/schema-migration.test.d.ts.map +1 -0
  187. package/dist/tests/schema-migration.test.js +108 -0
  188. package/dist/tests/schema-migration.test.js.map +1 -0
  189. package/dist/tests/sql-dump-converters.test.d.ts +7 -0
  190. package/dist/tests/sql-dump-converters.test.d.ts.map +1 -0
  191. package/dist/tests/sql-dump-converters.test.js +314 -0
  192. package/dist/tests/sql-dump-converters.test.js.map +1 -0
  193. package/dist/tests/sql-dump-cross-database.test.d.ts +21 -0
  194. package/dist/tests/sql-dump-cross-database.test.d.ts.map +1 -0
  195. package/dist/tests/sql-dump-cross-database.test.js +314 -0
  196. package/dist/tests/sql-dump-cross-database.test.js.map +1 -0
  197. package/dist/tests/sql-dump-default-conversions.test.d.ts +8 -0
  198. package/dist/tests/sql-dump-default-conversions.test.d.ts.map +1 -0
  199. package/dist/tests/sql-dump-default-conversions.test.js +141 -0
  200. package/dist/tests/sql-dump-default-conversions.test.js.map +1 -0
  201. package/dist/tests/sql-dump-fk-constraints.test.d.ts +13 -0
  202. package/dist/tests/sql-dump-fk-constraints.test.d.ts.map +1 -0
  203. package/dist/tests/sql-dump-fk-constraints.test.js +381 -0
  204. package/dist/tests/sql-dump-fk-constraints.test.js.map +1 -0
  205. package/dist/tests/sql-dump-indexes.test.d.ts +12 -0
  206. package/dist/tests/sql-dump-indexes.test.d.ts.map +1 -0
  207. package/dist/tests/sql-dump-indexes.test.js +269 -0
  208. package/dist/tests/sql-dump-indexes.test.js.map +1 -0
  209. package/dist/tests/sql-dump-integration.test.d.ts +16 -0
  210. package/dist/tests/sql-dump-integration.test.d.ts.map +1 -0
  211. package/dist/tests/sql-dump-integration.test.js +342 -0
  212. package/dist/tests/sql-dump-integration.test.js.map +1 -0
  213. package/dist/tests/sql-dump-table-ordering.test.d.ts +8 -0
  214. package/dist/tests/sql-dump-table-ordering.test.d.ts.map +1 -0
  215. package/dist/tests/sql-dump-table-ordering.test.js +253 -0
  216. package/dist/tests/sql-dump-table-ordering.test.js.map +1 -0
  217. package/dist/tests/tasks.link-file-backward-compat.test.js +11 -1
  218. package/dist/tests/tasks.link-file-backward-compat.test.js.map +1 -1
  219. package/dist/tests/tasks.watch-files-action.test.js +11 -1
  220. package/dist/tests/tasks.watch-files-action.test.js.map +1 -1
  221. package/dist/tests/type-conversion.test.d.ts +8 -0
  222. package/dist/tests/type-conversion.test.d.ts.map +1 -0
  223. package/dist/tests/type-conversion.test.js +312 -0
  224. package/dist/tests/type-conversion.test.js.map +1 -0
  225. package/dist/tests/utils/test-helpers.d.ts +93 -0
  226. package/dist/tests/utils/test-helpers.d.ts.map +1 -0
  227. package/dist/tests/utils/test-helpers.js +407 -0
  228. package/dist/tests/utils/test-helpers.js.map +1 -0
  229. package/dist/tools/config.d.ts +58 -0
  230. package/dist/tools/config.d.ts.map +1 -0
  231. package/dist/tools/config.js +281 -0
  232. package/dist/tools/config.js.map +1 -0
  233. package/dist/tools/constraints.d.ts.map +1 -1
  234. package/dist/tools/constraints.js +138 -122
  235. package/dist/tools/constraints.js.map +1 -1
  236. package/dist/tools/context.d.ts.map +1 -1
  237. package/dist/tools/context.js +216 -109
  238. package/dist/tools/context.js.map +1 -1
  239. package/dist/tools/files.d.ts.map +1 -1
  240. package/dist/tools/files.js +123 -102
  241. package/dist/tools/files.js.map +1 -1
  242. package/dist/tools/tasks.d.ts.map +1 -1
  243. package/dist/tools/tasks.js +593 -518
  244. package/dist/tools/tasks.js.map +1 -1
  245. package/dist/tools/utils.d.ts +5 -0
  246. package/dist/tools/utils.d.ts.map +1 -1
  247. package/dist/tools/utils.js +176 -122
  248. package/dist/tools/utils.js.map +1 -1
  249. package/dist/types.d.ts +9 -26
  250. package/dist/types.d.ts.map +1 -1
  251. package/dist/utils/cleanup.d.ts +3 -0
  252. package/dist/utils/cleanup.d.ts.map +1 -1
  253. package/dist/utils/cleanup.js +14 -2
  254. package/dist/utils/cleanup.js.map +1 -1
  255. package/dist/utils/connection-manager.d.ts +59 -0
  256. package/dist/utils/connection-manager.d.ts.map +1 -0
  257. package/dist/utils/connection-manager.js +178 -0
  258. package/dist/utils/connection-manager.js.map +1 -0
  259. package/dist/utils/debug-logger.d.ts +8 -4
  260. package/dist/utils/debug-logger.d.ts.map +1 -1
  261. package/dist/utils/debug-logger.js +27 -7
  262. package/dist/utils/debug-logger.js.map +1 -1
  263. package/dist/utils/error-handler.d.ts +6 -4
  264. package/dist/utils/error-handler.d.ts.map +1 -1
  265. package/dist/utils/error-handler.js +34 -9
  266. package/dist/utils/error-handler.js.map +1 -1
  267. package/dist/utils/parameter-validator.d.ts.map +1 -1
  268. package/dist/utils/parameter-validator.js +50 -16
  269. package/dist/utils/parameter-validator.js.map +1 -1
  270. package/dist/utils/project-context.d.ts +111 -0
  271. package/dist/utils/project-context.d.ts.map +1 -0
  272. package/dist/utils/project-context.js +187 -0
  273. package/dist/utils/project-context.js.map +1 -0
  274. package/dist/utils/sql-dump-converters.d.ts +188 -0
  275. package/dist/utils/sql-dump-converters.d.ts.map +1 -0
  276. package/dist/utils/sql-dump-converters.js +311 -0
  277. package/dist/utils/sql-dump-converters.js.map +1 -0
  278. package/dist/utils/sql-dump.d.ts +102 -0
  279. package/dist/utils/sql-dump.d.ts.map +1 -0
  280. package/dist/utils/sql-dump.js +1550 -0
  281. package/dist/utils/sql-dump.js.map +1 -0
  282. package/dist/utils/vcs-adapter.d.ts +42 -0
  283. package/dist/utils/vcs-adapter.d.ts.map +1 -1
  284. package/dist/utils/vcs-adapter.js +154 -0
  285. package/dist/utils/vcs-adapter.js.map +1 -1
  286. package/docs/BASEADAPTER_IMPLEMENTATION.md +399 -0
  287. package/docs/DATABASE_AUTH.md +445 -0
  288. package/docs/DATABASE_MIGRATION.md +247 -0
  289. package/docs/MULTI_PROJECT_ARCHITECTURE.md +497 -0
  290. package/package.json +12 -4
  291. package/dist/migrations/knex/bootstrap/20251025020452_create_master_tables.d.ts.map +0 -1
  292. package/dist/migrations/knex/bootstrap/20251025020452_create_master_tables.js.map +0 -1
  293. package/dist/migrations/knex/bootstrap/20251025021152_create_transaction_tables.d.ts.map +0 -1
  294. package/dist/migrations/knex/bootstrap/20251025021152_create_transaction_tables.js.map +0 -1
  295. package/dist/migrations/knex/bootstrap/20251025021351_create_indexes.d.ts.map +0 -1
  296. package/dist/migrations/knex/bootstrap/20251025021351_create_indexes.js.map +0 -1
  297. package/dist/migrations/knex/bootstrap/20251025021416_seed_master_data.d.ts.map +0 -1
  298. package/dist/migrations/knex/bootstrap/20251025021416_seed_master_data.js.map +0 -1
  299. package/dist/migrations/knex/bootstrap/20251025070349_create_views.d.ts.map +0 -1
  300. package/dist/migrations/knex/bootstrap/20251025070349_create_views.js.map +0 -1
  301. package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts.map +0 -1
  302. package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js +0 -15
  303. package/dist/migrations/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.js.map +0 -1
  304. package/dist/migrations/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts.map +0 -1
  305. package/dist/migrations/knex/enhancements/20251025082220_fix_task_dependencies_columns.js.map +0 -1
  306. package/dist/migrations/knex/enhancements/20251025090000_create_help_system_tables.d.ts.map +0 -1
  307. package/dist/migrations/knex/enhancements/20251025090000_create_help_system_tables.js.map +0 -1
  308. package/dist/migrations/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts.map +0 -1
  309. package/dist/migrations/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.js.map +0 -1
  310. package/dist/migrations/knex/enhancements/20251025100000_seed_help_metadata.d.ts.map +0 -1
  311. package/dist/migrations/knex/enhancements/20251025100000_seed_help_metadata.js.map +0 -1
  312. package/dist/migrations/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts.map +0 -1
  313. package/dist/migrations/knex/enhancements/20251025100100_seed_remaining_use_cases.js.map +0 -1
  314. package/dist/migrations/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts.map +0 -1
  315. package/dist/migrations/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.js.map +0 -1
  316. package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts.map +0 -1
  317. package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.js +0 -34
  318. package/dist/migrations/knex/enhancements/20251027000000_add_agent_reuse_system.js.map +0 -1
  319. package/dist/migrations/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts.map +0 -1
  320. package/dist/migrations/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js.map +0 -1
  321. package/dist/migrations/knex/enhancements/20251027020000_update_agent_reusability.d.ts.map +0 -1
  322. package/dist/migrations/knex/enhancements/20251027020000_update_agent_reusability.js.map +0 -1
  323. package/dist/migrations/knex/enhancements/20251028000000_simplify_agent_system.d.ts.map +0 -1
  324. package/dist/migrations/knex/enhancements/20251028000000_simplify_agent_system.js.map +0 -1
  325. package/dist/migrations/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts.map +0 -1
  326. package/dist/migrations/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js.map +0 -1
  327. package/dist/migrations/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts.map +0 -1
  328. package/dist/migrations/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js.map +0 -1
  329. package/dist/migrations/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts.map +0 -1
  330. package/dist/migrations/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js.map +0 -1
  331. package/dist/migrations/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts.map +0 -1
  332. package/dist/migrations/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js.map +0 -1
  333. package/dist/migrations/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts.map +0 -1
  334. package/dist/migrations/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js.map +0 -1
  335. package/dist/migrations/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts.map +0 -1
  336. package/dist/migrations/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js.map +0 -1
  337. package/dist/migrations/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts.map +0 -1
  338. package/dist/migrations/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js.map +0 -1
  339. /package/dist/{migrations → config}/knex/bootstrap/20251025020452_create_master_tables.d.ts +0 -0
  340. /package/dist/{migrations → config}/knex/bootstrap/20251025021152_create_transaction_tables.d.ts +0 -0
  341. /package/dist/{migrations → config}/knex/bootstrap/20251025021351_create_indexes.d.ts +0 -0
  342. /package/dist/{migrations → config}/knex/bootstrap/20251025021351_create_indexes.js +0 -0
  343. /package/dist/{migrations → config}/knex/bootstrap/20251025021416_seed_master_data.d.ts +0 -0
  344. /package/dist/{migrations → config}/knex/bootstrap/20251025070349_create_views.d.ts +0 -0
  345. /package/dist/{migrations → config}/knex/enhancements/20251025081221_add_link_type_to_task_decision_links.d.ts +0 -0
  346. /package/dist/{migrations → config}/knex/enhancements/20251025082220_fix_task_dependencies_columns.d.ts +0 -0
  347. /package/dist/{migrations → config}/knex/enhancements/20251025082220_fix_task_dependencies_columns.js +0 -0
  348. /package/dist/{migrations → config}/knex/enhancements/20251025090000_create_help_system_tables.d.ts +0 -0
  349. /package/dist/{migrations → config}/knex/enhancements/20251025090100_seed_help_categories_and_use_cases.d.ts +0 -0
  350. /package/dist/{migrations → config}/knex/enhancements/20251025100000_seed_help_metadata.d.ts +0 -0
  351. /package/dist/{migrations → config}/knex/enhancements/20251025100100_seed_remaining_use_cases.d.ts +0 -0
  352. /package/dist/{migrations → config}/knex/enhancements/20251025100100_seed_remaining_use_cases.js +0 -0
  353. /package/dist/{migrations → config}/knex/enhancements/20251025120000_add_cascade_to_task_dependencies.d.ts +0 -0
  354. /package/dist/{migrations → config}/knex/enhancements/20251027000000_add_agent_reuse_system.d.ts +0 -0
  355. /package/dist/{migrations → config}/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.d.ts +0 -0
  356. /package/dist/{migrations → config}/knex/enhancements/20251027010000_add_task_constraint_to_decision_context.js +0 -0
  357. /package/dist/{migrations → config}/knex/enhancements/20251027020000_update_agent_reusability.d.ts +0 -0
  358. /package/dist/{migrations → config}/knex/enhancements/20251028000000_simplify_agent_system.d.ts +0 -0
  359. /package/dist/{migrations → config}/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.d.ts +0 -0
  360. /package/dist/{migrations → config}/knex/upgrades/20251024010000_upgrade_v1_0_to_v1_1.js +0 -0
  361. /package/dist/{migrations → config}/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.d.ts +0 -0
  362. /package/dist/{migrations → config}/knex/upgrades/20251024020000_upgrade_v2_0_to_v2_1.js +0 -0
  363. /package/dist/{migrations → config}/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.d.ts +0 -0
  364. /package/dist/{migrations → config}/knex/upgrades/20251024030000_upgrade_v2_1_to_v3_0.js +0 -0
  365. /package/dist/{migrations → config}/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.d.ts +0 -0
  366. /package/dist/{migrations → config}/knex/upgrades/20251024040000_upgrade_v3_0_to_v3_2.js +0 -0
  367. /package/dist/{migrations → config}/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.d.ts +0 -0
  368. /package/dist/{migrations → config}/knex/upgrades/20251024050000_upgrade_v3_2_0_to_v3_2_2.js +0 -0
  369. /package/dist/{migrations → config}/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.d.ts +0 -0
  370. /package/dist/{migrations → config}/knex/upgrades/20251024060000_upgrade_v3_4_to_v3_5.js +0 -0
  371. /package/dist/{migrations → config}/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.d.ts +0 -0
  372. /package/dist/{migrations → config}/knex/upgrades/20251024070000_upgrade_v3_5_to_v3_6.js +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,194 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [3.7.1] - 2025-11-05
11
+
12
+ ### Fixed - Error Message Visibility
13
+
14
+ **Fixed validation error messages being hidden by error wrapper**
15
+
16
+ #### Problem
17
+ - Validation errors (JSON-structured responses) were being wrapped with stack traces
18
+ - Wrong-usage messages were hidden from MCP clients
19
+ - Users received generic error messages instead of helpful validation details
20
+
21
+ #### Solution
22
+ - **Error Handler Enhancement** - Detect and unwrap JSON validation errors
23
+ - Validation errors now returned directly to MCP client without wrapping
24
+ - Stack traces written to logs only (not returned to client)
25
+ - Token-efficient responses without exposing internal stack details
26
+ - **Parameter Validator Enhancement** - Detect unexpected/invalid parameters
27
+ - Added validation for parameters that don't match valid list and have no typo suggestion
28
+ - Improved error messages: "Unexpected params: X. Valid params: Y, Z"
29
+
30
+ #### Impact
31
+ - ✅ **Better UX** - Validation errors are now visible and actionable
32
+ - ✅ **Token efficiency** - No stack traces in MCP responses
33
+ - ✅ **Clearer feedback** - Users see helpful error messages immediately
34
+ - ✅ **Security** - Internal stack details not exposed to clients
35
+
36
+ ---
37
+
38
+ ## [3.7.0] - 2025-11-05
39
+
40
+ ### Added - Runtime Database Reconnection
41
+
42
+ **Automatic connection recovery with exponential backoff retry logic**
43
+
44
+ #### Features
45
+ - **ConnectionManager** - Singleton wrapper for all database operations
46
+ - **Exponential Backoff** - Retry delays: 1s → 2s → 4s → 8s → 16s (31 seconds total)
47
+ - **Smart Error Detection** - Recognizes connection errors across SQLite, MySQL, PostgreSQL
48
+ - **Process.exit on Exhaustion** - Exits cleanly after 5 failed retries
49
+ - **27 Operations Wrapped** - All transactional operations protected:
50
+ - context.ts: 5 operations
51
+ - tasks.ts: 9 operations
52
+ - files.ts: 3 operations
53
+ - constraints.ts: 3 operations
54
+ - config.ts: 2 operations
55
+ - utils.ts: 5 operations
56
+
57
+ #### Connection Error Patterns Detected
58
+ - **Network Errors**: ECONNREFUSED, ENOTFOUND, ETIMEDOUT, ECONNRESET, EPIPE
59
+ - **SQLite**: "database is locked", "unable to open database"
60
+ - **MySQL/MariaDB**: "server has gone away", "lost connection to mysql server"
61
+ - **PostgreSQL**: "connection to server was lost", "could not connect to server"
62
+ - **Knex-specific**: "timeout acquiring a connection", "pool is destroyed"
63
+
64
+ #### Test Coverage
65
+ - **41 tests passing** (22 unit + 19 integration)
66
+ - Retry behavior verification
67
+ - Production scenario simulation (server restart, network failures)
68
+ - Tool integration testing
69
+
70
+ #### Impact
71
+ - ✅ **Resilient operations** - Automatic recovery from transient connection failures
72
+ - ✅ **Production ready** - Handles server restarts, network issues
73
+ - ✅ **Zero regressions** - All existing tests pass
74
+ - ✅ **Token efficient** - No manual retry logic needed in agent code
75
+
76
+ ---
77
+
78
+ ### Changed - Validation Error Messages
79
+
80
+ **70-85% token reduction in error message size**
81
+
82
+ #### Token Efficiency
83
+ - **Before**: ~1000+ characters (~300+ tokens) with full examples embedded
84
+ - **After**: ~200 characters (~50 tokens) with reference IDs
85
+ - **Reduction**: 70-85% token savings
86
+
87
+ #### New Error Format
88
+ ```json
89
+ {
90
+ "error": "Missing: key, value",
91
+ "action": "set",
92
+ "reference": "decision.set",
93
+ "missing": ["key", "value"],
94
+ "hint": "Use 'quick_set' for simpler usage..."
95
+ }
96
+ ```
97
+
98
+ #### Features
99
+ - **Reference IDs** - Compact `{tool}.{action}` format (e.g., "decision.set")
100
+ - **Concise Messages** - Essential information only
101
+ - **Conditional Fields** - Only include fields when present
102
+ - **Self-Documenting** - AI can query `action: "help"` for full docs if needed
103
+
104
+ #### Error Types
105
+ - Missing params: `"Missing: key, value"`
106
+ - Typos: `"Invalid params: val → value"`
107
+ - Unknown action: `"Unknown action 'sett'. Did you mean: set?"`
108
+
109
+ #### Impact
110
+ - ✅ **Token efficiency** - 70-85% reduction in error size
111
+ - ✅ **Cost reduction** - Lower API costs for AI agents
112
+ - ✅ **Better UX** - Quick, scannable errors
113
+ - ✅ **Backward compatible** - Error structure unchanged
114
+
115
+ ---
116
+
117
+ ### Changed - Debug Log Format
118
+
119
+ **Single-line log entries for easier parsing**
120
+
121
+ #### Problem
122
+ Multi-line log messages broke standard text processing tools (grep, awk, log rotation).
123
+
124
+ #### Solution
125
+ - **Sanitization Function** - Replaces newlines with spaces, collapses whitespace
126
+ - **Applied To**: All log messages, data values, JSON output
127
+ - **Result**: Every log entry is exactly one line
128
+
129
+ #### Benefits
130
+ - ✅ **Easier parsing** - Line-based tools work correctly
131
+ - ✅ **Better grep** - Search across entire messages
132
+ - ✅ **Simpler analysis** - Standard text processing
133
+ - ✅ **Cleaner output** - No unexpected line breaks
134
+
135
+ #### Example
136
+ **Before:**
137
+ ```
138
+ [2025-11-05T02:00:00.000Z] [ERROR] Error details:
139
+ Stack trace line 1
140
+ Stack trace line 2
141
+ ```
142
+
143
+ **After:**
144
+ ```
145
+ [2025-11-05T02:00:00.000Z] [ERROR] Error details: Stack trace line 1 Stack trace line 2
146
+ ```
147
+
148
+ ---
149
+
150
+ ### Fixed - Multi-Project Migration (Critical)
151
+
152
+ **Fixed migration for ALL users upgrading from v3.6.10 to v3.7.0**
153
+
154
+ #### Problem
155
+ - SQLite's `ALTER TABLE` silently failed for 4 tables with complex foreign keys
156
+ - Migration reported success but columns weren't added
157
+ - Task creation would fail: `"table t_task_details has no column named project_id"`
158
+
159
+ #### Root Cause
160
+ SQLite cannot modify tables with `ON DELETE CASCADE` constraints using ALTER TABLE.
161
+
162
+ #### Solution
163
+ - **Table Recreation Strategy** - Backup → Drop → Recreate → Restore
164
+ - **4 Tables Fixed**:
165
+ - `t_task_details` (STEP 4.7)
166
+ - `t_task_file_links` (STEP 4.8)
167
+ - `t_task_decision_links` (STEP 4.9)
168
+ - `t_task_tags` (composite PRIMARY KEY)
169
+
170
+ #### Idempotency
171
+ All recreation steps check if `project_id` exists before executing:
172
+ ```typescript
173
+ const hasProjectId = await knex.schema.hasColumn('table_name', 'project_id');
174
+ if (!hasProjectId) {
175
+ // Recreation logic
176
+ }
177
+ ```
178
+
179
+ #### Data Preservation Verified
180
+ - ✅ 223 task detail rows preserved
181
+ - ✅ 632 task tag rows preserved
182
+ - ✅ All task links preserved
183
+ - ✅ 100% data integrity maintained
184
+
185
+ #### Testing
186
+ - ✅ Fresh installation works
187
+ - ✅ v3.6.10 → v3.7.0 upgrade works
188
+ - ✅ Migration can be re-run safely (idempotent)
189
+ - ✅ TypeScript compiles without errors
190
+
191
+ #### Impact
192
+ - ✅ **Production ready** - Safe for all v3.6.10 users to upgrade
193
+ - ✅ **No data loss** - All existing data preserved
194
+ - ✅ **Idempotent** - Can re-run without errors
195
+
196
+ ---
197
+
10
198
  ## [3.6.10] - 2025-10-30
11
199
 
12
200
  ### Added - Environment Variable Support for Project Root
@@ -88,6 +276,164 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
276
 
89
277
  ---
90
278
 
279
+ ### Added - Environment Variable Support for Project Root
280
+
281
+ **New `SQLEW_PROJECT_ROOT` environment variable for project-relative databases**
282
+
283
+ #### Problem
284
+ - Junie AI and other MCP clients require absolute paths in configuration
285
+ - Users had to hardcode project-specific paths in MCP server config
286
+ - No easy way to use project-relative database paths
287
+
288
+ #### Solution
289
+ - Added `SQLEW_PROJECT_ROOT` environment variable support (inspired by serena-mcp pattern)
290
+ - MCP clients can now pass project directory via environment variable
291
+ - Database automatically created at `$SQLEW_PROJECT_ROOT/.sqlew/sqlew.db`
292
+
293
+ #### Priority Order
294
+ 1. `SQLEW_PROJECT_ROOT` environment variable (NEW - highest priority)
295
+ 2. `--db-path` CLI argument (absolute path)
296
+ 3. `--config-path` CLI argument (absolute path)
297
+ 4. `database.path` in config file (absolute path)
298
+ 5. `process.cwd()` fallback
299
+
300
+ #### Junie AI Configuration Example
301
+ ```json
302
+ {
303
+ "mcpServers": {
304
+ "sqlew": {
305
+ "command": "npx",
306
+ "args": ["sqlew"],
307
+ "env": {
308
+ "SQLEW_PROJECT_ROOT": "{projectDir}"
309
+ }
310
+ }
311
+ }
312
+ }
313
+ ```
314
+
315
+ **Note:** Junie AI uses `{projectDir}` variable which expands to the current project's absolute path. This ensures each project gets its own isolated database without hardcoded paths. Other MCP clients may use different variable names like `${workspaceFolder}` (VS Code/Cline) - check your client's documentation.
316
+
317
+ #### Impact
318
+ - ✅ **Project-relative databases** without hardcoded absolute paths
319
+ - ✅ **Cleaner MCP configuration** (no per-project path updates needed)
320
+ - ✅ **Compatible with Junie AI, Claude Desktop, and other MCP clients**
321
+ - ✅ **No breaking changes** (environment variable is optional)
322
+
323
+ ---
324
+
325
+ ### Fixed - MCP Protocol Compliance (EPIPE Fix)
326
+
327
+ **Eliminated console output for strict JSON-RPC protocol compliance**
328
+
329
+ #### Problem
330
+ - EPIPE (broken pipe) errors when running with Junie AI on Windows
331
+ - Console output to stdout/stderr violated MCP JSON-RPC protocol requirements
332
+ - Strict MCP clients (like Junie AI) expect pure JSON-RPC on stdio streams
333
+
334
+ #### Changes
335
+ - **Redirected all diagnostic output to debug log file** - stdout/stderr reserved exclusively for JSON-RPC
336
+ - Modified `safeConsoleError()` to write to debug log instead of stderr
337
+ - Replaced 50+ console.log/console.error calls across codebase:
338
+ - `src/database.ts` - Database initialization messages
339
+ - `src/watcher/file-watcher.ts` - File watcher status and events
340
+ - `src/watcher/gitignore-parser.ts` - .gitignore loading warnings
341
+ - `src/tools/tasks.ts` - Task file registration warnings
342
+ - `src/config/example-generator.ts` - First launch messages
343
+
344
+ #### Technical Details
345
+ - **MCP Protocol Requirement**: stdin/stdout/stderr must carry only JSON-RPC messages
346
+ - **Debug Logging**: All diagnostic messages now use `debugLog()` with appropriate levels (INFO, WARN, ERROR)
347
+ - **Zero stdout pollution**: Server starts silently, waits for JSON-RPC requests
348
+ - **Tested with Junie AI**: Confirmed no EPIPE errors on Windows
349
+
350
+ #### Impact
351
+ - ✅ **Works with strict MCP clients** (Junie AI, etc.)
352
+ - ✅ **Maintains full diagnostics** via debug log file
353
+ - ✅ **Pure JSON-RPC protocol** compliance
354
+ - ✅ **No breaking changes** to MCP tool functionality
355
+
356
+ ---
357
+
358
+ ### Added - Environment Variable Support for Project Root
359
+
360
+ **New `SQLEW_PROJECT_ROOT` environment variable for project-relative databases**
361
+
362
+ #### Problem
363
+ - Junie AI and other MCP clients require absolute paths in configuration
364
+ - Users had to hardcode project-specific paths in MCP server config
365
+ - No easy way to use project-relative database paths
366
+
367
+ #### Solution
368
+ - Added `SQLEW_PROJECT_ROOT` environment variable support (inspired by serena-mcp pattern)
369
+ - MCP clients can now pass project directory via environment variable
370
+ - Database automatically created at `$SQLEW_PROJECT_ROOT/.sqlew/sqlew.db`
371
+
372
+ #### Priority Order
373
+ 1. `SQLEW_PROJECT_ROOT` environment variable (NEW - highest priority)
374
+ 2. `--db-path` CLI argument (absolute path)
375
+ 3. `--config-path` CLI argument (absolute path)
376
+ 4. `database.path` in config file (absolute path)
377
+ 5. `process.cwd()` fallback
378
+
379
+ #### Junie AI Configuration Example
380
+ ```json
381
+ {
382
+ "mcpServers": {
383
+ "sqlew": {
384
+ "command": "npx",
385
+ "args": ["sqlew"],
386
+ "env": {
387
+ "SQLEW_PROJECT_ROOT": "{projectDir}"
388
+ }
389
+ }
390
+ }
391
+ }
392
+ ```
393
+
394
+ **Note:** Junie AI uses `{projectDir}` variable which expands to the current project's absolute path. This ensures each project gets its own isolated database without hardcoded paths. Other MCP clients may use different variable names like `${workspaceFolder}` (VS Code/Cline) - check your client's documentation.
395
+
396
+ #### Impact
397
+ - ✅ **Project-relative databases** without hardcoded absolute paths
398
+ - ✅ **Cleaner MCP configuration** (no per-project path updates needed)
399
+ - ✅ **Compatible with Junie AI, Claude Desktop, and other MCP clients**
400
+ - ✅ **No breaking changes** (environment variable is optional)
401
+
402
+ ---
403
+
404
+ ### Fixed - MCP Protocol Compliance (EPIPE Fix)
405
+
406
+ **Eliminated console output for strict JSON-RPC protocol compliance**
407
+
408
+ #### Problem
409
+ - EPIPE (broken pipe) errors when running with Junie AI on Windows
410
+ - Console output to stdout/stderr violated MCP JSON-RPC protocol requirements
411
+ - Strict MCP clients (like Junie AI) expect pure JSON-RPC on stdio streams
412
+
413
+ #### Changes
414
+ - **Redirected all diagnostic output to debug log file** - stdout/stderr reserved exclusively for JSON-RPC
415
+ - Modified `safeConsoleError()` to write to debug log instead of stderr
416
+ - Replaced 50+ console.log/console.error calls across codebase:
417
+ - `src/database.ts` - Database initialization messages
418
+ - `src/watcher/file-watcher.ts` - File watcher status and events
419
+ - `src/watcher/gitignore-parser.ts` - .gitignore loading warnings
420
+ - `src/tools/tasks.ts` - Task file registration warnings
421
+ - `src/config/example-generator.ts` - First launch messages
422
+
423
+ #### Technical Details
424
+ - **MCP Protocol Requirement**: stdin/stdout/stderr must carry only JSON-RPC messages
425
+ - **Debug Logging**: All diagnostic messages now use `debugLog()` with appropriate levels (INFO, WARN, ERROR)
426
+ - **Zero stdout pollution**: Server starts silently, waits for JSON-RPC requests
427
+ - **Tested with Junie AI**: Confirmed no EPIPE errors on Windows
428
+
429
+ #### Impact
430
+ - ✅ **Works with strict MCP clients** (Junie AI, etc.)
431
+ - ✅ **Maintains full diagnostics** via debug log file
432
+ - ✅ **Pure JSON-RPC protocol** compliance
433
+ - ✅ **No breaking changes** to MCP tool functionality
434
+
435
+ ---
436
+
91
437
  ### Fixed - Windows Absolute Path Handling
92
438
 
93
439
  **Fixed path normalization for Windows environments**
package/README.md CHANGED
@@ -10,25 +10,39 @@
10
10
 
11
11
  **sqlew** is a Model Context Protocol (MCP) server that gives AI agents organizational memory across sessions.
12
12
 
13
- **The Problem:** Without sqlew, every Claude session starts with zero context. You must re-explain decisions, agents can reintroduce bugs, and there's no way to track WHY decisions were made.
13
+ ### The Problem
14
+ Without sqlew, every Claude session starts with zero context. You must re-explain decisions, agents can reintroduce bugs, and there's no way to track WHY decisions were made.
14
15
 
15
- **The Solution:** sqlew lets agents remember decisions, query past context, prevent regressions with constraints, and coordinate via messaging and tasks.
16
+ It has been possible to keep records using Markdown files. However, large-scale projects or long-term maintenance records tend to generate massive amounts of documentation. This has become a problem, as it causes context rot in AI systems, leading to declining performance.
16
17
 
17
- **Example:** Session 1 records "API v1 deprecated". Session 2 (days later) queries and automatically uses v2.
18
+ ### The Solution
19
+ sqlew builds efficient external memory for AI by using relational databases.
20
+ - Records the reasoning behind decisions
21
+ - Enables querying past context
22
+ - Prevents anti-patterns through constraints
23
+ - Eliminates duplicate work via task management
24
+
25
+ **Example:**
26
+ - Session 1 records "API v1 deprecated".
27
+ - Session 2 (days later) queries and automatically uses v2.
28
+
29
+ > *This software does not send any data to external networks. We NEVER collect any data or usage statistics. Please use it with complete security.*
18
30
 
19
31
  ## Why Use sqlew?
20
32
 
21
33
  ### 🧠 Organizational Memory
22
- Traditional code tells you **WHAT** and **HOW**. sqlew adds **WHY**:
34
+ Traditional code analysis like git tells you **WHAT** is done, sqlew adds **WHY** and **HOW** on it:
23
35
  - **Decisions** → WHY it was changed
24
- - **Constraints** → WHY it must work this way
36
+ - **Constraints** → HOW should it be written
37
+ - **Tasks** → WHAT needs to be done
25
38
 
26
39
  ### ⚡ Token Efficiency
27
40
  **60-75% token reduction** in multi-session projects through structured data storage and selective querying.
28
41
 
29
42
  ### 🎯 Key Features
30
- - **5 Specialized Tools**: decisions, tasks, files, constraints, stats (config tool removed in dev)
31
- - **Parameter Validation**: Typo detection, required/optional markers, helpful error messages (NEW in dev)
43
+ - **5 Specialized Tools**: decisions, tasks, files, constraints, stats
44
+ - **Runtime Reconnection**: Automatic database connection recovery with exponential backoff
45
+ - **Parameter Validation**: Typo detection, required/optional markers, 70-85% more concise error messages
32
46
  - **Metadata-Driven**: Tag, layer, scope, and version everything
33
47
  - **Decision Context**: Document WHY with rationale, alternatives, and trade-offs
34
48
  - **Task Dependencies**: Blocking relationships with circular detection
@@ -41,7 +55,7 @@ Traditional code tells you **WHAT** and **HOW**. sqlew adds **WHY**:
41
55
  See [docs/TASK_OVERVIEW.md](docs/TASK_OVERVIEW.md) and [docs/DECISION_CONTEXT.md](docs/DECISION_CONTEXT.md) for details.
42
56
 
43
57
  ### 🔖Kanban-style AI Scrum
44
- ![kanban-style task management](assets/kanban-style.png)
58
+ ![kanban-style task management](assets/kanban-visualizer.png)
45
59
 
46
60
  ## Installation
47
61
 
@@ -51,21 +65,7 @@ See [docs/TASK_OVERVIEW.md](docs/TASK_OVERVIEW.md) and [docs/DECISION_CONTEXT.md
51
65
 
52
66
  ### Quick Install
53
67
 
54
- **Recommended (npx):**
55
- ```bash
56
- npx sqlew
57
- ```
58
-
59
- **Or install per project:**
60
- ```bash
61
- npm install sqlew
62
- ```
63
-
64
- **Note**: Global install (`npm install -g`) is **not recommended** because sqlew requires an independent database per project. Each project should maintain its own context database in `.sqlew/sqlew.db`.
65
-
66
- ### Add to Claude Desktop
67
-
68
- Edit `claude_desktop_config.json`:
68
+ on `.mcp.json` in your project's root, add these lines:
69
69
 
70
70
  ```json
71
71
  {
@@ -77,8 +77,13 @@ Edit `claude_desktop_config.json`:
77
77
  }
78
78
  }
79
79
  ```
80
+ **Recommend to restart claude after initialize**
81
+
82
+ The first time, sqlew install custom agents and initialize database. Custom agents are not loaded in this time. Please exit claude once, and restart claude again.
83
+
84
+ It's Ready!
80
85
 
81
- Restart Claude Desktop. Done!
86
+ **⚠️Note**: Global install (`npm install -g`) is **not recommended** because sqlew requires an independent settings per project. Each project should maintain its own context database in `.sqlew/sqlew.db`.
82
87
 
83
88
  **Custom database path:** Add path as argument: `"args": ["sqlew", "/path/to/db.db"]`
84
89
  **Default location:** `.sqlew/sqlew.db`
@@ -91,7 +96,7 @@ Restart Claude Desktop. Done!
91
96
 
92
97
  ### Optional Config File
93
98
 
94
- Create `.sqlew/config.toml` for persistent settings:
99
+ On first run, `.sqlew/config.toml` will be created for persistent settings:
95
100
 
96
101
  ```toml
97
102
  [database]
@@ -102,25 +107,31 @@ ignore_weekend = true
102
107
  message_hours = 48
103
108
  ```
104
109
 
105
- **Priority:** CLI args > config.toml > database defaults
110
+ Also `.sqlew/config.example.toml` is created for reference.
111
+
112
+ **Settings Priority:** CLI args > config.toml > database defaults
106
113
 
107
114
  See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for all options and validation rules.
108
115
 
109
116
  ## Quick Start
110
117
 
118
+ install it, launch claude, exit claude and launch Claude again.
119
+
111
120
  ### Basic Usage
112
121
 
113
- All tools require an `action` parameter. Example:
122
+ You'll never need to call it manually, I recommend to call this tool via prompt.
123
+
124
+ ```
125
+ read sqlew usecases, and plan implementation of feature X using sqlew.
126
+ ```
114
127
 
115
- ```javascript
116
- // Store a decision
117
- {action: "set", key: "auth_method", value: "JWT", layer: "business", tags: ["security"]}
128
+ or invoke Specialized Agent
118
129
 
119
- // Query later
120
- {action: "get", key: "auth_method"}
130
+ ```
131
+ plan implementation of feature X with @agent-scrum-master.
121
132
  ```
122
133
 
123
- For detailed examples, see [docs/TOOL_REFERENCE.md](docs/TOOL_REFERENCE.md).
134
+ Specialized Agents use sqlew more efficiently.
124
135
 
125
136
  ## Specialized Agents
126
137
 
@@ -132,7 +143,7 @@ sqlew provides three specialized agents for efficient multi-agent coordination i
132
143
  | **Researcher** | Query decisions, analyze patterns, investigate context | 14KB/conversation | Understanding past decisions, onboarding new members, sprint retrospectives |
133
144
  | **Architect** | Document decisions, enforce constraints, maintain standards | 20KB/conversation | Making architectural choices, establishing rules, validating compliance |
134
145
 
135
- ### Installation
146
+ ### Detailed Installation
136
147
 
137
148
  **By default, all three specialized agents are automatically installed** to your project's `.claude/agents/` directory on first run.
138
149
 
@@ -160,22 +171,25 @@ Savings: Scrum + Architect = 32KB (30%) | Scrum only = 12KB (74%)
160
171
 
161
172
  | Tool | Purpose | Example Use |
162
173
  |------|---------|------------|
163
- | **decision** | Record choices | "We chose PostgreSQL" |
174
+ | **decision** | Record choices and reasons | "We chose PostgreSQL" |
175
+ | **constraint** | Define rules | "DO NOT use raw SQL, use ORM" |
164
176
  | **task** | Track work | "Implement feature X" |
165
177
  | **file** | Track changes | "Modified auth.ts" |
166
- | **constraint** | Define rules | "API must be <100ms" |
167
178
  | **stats** | Database metrics | Get layer summary |
168
- | **config** | Retention settings | Auto-cleanup config |
169
179
 
170
- Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
171
180
 
172
181
  ## Documentation
173
182
 
183
+ Each tool supports `action: "help"` for full documentation and `action: "example"` for comprehensive usage examples.
184
+
185
+ And `action: "use_case"` shows how to use the tool in a real-world scenario.
186
+
174
187
  ### On-Demand Documentation
175
188
 
176
189
  All tools support:
177
190
  - `action: "help"` - Parameter reference and descriptions
178
191
  - `action: "example"` - Usage scenarios and examples
192
+ - `action: "use_case"` - Real-world usage examples
179
193
 
180
194
  ### For AI Agents
181
195
 
@@ -205,6 +219,7 @@ All tools support:
205
219
  ### For Developers
206
220
 
207
221
  - [Configuration Guide](docs/CONFIGURATION.md) - TOML config file setup
222
+ - [Database Migration](docs/DATABASE_MIGRATION.md) - SQLite → MySQL/PostgreSQL migration
208
223
  - [Building from Source](docs/ARCHITECTURE.md#development) - Setup instructions
209
224
  - [Migration Guides](docs/MIGRATION_v2.md) - Version upgrade guides
210
225
 
@@ -230,7 +245,7 @@ Support development via [GitHub Sponsors](https://github.com/sponsors/sin5ddd) -
230
245
 
231
246
  ## Version
232
247
 
233
- Current version: **3.6.6**
248
+ Current version: **3.7.0**
234
249
  See [CHANGELOG.md](CHANGELOG.md) for release history.
235
250
 
236
251
  ## License
@@ -8,11 +8,51 @@
8
8
  # Database Settings
9
9
  # ============================================================================
10
10
  [database]
11
+ # SQLite Configuration (default, local development)
11
12
  # Database file path (relative to project root or absolute)
12
13
  # Default: ".sqlew/sqlew.db"
13
14
  # path = ".sqlew/custom.db"
14
15
  # path = "/absolute/path/to/database.db"
15
16
 
17
+ # PostgreSQL/MySQL/MariaDB Configuration (multi-agent production)
18
+ # Uncomment and configure for remote database access
19
+ # type = "postgres" # or "mysql" (also works with MariaDB 10.5+)
20
+
21
+ # Connection settings (required for postgres/mysql/mariadb)
22
+ # IMPORTANT: Database must already exist! User does NOT need CREATE DATABASE privilege.
23
+ # [database.connection]
24
+ # host = "localhost"
25
+ # port = 5432 # PostgreSQL: 5432, MySQL/MariaDB: 3306
26
+ # database = "sqlew" # Must be created beforehand!
27
+
28
+ # Authentication settings (required for postgres/mysql/mariadb)
29
+ # Required user privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, INDEX, DROP, REFERENCES
30
+ # [database.auth]
31
+ # type = "direct" # Options: "direct", "ssh", "aws-iam", "gcp-iam"
32
+ # user = "postgres" # or mysql_user, etc.
33
+ # password = "your-password"
34
+
35
+ # SSL/TLS Configuration (optional, for encrypted connections)
36
+ # [database.auth.ssl]
37
+ # ca = "/path/to/ca-cert.pem" # or inline certificate content
38
+ # cert = "/path/to/client-cert.pem" # for mutual TLS
39
+ # key = "/path/to/client-key.pem" # for mutual TLS
40
+ # rejectUnauthorized = true # set to false for self-signed certs (not recommended for production)
41
+
42
+ # SSH Tunnel Configuration (when type = "ssh")
43
+ # Used for bastion host / jump server access
44
+ # [database.auth.ssh]
45
+ # host = "bastion.example.com"
46
+ # port = 22
47
+ # username = "deploy"
48
+ # privateKeyPath = "/home/user/.ssh/id_rsa" # or use password
49
+ # password = "ssh-password" # alternative to privateKeyPath
50
+ # passphrase = "key-passphrase" # if private key is encrypted
51
+ # timeout = 30000 # SSH connection timeout in ms
52
+ # keepalive = true
53
+ # keepaliveInterval = 10000
54
+ # localPort = 50000 # auto-allocated from 50000-60000 if not specified
55
+
16
56
  # ============================================================================
17
57
  # Auto-Deletion Settings
18
58
  # ============================================================================
@@ -154,6 +194,59 @@ architect = true
154
194
  # Example Configurations
155
195
  # ============================================================================
156
196
 
197
+ # Example 1: PostgreSQL with Direct Authentication + SSL
198
+ # [database]
199
+ # type = "postgres"
200
+ # [database.connection]
201
+ # host = "db.example.com"
202
+ # port = 5432
203
+ # database = "sqlew_production"
204
+ # [database.auth]
205
+ # type = "direct"
206
+ # user = "postgres"
207
+ # password = "secure-password"
208
+ # [database.auth.ssl]
209
+ # ca = "/path/to/ca-cert.pem"
210
+ # rejectUnauthorized = true
211
+
212
+ # Example 2: PostgreSQL through SSH Tunnel
213
+ # [database]
214
+ # type = "postgres"
215
+ # [database.connection]
216
+ # host = "db.internal.example.com"
217
+ # port = 5432
218
+ # database = "sqlew_production"
219
+ # [database.auth]
220
+ # type = "ssh"
221
+ # user = "postgres"
222
+ # password = "db-password"
223
+ # [database.auth.ssh]
224
+ # host = "bastion.example.com"
225
+ # username = "deploy"
226
+ # privateKeyPath = "/home/user/.ssh/id_rsa"
227
+
228
+ # Example 3: MySQL with SSL and SSH
229
+ # [database]
230
+ # type = "mysql"
231
+ # [database.connection]
232
+ # host = "mysql.internal.example.com"
233
+ # port = 3306
234
+ # database = "sqlew_db"
235
+ # [database.auth]
236
+ # type = "ssh"
237
+ # user = "mysql_user"
238
+ # password = "db-password"
239
+ # [database.auth.ssl]
240
+ # ca = "-----BEGIN CERTIFICATE-----\nMIIE...\n-----END CERTIFICATE-----"
241
+ # rejectUnauthorized = true
242
+ # [database.auth.ssh]
243
+ # host = "jump.example.com"
244
+ # port = 22
245
+ # username = "deploy"
246
+ # privateKeyPath = "/home/user/.ssh/deploy_key"
247
+ # passphrase = "key-passphrase"
248
+ # localPort = 53306
249
+
157
250
  # Aggressive cleanup (development)
158
251
  # [autodelete]
159
252
  # message_hours = 1
Binary file