sqlew 5.0.8 → 5.2.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 (499) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +19 -10
  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/on-exit-plan.d.ts.map +1 -1
  49. package/dist/cli/hooks/on-exit-plan.js +42 -1
  50. package/dist/cli/hooks/on-exit-plan.js.map +1 -1
  51. package/dist/cli/hooks/on-prompt.d.ts.map +1 -1
  52. package/dist/cli/hooks/on-prompt.js +5 -0
  53. package/dist/cli/hooks/on-prompt.js.map +1 -1
  54. package/dist/cli/hooks/plan-processor.d.ts.map +1 -1
  55. package/dist/cli/hooks/plan-processor.js +16 -2
  56. package/dist/cli/hooks/plan-processor.js.map +1 -1
  57. package/dist/cli/hooks/stdin-parser.d.ts +41 -0
  58. package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
  59. package/dist/cli/hooks/stdin-parser.js +140 -4
  60. package/dist/cli/hooks/stdin-parser.js.map +1 -1
  61. package/dist/cli/hooks/track-plan.d.ts +13 -0
  62. package/dist/cli/hooks/track-plan.d.ts.map +1 -1
  63. package/dist/cli/hooks/track-plan.js +58 -3
  64. package/dist/cli/hooks/track-plan.js.map +1 -1
  65. package/dist/cli.d.ts.map +1 -1
  66. package/dist/cli.js +1 -12
  67. package/dist/cli.js.map +1 -1
  68. package/dist/config/cloud-config-loader.d.ts +8 -8
  69. package/dist/config/cloud-config-loader.d.ts.map +1 -1
  70. package/dist/config/cloud-config-loader.js +12 -12
  71. package/dist/config/cloud-config-loader.js.map +1 -1
  72. package/dist/config/global-config.d.ts +24 -46
  73. package/dist/config/global-config.d.ts.map +1 -1
  74. package/dist/config/global-config.js +174 -56
  75. package/dist/config/global-config.js.map +1 -1
  76. package/dist/config/loader.d.ts +1 -18
  77. package/dist/config/loader.d.ts.map +1 -1
  78. package/dist/config/loader.js +1 -89
  79. package/dist/config/loader.js.map +1 -1
  80. package/dist/config/types.d.ts +2 -64
  81. package/dist/config/types.d.ts.map +1 -1
  82. package/dist/config/types.js +0 -18
  83. package/dist/config/types.js.map +1 -1
  84. package/dist/database/index.d.ts +1 -2
  85. package/dist/database/index.d.ts.map +1 -1
  86. package/dist/database/index.js +1 -3
  87. package/dist/database/index.js.map +1 -1
  88. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.d.ts.map +1 -1
  89. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js +2 -1
  90. package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js.map +1 -1
  91. package/dist/database/operations/queries.d.ts +0 -4
  92. package/dist/database/operations/queries.d.ts.map +1 -1
  93. package/dist/database/operations/queries.js +0 -8
  94. package/dist/database/operations/queries.js.map +1 -1
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +2 -2
  97. package/dist/index.js.map +1 -1
  98. package/dist/init-rules.d.ts.map +1 -1
  99. package/dist/init-rules.js +0 -1
  100. package/dist/init-rules.js.map +1 -1
  101. package/dist/knexfile.d.ts.map +1 -1
  102. package/dist/knexfile.js +2 -1
  103. package/dist/knexfile.js.map +1 -1
  104. package/dist/migration/local-to-global.d.ts +19 -0
  105. package/dist/migration/local-to-global.d.ts.map +1 -0
  106. package/dist/migration/local-to-global.js +133 -0
  107. package/dist/migration/local-to-global.js.map +1 -0
  108. package/dist/saas-connector/client/types.d.ts +1 -1
  109. package/dist/saas-connector/client/types.d.ts.map +1 -1
  110. package/dist/schema.js +1 -1
  111. package/dist/server/setup.d.ts.map +1 -1
  112. package/dist/server/setup.js +15 -7
  113. package/dist/server/setup.js.map +1 -1
  114. package/dist/tests/backend/backend-factory.test.js +2 -2
  115. package/dist/tests/backend/backend-factory.test.js.map +1 -1
  116. package/dist/tests/docker/native/constraint-operations.test.d.ts +2 -17
  117. package/dist/tests/docker/native/constraint-operations.test.d.ts.map +1 -1
  118. package/dist/tests/docker/native/constraint-operations.test.js +3 -82
  119. package/dist/tests/docker/native/constraint-operations.test.js.map +1 -1
  120. package/dist/tests/docker/native/db-init.d.ts +3 -34
  121. package/dist/tests/docker/native/db-init.d.ts.map +1 -1
  122. package/dist/tests/docker/native/db-init.js +15 -77
  123. package/dist/tests/docker/native/db-init.js.map +1 -1
  124. package/dist/tests/docker/native/decision-operations.test.d.ts +2 -10
  125. package/dist/tests/docker/native/decision-operations.test.d.ts.map +1 -1
  126. package/dist/tests/docker/native/decision-operations.test.js +2 -84
  127. package/dist/tests/docker/native/decision-operations.test.js.map +1 -1
  128. package/dist/tests/docker/native/help-system.test.d.ts +2 -5
  129. package/dist/tests/docker/native/help-system.test.d.ts.map +1 -1
  130. package/dist/tests/docker/native/help-system.test.js +2 -47
  131. package/dist/tests/docker/native/help-system.test.js.map +1 -1
  132. package/dist/tests/docker/native/suggest-tool.test.d.ts +3 -11
  133. package/dist/tests/docker/native/suggest-tool.test.d.ts.map +1 -1
  134. package/dist/tests/docker/native/suggest-tool.test.js +3 -60
  135. package/dist/tests/docker/native/suggest-tool.test.js.map +1 -1
  136. package/dist/tests/docker/native/test-harness.d.ts +2 -23
  137. package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
  138. package/dist/tests/docker/native/test-harness.js +5 -59
  139. package/dist/tests/docker/native/test-harness.js.map +1 -1
  140. package/dist/tests/feature/decision/analytics.test.js +2 -1
  141. package/dist/tests/feature/decision/analytics.test.js.map +1 -1
  142. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js +2 -7
  143. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js.map +1 -1
  144. package/dist/tests/feature/decision/batch-validation.test.js +2 -1
  145. package/dist/tests/feature/decision/batch-validation.test.js.map +1 -1
  146. package/dist/tests/integration/auto-trigger-suggestions.test.js +4 -37
  147. package/dist/tests/integration/auto-trigger-suggestions.test.js.map +1 -1
  148. package/dist/tests/integration/hybrid-similarity-detection.test.js +2 -1
  149. package/dist/tests/integration/hybrid-similarity-detection.test.js.map +1 -1
  150. package/dist/tests/integration/json-export-import.test.d.ts.map +1 -0
  151. package/dist/tests/integration/json-export-import.test.js.map +1 -0
  152. package/dist/tests/unit/case-insensitive-validator.test.d.ts +0 -7
  153. package/dist/tests/unit/case-insensitive-validator.test.d.ts.map +1 -1
  154. package/dist/tests/unit/case-insensitive-validator.test.js +0 -22
  155. package/dist/tests/unit/case-insensitive-validator.test.js.map +1 -1
  156. package/dist/tests/unit/config/cloud-config-loader.test.js +4 -2
  157. package/dist/tests/unit/config/cloud-config-loader.test.js.map +1 -1
  158. package/dist/tests/unit/config/global-db-migration.test.d.ts +12 -0
  159. package/dist/tests/unit/config/global-db-migration.test.d.ts.map +1 -0
  160. package/dist/tests/unit/config/global-db-migration.test.js +117 -0
  161. package/dist/tests/unit/config/global-db-migration.test.js.map +1 -0
  162. package/dist/tests/unit/constraint-scorer.test.d.ts +2 -7
  163. package/dist/tests/unit/constraint-scorer.test.d.ts.map +1 -1
  164. package/dist/tests/unit/constraint-scorer.test.js +2 -28
  165. package/dist/tests/unit/constraint-scorer.test.js.map +1 -1
  166. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts +9 -0
  167. package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts.map +1 -0
  168. package/dist/tests/unit/hooks/grok-hook-normalization.test.js +98 -0
  169. package/dist/tests/unit/hooks/grok-hook-normalization.test.js.map +1 -0
  170. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts +7 -0
  171. package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts.map +1 -0
  172. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js +55 -0
  173. package/dist/tests/unit/hooks/grok-plan-template-injection.test.js.map +1 -0
  174. package/dist/tests/unit/universal-knex.test.js +9 -0
  175. package/dist/tests/unit/universal-knex.test.js.map +1 -1
  176. package/dist/tests/unit/validation/parameter-validation.test.js +0 -24
  177. package/dist/tests/unit/validation/parameter-validation.test.js.map +1 -1
  178. package/dist/tests/utils/db-config.d.ts.map +1 -1
  179. package/dist/tests/utils/db-config.js +0 -9
  180. package/dist/tests/utils/db-config.js.map +1 -1
  181. package/dist/tests/utils/db-import.d.ts.map +1 -1
  182. package/dist/tests/utils/db-import.js +0 -3
  183. package/dist/tests/utils/db-import.js.map +1 -1
  184. package/dist/tests/utils/db-schema.d.ts.map +1 -1
  185. package/dist/tests/utils/db-schema.js +48 -51
  186. package/dist/tests/utils/db-schema.js.map +1 -1
  187. package/dist/tests/utils/db-seeding.d.ts.map +1 -1
  188. package/dist/tests/utils/db-seeding.js +0 -3
  189. package/dist/tests/utils/db-seeding.js.map +1 -1
  190. package/dist/tests/utils/index.d.ts +0 -1
  191. package/dist/tests/utils/index.d.ts.map +1 -1
  192. package/dist/tests/utils/index.js +0 -2
  193. package/dist/tests/utils/index.js.map +1 -1
  194. package/dist/tests/utils/test-helpers.d.ts +6 -76
  195. package/dist/tests/utils/test-helpers.d.ts.map +1 -1
  196. package/dist/tests/utils/test-helpers.js +56 -162
  197. package/dist/tests/utils/test-helpers.js.map +1 -1
  198. package/dist/tests/utils/test-lifecycle.d.ts +2 -28
  199. package/dist/tests/utils/test-lifecycle.d.ts.map +1 -1
  200. package/dist/tests/utils/test-lifecycle.js +2 -31
  201. package/dist/tests/utils/test-lifecycle.js.map +1 -1
  202. package/dist/tools/context/index.d.ts +0 -1
  203. package/dist/tools/context/index.d.ts.map +1 -1
  204. package/dist/tools/context/index.js +0 -2
  205. package/dist/tools/context/index.js.map +1 -1
  206. package/dist/tools/context/types.d.ts +1 -1
  207. package/dist/tools/context/types.d.ts.map +1 -1
  208. package/dist/types/actions.d.ts +6 -29
  209. package/dist/types/actions.d.ts.map +1 -1
  210. package/dist/types/actions.js +1 -2
  211. package/dist/types/actions.js.map +1 -1
  212. package/dist/types/constraint/params.d.ts +24 -1
  213. package/dist/types/constraint/params.d.ts.map +1 -1
  214. package/dist/types/constraint/params.js +3 -0
  215. package/dist/types/constraint/params.js.map +1 -1
  216. package/dist/types/constraint/responses.d.ts +18 -1
  217. package/dist/types/constraint/responses.d.ts.map +1 -1
  218. package/dist/types/constraint/responses.js +3 -0
  219. package/dist/types/constraint/responses.js.map +1 -1
  220. package/dist/types/decision/batch.d.ts +2 -5
  221. package/dist/types/decision/batch.d.ts.map +1 -1
  222. package/dist/types/decision/batch.js +3 -3
  223. package/dist/types/decision/batch.js.map +1 -1
  224. package/dist/types/decision/params.d.ts +7 -4
  225. package/dist/types/decision/params.d.ts.map +1 -1
  226. package/dist/types/decision/responses.d.ts +49 -35
  227. package/dist/types/decision/responses.d.ts.map +1 -1
  228. package/dist/types/decision/templates.d.ts +2 -18
  229. package/dist/types/decision/templates.d.ts.map +1 -1
  230. package/dist/types/decision/templates.js +3 -3
  231. package/dist/types/decision/templates.js.map +1 -1
  232. package/dist/types/enums.d.ts +11 -13
  233. package/dist/types/enums.d.ts.map +1 -1
  234. package/dist/types/enums.js +5 -13
  235. package/dist/types/enums.js.map +1 -1
  236. package/dist/types/import-export.d.ts +7 -30
  237. package/dist/types/import-export.d.ts.map +1 -1
  238. package/dist/types/import-export.js +1 -2
  239. package/dist/types/import-export.js.map +1 -1
  240. package/dist/types/index.d.ts +18 -22
  241. package/dist/types/index.d.ts.map +1 -1
  242. package/dist/types/index.js +4 -32
  243. package/dist/types/index.js.map +1 -1
  244. package/dist/types/master-entities.d.ts +1 -10
  245. package/dist/types/master-entities.d.ts.map +1 -1
  246. package/dist/types/master-entities.js +1 -2
  247. package/dist/types/master-entities.js.map +1 -1
  248. package/dist/types/transaction-entities.d.ts +2 -21
  249. package/dist/types/transaction-entities.d.ts.map +1 -1
  250. package/dist/types/transaction-entities.js +1 -1
  251. package/dist/types/validation.d.ts +1 -16
  252. package/dist/types/validation.d.ts.map +1 -1
  253. package/dist/types/validation.js +1 -2
  254. package/dist/types/validation.js.map +1 -1
  255. package/dist/types/view-entities.d.ts +3 -12
  256. package/dist/types/view-entities.d.ts.map +1 -1
  257. package/dist/types/view-entities.js +1 -1
  258. package/dist/types.d.ts +4 -718
  259. package/dist/types.d.ts.map +1 -1
  260. package/dist/types.js +5 -39
  261. package/dist/types.js.map +1 -1
  262. package/dist/utils/parameter-validator.d.ts +2 -2
  263. package/dist/utils/parameter-validator.d.ts.map +1 -1
  264. package/dist/utils/parameter-validator.js.map +1 -1
  265. package/dist/utils/path-normalize.d.ts +23 -0
  266. package/dist/utils/path-normalize.d.ts.map +1 -0
  267. package/dist/utils/path-normalize.js +38 -0
  268. package/dist/utils/path-normalize.js.map +1 -0
  269. package/dist/utils/project-root.d.ts +6 -3
  270. package/dist/utils/project-root.d.ts.map +1 -1
  271. package/dist/utils/project-root.js +11 -3
  272. package/dist/utils/project-root.js.map +1 -1
  273. package/dist/watcher/base-watcher.d.ts +0 -4
  274. package/dist/watcher/base-watcher.d.ts.map +1 -1
  275. package/dist/watcher/base-watcher.js +11 -22
  276. package/dist/watcher/base-watcher.js.map +1 -1
  277. package/docs/CLI_USAGE.md +27 -107
  278. package/docs/CONFIGURATION.md +10 -5
  279. package/docs/DATABASE_AUTH.md +3 -3
  280. package/docs/HOOKS_GUIDE.md +40 -6
  281. package/docs/MIGRATION_TO_SAAS.md +2 -2
  282. package/docs/SHARED_DATABASE.md +108 -0
  283. package/package.json +4 -3
  284. package/dist/adapters/auth/auth-types.d.ts +0 -30
  285. package/dist/adapters/auth/auth-types.d.ts.map +0 -1
  286. package/dist/adapters/auth/auth-types.js +0 -30
  287. package/dist/adapters/auth/auth-types.js.map +0 -1
  288. package/dist/cli/db-dump.d.ts +0 -36
  289. package/dist/cli/db-dump.d.ts.map +0 -1
  290. package/dist/cli/db-dump.js +0 -384
  291. package/dist/cli/db-dump.js.map +0 -1
  292. package/dist/database/config/config-ops.d.ts +0 -42
  293. package/dist/database/config/config-ops.d.ts.map +0 -1
  294. package/dist/database/config/config-ops.js +0 -102
  295. package/dist/database/config/config-ops.js.map +0 -1
  296. package/dist/formatters/adr-formatter.d.ts +0 -22
  297. package/dist/formatters/adr-formatter.d.ts.map +0 -1
  298. package/dist/formatters/adr-formatter.js +0 -127
  299. package/dist/formatters/adr-formatter.js.map +0 -1
  300. package/dist/formatters/confluence-formatter.d.ts +0 -26
  301. package/dist/formatters/confluence-formatter.d.ts.map +0 -1
  302. package/dist/formatters/confluence-formatter.js +0 -129
  303. package/dist/formatters/confluence-formatter.js.map +0 -1
  304. package/dist/formatters/index.d.ts +0 -34
  305. package/dist/formatters/index.d.ts.map +0 -1
  306. package/dist/formatters/index.js +0 -57
  307. package/dist/formatters/index.js.map +0 -1
  308. package/dist/formatters/markdown-formatter.d.ts +0 -16
  309. package/dist/formatters/markdown-formatter.d.ts.map +0 -1
  310. package/dist/formatters/markdown-formatter.js +0 -110
  311. package/dist/formatters/markdown-formatter.js.map +0 -1
  312. package/dist/formatters/notion-formatter.d.ts +0 -29
  313. package/dist/formatters/notion-formatter.d.ts.map +0 -1
  314. package/dist/formatters/notion-formatter.js +0 -177
  315. package/dist/formatters/notion-formatter.js.map +0 -1
  316. package/dist/formatters/types.d.ts +0 -31
  317. package/dist/formatters/types.d.ts.map +0 -1
  318. package/dist/formatters/types.js +0 -6
  319. package/dist/formatters/types.js.map +0 -1
  320. package/dist/tests/database/sql-dump/converters.test.d.ts +0 -7
  321. package/dist/tests/database/sql-dump/converters.test.d.ts.map +0 -1
  322. package/dist/tests/database/sql-dump/converters.test.js +0 -314
  323. package/dist/tests/database/sql-dump/converters.test.js.map +0 -1
  324. package/dist/tests/database/sql-dump/default-conversions.test.d.ts +0 -8
  325. package/dist/tests/database/sql-dump/default-conversions.test.d.ts.map +0 -1
  326. package/dist/tests/database/sql-dump/default-conversions.test.js +0 -141
  327. package/dist/tests/database/sql-dump/default-conversions.test.js.map +0 -1
  328. package/dist/tests/database/sql-dump/table-ordering.test.d.ts +0 -27
  329. package/dist/tests/database/sql-dump/table-ordering.test.d.ts.map +0 -1
  330. package/dist/tests/database/sql-dump/table-ordering.test.js +0 -284
  331. package/dist/tests/database/sql-dump/table-ordering.test.js.map +0 -1
  332. package/dist/tests/database/sql-dump/type-conversion.test.d.ts +0 -8
  333. package/dist/tests/database/sql-dump/type-conversion.test.d.ts.map +0 -1
  334. package/dist/tests/database/sql-dump/type-conversion.test.js +0 -361
  335. package/dist/tests/database/sql-dump/type-conversion.test.js.map +0 -1
  336. package/dist/tests/docker/cross-database.test.d.ts +0 -21
  337. package/dist/tests/docker/cross-database.test.d.ts.map +0 -1
  338. package/dist/tests/docker/cross-database.test.js +0 -308
  339. package/dist/tests/docker/cross-database.test.js.map +0 -1
  340. package/dist/tests/docker/dump-import.test.d.ts +0 -15
  341. package/dist/tests/docker/dump-import.test.d.ts.map +0 -1
  342. package/dist/tests/docker/dump-import.test.js +0 -424
  343. package/dist/tests/docker/dump-import.test.js.map +0 -1
  344. package/dist/tests/docker/fk-constraints.test.d.ts +0 -13
  345. package/dist/tests/docker/fk-constraints.test.d.ts.map +0 -1
  346. package/dist/tests/docker/fk-constraints.test.js +0 -381
  347. package/dist/tests/docker/fk-constraints.test.js.map +0 -1
  348. package/dist/tests/docker/indexes.test.d.ts +0 -12
  349. package/dist/tests/docker/indexes.test.d.ts.map +0 -1
  350. package/dist/tests/docker/indexes.test.js +0 -250
  351. package/dist/tests/docker/indexes.test.js.map +0 -1
  352. package/dist/tests/docker/integration.test.d.ts +0 -16
  353. package/dist/tests/docker/integration.test.d.ts.map +0 -1
  354. package/dist/tests/docker/integration.test.js +0 -323
  355. package/dist/tests/docker/integration.test.js.map +0 -1
  356. package/dist/tests/docker/multi-project-migration.test.d.ts +0 -17
  357. package/dist/tests/docker/multi-project-migration.test.d.ts.map +0 -1
  358. package/dist/tests/docker/multi-project-migration.test.js +0 -394
  359. package/dist/tests/docker/multi-project-migration.test.js.map +0 -1
  360. package/dist/tests/docker/schema-migration.test.d.ts +0 -8
  361. package/dist/tests/docker/schema-migration.test.d.ts.map +0 -1
  362. package/dist/tests/docker/schema-migration.test.js +0 -98
  363. package/dist/tests/docker/schema-migration.test.js.map +0 -1
  364. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts +0 -5
  365. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts.map +0 -1
  366. package/dist/tests/integration/e2e-workflow1-debug.test.js +0 -85
  367. package/dist/tests/integration/e2e-workflow1-debug.test.js.map +0 -1
  368. package/dist/tests/integration/suggest-simple.test.d.ts +0 -5
  369. package/dist/tests/integration/suggest-simple.test.d.ts.map +0 -1
  370. package/dist/tests/integration/suggest-simple.test.js +0 -90
  371. package/dist/tests/integration/suggest-simple.test.js.map +0 -1
  372. package/dist/tests/migrations/test-all-versions-real.d.ts +0 -8
  373. package/dist/tests/migrations/test-all-versions-real.d.ts.map +0 -1
  374. package/dist/tests/migrations/test-all-versions-real.js +0 -236
  375. package/dist/tests/migrations/test-all-versions-real.js.map +0 -1
  376. package/dist/tests/migrations/test-all-versions.d.ts +0 -14
  377. package/dist/tests/migrations/test-all-versions.d.ts.map +0 -1
  378. package/dist/tests/migrations/test-all-versions.js +0 -519
  379. package/dist/tests/migrations/test-all-versions.js.map +0 -1
  380. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts +0 -7
  381. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts.map +0 -1
  382. package/dist/tests/migrations/v4/v4-fresh-install.test.js +0 -168
  383. package/dist/tests/migrations/v4/v4-fresh-install.test.js.map +0 -1
  384. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts +0 -13
  385. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts.map +0 -1
  386. package/dist/tests/migrations/v4/v4-migrate-data.test.js +0 -264
  387. package/dist/tests/migrations/v4/v4-migrate-data.test.js.map +0 -1
  388. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts +0 -2
  389. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts.map +0 -1
  390. package/dist/tests/unit/utils/case-insensitive-validator.test.js +0 -97
  391. package/dist/tests/unit/utils/case-insensitive-validator.test.js.map +0 -1
  392. package/dist/tests/utils/json-export-import.test.d.ts.map +0 -1
  393. package/dist/tests/utils/json-export-import.test.js.map +0 -1
  394. package/dist/tests/utils/task-helpers.d.ts +0 -67
  395. package/dist/tests/utils/task-helpers.d.ts.map +0 -1
  396. package/dist/tests/utils/task-helpers.js +0 -134
  397. package/dist/tests/utils/task-helpers.js.map +0 -1
  398. package/dist/tools/context/actions/export.d.ts +0 -35
  399. package/dist/tools/context/actions/export.d.ts.map +0 -1
  400. package/dist/tools/context/actions/export.js +0 -93
  401. package/dist/tools/context/actions/export.js.map +0 -1
  402. package/dist/types/file/params.d.ts +0 -40
  403. package/dist/types/file/params.d.ts.map +0 -1
  404. package/dist/types/file/params.js +0 -6
  405. package/dist/types/file/params.js.map +0 -1
  406. package/dist/types/file/responses.d.ts +0 -2
  407. package/dist/types/file/responses.d.ts.map +0 -1
  408. package/dist/types/file/responses.js +0 -2
  409. package/dist/types/file/responses.js.map +0 -1
  410. package/dist/types/task/params.d.ts +0 -173
  411. package/dist/types/task/params.d.ts.map +0 -1
  412. package/dist/types/task/params.js +0 -8
  413. package/dist/types/task/params.js.map +0 -1
  414. package/dist/types/task/responses.d.ts +0 -334
  415. package/dist/types/task/responses.d.ts.map +0 -1
  416. package/dist/types/task/responses.js +0 -8
  417. package/dist/types/task/responses.js.map +0 -1
  418. package/dist/utils/sql-dump/core/dependency-sort.d.ts +0 -16
  419. package/dist/utils/sql-dump/core/dependency-sort.d.ts.map +0 -1
  420. package/dist/utils/sql-dump/core/dependency-sort.js +0 -105
  421. package/dist/utils/sql-dump/core/dependency-sort.js.map +0 -1
  422. package/dist/utils/sql-dump/core/generate-dump.d.ts +0 -13
  423. package/dist/utils/sql-dump/core/generate-dump.d.ts.map +0 -1
  424. package/dist/utils/sql-dump/core/generate-dump.js +0 -201
  425. package/dist/utils/sql-dump/core/generate-dump.js.map +0 -1
  426. package/dist/utils/sql-dump/core/index-export.d.ts +0 -10
  427. package/dist/utils/sql-dump/core/index-export.d.ts.map +0 -1
  428. package/dist/utils/sql-dump/core/index-export.js +0 -173
  429. package/dist/utils/sql-dump/core/index-export.js.map +0 -1
  430. package/dist/utils/sql-dump/core/sequence-reset.d.ts +0 -6
  431. package/dist/utils/sql-dump/core/sequence-reset.d.ts.map +0 -1
  432. package/dist/utils/sql-dump/core/sequence-reset.js +0 -28
  433. package/dist/utils/sql-dump/core/sequence-reset.js.map +0 -1
  434. package/dist/utils/sql-dump/core/table-export.d.ts +0 -2
  435. package/dist/utils/sql-dump/core/table-export.d.ts.map +0 -1
  436. package/dist/utils/sql-dump/core/table-export.js +0 -4
  437. package/dist/utils/sql-dump/core/table-export.js.map +0 -1
  438. package/dist/utils/sql-dump/core/view-export.d.ts +0 -2
  439. package/dist/utils/sql-dump/core/view-export.d.ts.map +0 -1
  440. package/dist/utils/sql-dump/core/view-export.js +0 -4
  441. package/dist/utils/sql-dump/core/view-export.js.map +0 -1
  442. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts +0 -14
  443. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts.map +0 -1
  444. package/dist/utils/sql-dump/formatters/bulk-insert.js +0 -177
  445. package/dist/utils/sql-dump/formatters/bulk-insert.js.map +0 -1
  446. package/dist/utils/sql-dump/formatters/identifiers.d.ts +0 -6
  447. package/dist/utils/sql-dump/formatters/identifiers.d.ts.map +0 -1
  448. package/dist/utils/sql-dump/formatters/identifiers.js +0 -16
  449. package/dist/utils/sql-dump/formatters/identifiers.js.map +0 -1
  450. package/dist/utils/sql-dump/formatters/value-formatter.d.ts +0 -14
  451. package/dist/utils/sql-dump/formatters/value-formatter.d.ts.map +0 -1
  452. package/dist/utils/sql-dump/formatters/value-formatter.js +0 -281
  453. package/dist/utils/sql-dump/formatters/value-formatter.js.map +0 -1
  454. package/dist/utils/sql-dump/generators/controls.d.ts +0 -10
  455. package/dist/utils/sql-dump/generators/controls.d.ts.map +0 -1
  456. package/dist/utils/sql-dump/generators/controls.js +0 -36
  457. package/dist/utils/sql-dump/generators/controls.js.map +0 -1
  458. package/dist/utils/sql-dump/generators/headers.d.ts +0 -6
  459. package/dist/utils/sql-dump/generators/headers.d.ts.map +0 -1
  460. package/dist/utils/sql-dump/generators/headers.js +0 -19
  461. package/dist/utils/sql-dump/generators/headers.js.map +0 -1
  462. package/dist/utils/sql-dump/index.d.ts +0 -14
  463. package/dist/utils/sql-dump/index.d.ts.map +0 -1
  464. package/dist/utils/sql-dump/index.js +0 -16
  465. package/dist/utils/sql-dump/index.js.map +0 -1
  466. package/dist/utils/sql-dump/schema/indexes.d.ts +0 -20
  467. package/dist/utils/sql-dump/schema/indexes.d.ts.map +0 -1
  468. package/dist/utils/sql-dump/schema/indexes.js +0 -108
  469. package/dist/utils/sql-dump/schema/indexes.js.map +0 -1
  470. package/dist/utils/sql-dump/schema/primary-keys.d.ts +0 -6
  471. package/dist/utils/sql-dump/schema/primary-keys.d.ts.map +0 -1
  472. package/dist/utils/sql-dump/schema/primary-keys.js +0 -41
  473. package/dist/utils/sql-dump/schema/primary-keys.js.map +0 -1
  474. package/dist/utils/sql-dump/schema/tables.d.ts +0 -15
  475. package/dist/utils/sql-dump/schema/tables.d.ts.map +0 -1
  476. package/dist/utils/sql-dump/schema/tables.js +0 -518
  477. package/dist/utils/sql-dump/schema/tables.js.map +0 -1
  478. package/dist/utils/sql-dump/schema/views.d.ts +0 -11
  479. package/dist/utils/sql-dump/schema/views.d.ts.map +0 -1
  480. package/dist/utils/sql-dump/schema/views.js +0 -116
  481. package/dist/utils/sql-dump/schema/views.js.map +0 -1
  482. package/dist/utils/sql-dump/types.d.ts +0 -10
  483. package/dist/utils/sql-dump/types.d.ts.map +0 -1
  484. package/dist/utils/sql-dump/types.js +0 -3
  485. package/dist/utils/sql-dump/types.js.map +0 -1
  486. package/dist/utils/sql-dump-converters.d.ts +0 -188
  487. package/dist/utils/sql-dump-converters.d.ts.map +0 -1
  488. package/dist/utils/sql-dump-converters.js +0 -315
  489. package/dist/utils/sql-dump-converters.js.map +0 -1
  490. package/dist/watcher/gitignore-parser.d.ts +0 -70
  491. package/dist/watcher/gitignore-parser.d.ts.map +0 -1
  492. package/dist/watcher/gitignore-parser.js +0 -195
  493. package/dist/watcher/gitignore-parser.js.map +0 -1
  494. package/dist/watcher/index.d.ts +0 -9
  495. package/dist/watcher/index.d.ts.map +0 -1
  496. package/dist/watcher/index.js +0 -8
  497. package/dist/watcher/index.js.map +0 -1
  498. /package/dist/tests/{utils → integration}/json-export-import.test.d.ts +0 -0
  499. /package/dist/tests/{utils → integration}/json-export-import.test.js +0 -0
package/dist/types.d.ts CHANGED
@@ -1,723 +1,9 @@
1
1
  /**
2
2
  * Type definitions for MCP Shared Context Server
3
- * Database entity interfaces and enum types
4
- */
5
- import { Database } from 'better-sqlite3';
6
- /**
7
- * Decision status enumeration
8
- * 1 = active, 2 = deprecated, 3 = draft, 4 = in_progress, 5 = in_review, 6 = implemented
9
- */
10
- export declare enum Status {
11
- ACTIVE = 1,
12
- DEPRECATED = 2,
13
- DRAFT = 3,
14
- IN_PROGRESS = 4,
15
- IN_REVIEW = 5,
16
- IMPLEMENTED = 6
17
- }
18
- /**
19
- * Valid status string values for API parameters
20
- * Matches STRING_TO_STATUS keys in constants.ts
21
- */
22
- export type StatusString = 'active' | 'deprecated' | 'draft' | 'in_progress' | 'in_review' | 'implemented';
23
- /**
24
- * Message type enumeration
25
- * 1 = decision, 2 = warning, 3 = request, 4 = info
26
- */
27
- export declare enum MessageType {
28
- DECISION = 1,
29
- WARNING = 2,
30
- REQUEST = 3,
31
- INFO = 4
32
- }
33
- /**
34
- * Priority level enumeration
35
- * 1 = low, 2 = medium, 3 = high, 4 = critical
36
- */
37
- export declare enum Priority {
38
- LOW = 1,
39
- MEDIUM = 2,
40
- HIGH = 3,
41
- CRITICAL = 4
42
- }
43
- /**
44
- * Concise validation error for MCP tool parameter validation
45
- * Designed for token efficiency - references examples via ID instead of embedding full objects
3
+ * Thin barrel re-export for backward compatibility
46
4
  *
47
- * Example output: "Missing: key, value. See: decision.set"
48
- */
49
- export interface ValidationError {
50
- error: string;
51
- action: string;
52
- reference: string;
53
- missing?: string[];
54
- typos?: Record<string, string>;
55
- hint?: string;
56
- }
57
- export interface Agent {
58
- readonly id: number;
59
- readonly name: string;
60
- }
61
- export interface ContextKey {
62
- readonly id: number;
63
- readonly key: string;
64
- }
65
- export interface ConstraintCategory {
66
- readonly id: number;
67
- readonly name: string;
68
- }
69
- export interface Layer {
70
- readonly id: number;
71
- readonly name: string;
72
- }
73
- export interface Tag {
74
- readonly id: number;
75
- readonly name: string;
76
- }
77
- export interface Scope {
78
- readonly id: number;
79
- readonly name: string;
80
- }
81
- export interface Decision {
82
- readonly key_id: number;
83
- readonly value: string;
84
- readonly agent_id: number | null;
85
- readonly layer_id: number | null;
86
- readonly version: string;
87
- readonly status: Status;
88
- readonly ts: number;
89
- }
90
- export interface DecisionNumeric {
91
- readonly key_id: number;
92
- readonly value: number;
93
- readonly agent_id: number | null;
94
- readonly layer_id: number | null;
95
- readonly version: string;
96
- readonly status: Status;
97
- readonly ts: number;
98
- }
99
- export interface DecisionHistory {
100
- readonly id: number;
101
- readonly key_id: number;
102
- readonly version: string;
103
- readonly value: string;
104
- readonly agent_id: number | null;
105
- readonly ts: number;
106
- }
107
- export interface DecisionTag {
108
- readonly decision_key_id: number;
109
- readonly tag_id: number;
110
- }
111
- export interface DecisionScope {
112
- readonly decision_key_id: number;
113
- readonly scope_id: number;
114
- }
115
- export interface AgentMessage {
116
- readonly id: number;
117
- readonly from_agent_id: number;
118
- readonly to_agent_id: number | null;
119
- readonly msg_type: MessageType;
120
- readonly priority: Priority;
121
- readonly payload: string | null;
122
- readonly ts: number;
123
- readonly read: number;
124
- }
125
- export interface Constraint {
126
- readonly id: number;
127
- readonly category_id: number;
128
- readonly layer_id: number | null;
129
- readonly constraint_text: string;
130
- readonly priority: Priority;
131
- readonly active: number;
132
- readonly created_by: number | null;
133
- readonly ts: number;
134
- }
135
- export interface ConstraintTag {
136
- readonly constraint_id: number;
137
- readonly tag_id: number;
138
- }
139
- export interface ActivityLog {
140
- readonly id: number;
141
- readonly ts: number;
142
- readonly agent_id: number;
143
- readonly action_type: string;
144
- readonly target: string;
145
- readonly layer_id: number | null;
146
- readonly details: string | null;
147
- }
148
- export interface DecisionTemplate {
149
- readonly id: number;
150
- readonly name: string;
151
- readonly defaults: string;
152
- readonly required_fields: string | null;
153
- readonly created_by: number | null;
154
- readonly ts: number;
155
- }
156
- export interface TaggedDecision {
157
- readonly key: string;
158
- readonly value: string;
159
- readonly version: string;
160
- readonly status: StatusString;
161
- readonly layer: string | null;
162
- readonly tags: string | null;
163
- readonly scopes: string | null;
164
- readonly decided_by: string | null;
165
- readonly updated: string;
166
- readonly project_id: number;
167
- }
168
- export interface ActiveContext {
169
- readonly key: string;
170
- readonly value: string;
171
- readonly version: string;
172
- readonly layer: string | null;
173
- readonly decided_by: string | null;
174
- readonly updated: string;
175
- }
176
- export interface LayerSummary {
177
- readonly layer: string;
178
- readonly decisions_count: number;
179
- readonly constraints_count: number;
180
- }
181
- export interface UnreadMessagesByPriority {
182
- readonly agent: string;
183
- readonly priority: 'critical' | 'high' | 'medium' | 'low';
184
- readonly count: number;
185
- }
186
- export interface TaggedConstraint {
187
- readonly id: number | string;
188
- readonly category: string;
189
- readonly layer: string | null;
190
- readonly constraint_text: string;
191
- readonly priority: 'critical' | 'high' | 'medium' | 'low';
192
- readonly tags: string | null;
193
- readonly created_by: string | null;
194
- readonly created_at: string;
195
- }
196
- export interface SetDecisionParams {
197
- key: string;
198
- value: string | number;
199
- agent?: string;
200
- layer?: string;
201
- version?: string;
202
- auto_increment?: 'major' | 'minor' | 'patch';
203
- status?: StatusString;
204
- tags?: string[];
205
- scopes?: string[];
206
- rationale?: string;
207
- alternatives?: any[];
208
- tradeoffs?: any;
209
- policy_name?: string;
210
- suggest_constraints?: boolean;
211
- }
212
- export interface QuickSetDecisionParams {
213
- key: string;
214
- value: string | number;
215
- agent?: string;
216
- layer?: string;
217
- version?: string;
218
- status?: StatusString;
219
- tags?: string[];
220
- scopes?: string[];
221
- }
222
- export interface GetContextParams {
223
- tags?: string[];
224
- layer?: string;
225
- status?: StatusString;
226
- scope?: string;
227
- tag_match?: 'AND' | 'OR';
228
- full_value?: boolean;
229
- _reference_project?: string;
230
- }
231
- export interface GetDecisionParams {
232
- key: string;
233
- }
234
- export interface HardDeleteDecisionParams {
235
- key: string;
236
- }
237
- export interface SearchByTagsParams {
238
- tags: string[];
239
- match_mode?: 'AND' | 'OR';
240
- status?: StatusString;
241
- layer?: string;
242
- full_value?: boolean;
243
- }
244
- export interface GetVersionsParams {
245
- key: string;
246
- }
247
- export interface SearchByLayerParams {
248
- layer: string;
249
- status?: StatusString;
250
- include_tags?: boolean;
251
- full_value?: boolean;
252
- _reference_project?: string;
253
- }
254
- export interface SearchAdvancedParams {
255
- layers?: string[];
256
- tags_all?: string[];
257
- tags_any?: string[];
258
- exclude_tags?: string[];
259
- scopes?: string[];
260
- updated_after?: string;
261
- updated_before?: string;
262
- decided_by?: string[];
263
- statuses?: StatusString[];
264
- search_text?: string;
265
- sort_by?: 'updated' | 'key' | 'version';
266
- sort_order?: 'asc' | 'desc';
267
- limit?: number;
268
- offset?: number;
269
- full_value?: boolean;
270
- }
271
- export interface HasUpdatesParams {
272
- agent_name?: string;
273
- since_timestamp: string;
274
- }
275
- /**
276
- * Output format for decision/constraint export
277
- */
278
- export type ExportFormat = 'blocks' | 'markdown' | 'adr' | 'notion' | 'confluence';
279
- /**
280
- * Parameters for decision:export action
281
- * SaaS-only feature for document generation
282
- */
283
- export interface ExportDecisionParams {
284
- tags?: string[];
285
- layers?: string[];
286
- since?: string;
287
- status?: StatusString[];
288
- group_by?: 'layer' | 'tag' | 'none';
289
- format: ExportFormat;
290
- include_metadata?: boolean;
291
- include_context?: boolean;
292
- }
293
- /**
294
- * Individual item in export blocks
295
- */
296
- export interface ExportBlockItem {
297
- key: string;
298
- value: string;
299
- layer?: string;
300
- tags?: string[];
301
- version?: string;
302
- updated?: string;
303
- rationale?: string;
304
- alternatives?: string[];
305
- tradeoffs?: string;
306
- }
307
- /**
308
- * Section block in export response
309
- */
310
- export interface ExportBlockSection {
311
- type: 'section';
312
- title: string;
313
- items: ExportBlockItem[];
314
- }
315
- /**
316
- * Constraint in export response
317
- */
318
- export interface ExportBlockConstraint {
319
- category: string;
320
- rule: string;
321
- priority: string;
322
- tags?: string[];
323
- }
324
- /**
325
- * Structured blocks response from SaaS
326
- */
327
- export interface ExportBlocks {
328
- metadata: {
329
- exported_at: string;
330
- total_decisions: number;
331
- total_constraints: number;
332
- filters_applied: Record<string, unknown>;
333
- };
334
- blocks: ExportBlockSection[];
335
- constraints?: ExportBlockConstraint[];
336
- }
337
- export interface AddConstraintParams {
338
- category: string;
339
- constraint_text: string;
340
- priority?: 'low' | 'medium' | 'high' | 'critical' | number;
341
- layer?: string;
342
- tags?: string[];
343
- created_by?: string;
344
- /** @since v4.2.1 - Set to false to create inactive constraint (for plan-based workflow) */
345
- active?: boolean;
346
- }
347
- export interface GetConstraintsParams {
348
- category?: string;
349
- layer?: string;
350
- priority?: 'low' | 'medium' | 'high' | 'critical' | number;
351
- tags?: string[];
352
- include_inactive?: boolean;
353
- limit?: number;
354
- }
355
- export interface DeactivateConstraintParams {
356
- id: number | string;
357
- }
358
- export interface SetDecisionBatchParams {
359
- decisions: SetDecisionParams[];
360
- atomic?: boolean;
361
- }
362
- export interface SetFromTemplateParams {
363
- template: string;
364
- key: string;
365
- value: string | number;
366
- agent?: string;
367
- layer?: string;
368
- version?: string;
369
- status?: StatusString;
370
- tags?: string[];
371
- scopes?: string[];
372
- [key: string]: any;
373
- }
374
- export interface CreateTemplateParams {
375
- name: string;
376
- defaults: {
377
- layer?: string;
378
- status?: StatusString;
379
- tags?: string[];
380
- priority?: 'low' | 'medium' | 'high' | 'critical';
381
- };
382
- required_fields?: string[];
383
- created_by?: string;
384
- }
385
- export interface ListTemplatesParams {
386
- }
387
- export interface SetDecisionResponse {
388
- success: boolean;
389
- key: string;
390
- key_id: number;
391
- version: string;
392
- version_action?: 'initial' | 'explicit' | 'auto_increment_major' | 'auto_increment_minor' | 'auto_increment_patch';
393
- message?: string;
394
- value?: string | number;
395
- policy_validation?: {
396
- matched_policy?: string;
397
- violations?: string[];
398
- };
399
- suggestions?: {
400
- triggered_by: string;
401
- reason: string;
402
- suggestions: Array<{
403
- key: string;
404
- value: string;
405
- score: number;
406
- reason: string;
407
- }>;
408
- };
409
- auto_updated?: boolean;
410
- requested_key?: string;
411
- actual_key?: string;
412
- similarity_score?: number;
413
- duplicate_reason?: {
414
- similarity: string;
415
- matched_tags: string[];
416
- layer?: string;
417
- key_pattern?: string;
418
- };
419
- related_constraints?: Array<{
420
- id: number;
421
- constraint_text: string;
422
- category: string;
423
- score: number;
424
- reason: string;
425
- layer?: string;
426
- tags?: string[];
427
- }>;
428
- warnings?: string[];
429
- }
430
- export interface QuickSetDecisionResponse {
431
- success: boolean;
432
- key: string;
433
- key_id: number;
434
- version: string;
435
- inferred: {
436
- layer?: string;
437
- tags?: string[];
438
- scope?: string;
439
- };
440
- message?: string;
441
- warnings?: string[];
442
- }
443
- export interface GetContextResponse {
444
- decisions: TaggedDecision[];
445
- count: number;
446
- }
447
- export interface GetDecisionResponse {
448
- found: boolean;
449
- decision?: TaggedDecision;
450
- context?: Array<{
451
- id: number;
452
- rationale: string;
453
- alternatives_considered: any;
454
- tradeoffs: any;
455
- decided_by: string | null;
456
- decision_date: string;
457
- related_task_id: number | null;
458
- related_constraint_id: number | null;
459
- }>;
460
- warnings?: string[];
461
- }
462
- export interface HardDeleteDecisionResponse {
463
- success: boolean;
464
- key: string;
465
- message?: string;
466
- }
467
- export interface SearchByTagsResponse {
468
- decisions: TaggedDecision[];
469
- count: number;
470
- }
471
- export interface GetVersionsResponse {
472
- key: string;
473
- history: Array<{
474
- version: string;
475
- value: string;
476
- timestamp: string;
477
- }>;
478
- count: number;
479
- }
480
- export interface SearchByLayerResponse {
481
- layer: string;
482
- decisions: TaggedDecision[];
483
- count: number;
484
- }
485
- export interface SearchAdvancedResponse {
486
- decisions: TaggedDecision[];
487
- count: number;
488
- total_count: number;
489
- }
490
- export interface HasUpdatesResponse {
491
- has_updates: boolean;
492
- counts: {
493
- decisions: number;
494
- };
495
- }
496
- /**
497
- * Response for decision:export action
498
- * SaaS-only feature for document generation (v5.0.0)
499
- */
500
- export interface ExportDecisionResponse {
501
- success: boolean;
502
- format: ExportFormat;
503
- content: string | ExportBlocks;
504
- metadata: {
505
- total_decisions: number;
506
- total_constraints: number;
507
- exported_at: string;
508
- };
509
- warnings?: string[];
510
- }
511
- export interface AddConstraintResponse {
512
- success: boolean;
513
- constraint_id: number | string;
514
- already_exists?: boolean;
515
- warnings?: string[];
516
- }
517
- export interface GetConstraintsResponse {
518
- constraints: TaggedConstraint[];
519
- count: number;
520
- warnings?: string[];
521
- }
522
- export interface DeactivateConstraintResponse {
523
- success: boolean;
524
- }
525
- export interface GetStatsResponse {
526
- agents: number;
527
- context_keys: number;
528
- active_decisions: number;
529
- total_decisions: number;
530
- active_constraints: number;
531
- total_constraints: number;
532
- tags: number;
533
- scopes: number;
534
- layers: number;
535
- }
536
- export interface FlushWALResponse {
537
- success: boolean;
538
- mode: string;
539
- pages_flushed: number;
540
- message: string;
541
- }
542
- export interface ActivityLogEntry {
543
- id: number;
544
- timestamp: string;
545
- agent: string;
546
- action: string;
547
- target: string;
548
- layer: string | null;
549
- details: any;
550
- }
551
- export interface SetDecisionBatchResponse {
552
- success: boolean;
553
- inserted: number;
554
- failed: number;
555
- results: Array<{
556
- key: string;
557
- key_id?: number;
558
- version?: string;
559
- success: boolean;
560
- error?: string;
561
- }>;
562
- }
563
- export interface SetFromTemplateResponse {
564
- success: boolean;
565
- key: string;
566
- key_id: number;
567
- version: string;
568
- template_used: string;
569
- applied_defaults: {
570
- layer?: string;
571
- tags?: string[];
572
- status?: string;
573
- };
574
- message?: string;
575
- }
576
- export interface CreateTemplateResponse {
577
- success: boolean;
578
- template_id: number;
579
- template_name: string;
580
- message?: string;
581
- }
582
- export interface ListTemplatesResponse {
583
- templates: Array<{
584
- id: number;
585
- name: string;
586
- defaults: any;
587
- required_fields: string[] | null;
588
- created_at: string;
589
- }>;
590
- count: number;
591
- }
592
- /**
593
- * Action not found error
594
- * Thrown when an invalid action is specified
595
- */
596
- export interface ActionNotFoundError {
597
- error: string;
598
- tool: string;
599
- action_provided: string;
600
- available_actions: string[];
601
- did_you_mean?: string[];
602
- }
603
- /**
604
- * Decision tool actions
605
- * Provides compile-time type checking for action parameters without breaking MCP wire protocol
606
- */
607
- export type DecisionAction = 'set' | 'get' | 'list' | 'search_tags' | 'search_layer' | 'versions' | 'quick_set' | 'search_advanced' | 'set_batch' | 'has_updates' | 'set_from_template' | 'create_template' | 'list_templates' | 'hard_delete' | 'add_decision_context' | 'list_decision_contexts' | 'create_policy' | 'list_policies' | 'set_from_policy' | 'analytics' | 'export' | 'help' | 'example' | 'use_case';
608
- /**
609
- * Constraint tool actions
610
- * Provides compile-time type checking for action parameters
611
- */
612
- export type ConstraintAction = 'add' | 'get' | 'activate' | 'deactivate' | 'suggest_pending' | 'help' | 'example' | 'use_case';
613
- /**
614
- * Config tool actions
615
- * Provides compile-time type checking for action parameters
616
- */
617
- export type ConfigAction = 'get' | 'update' | 'help' | 'example' | 'use_case';
618
- /**
619
- * Example tool actions
620
- * Provides compile-time type checking for action parameters
621
- */
622
- export type ExampleAction = 'get' | 'search' | 'list_all' | 'help' | 'example';
623
- /**
624
- * Options for JSON import operation
625
- */
626
- export interface JsonImportOptions {
627
- /** Optional: Target project name (if not provided, uses name from JSON) */
628
- targetProjectName?: string;
629
- /** Optional: Skip import if project already exists (default: true) */
630
- skipIfExists?: boolean;
631
- /** Optional: Dry run mode - validate only, don't import (default: false) */
632
- dryRun?: boolean;
633
- }
634
- /**
635
- * JSON import validation result
636
- */
637
- export interface ImportValidationResult {
638
- valid: boolean;
639
- errors: string[];
640
- warnings: string[];
641
- schema_version?: number;
642
- sqlew_version?: string;
643
- export_mode?: 'single_project' | 'all_projects';
644
- }
645
- /**
646
- * ID mapping for a single master table
647
- * Maps old IDs (from export) to new IDs (in target database)
648
- */
649
- export interface IdMapping extends Map<number, number> {
650
- }
651
- /**
652
- * Complete ID mapping context for all master tables
653
- * Note: agents removed in v4.0, files/tasks removed in v5.0
654
- */
655
- export interface ImportIdMappings {
656
- projects: IdMapping;
657
- context_keys: IdMapping;
658
- tags: IdMapping;
659
- scopes: IdMapping;
660
- constraint_categories: IdMapping;
661
- layers: IdMapping;
662
- decision_policies: IdMapping;
663
- }
664
- /**
665
- * Import context - holds all state during import operation
666
- */
667
- export interface ImportContext {
668
- /** Knex instance for database operations */
669
- knex: any;
670
- /** ID mappings for all tables */
671
- mappings: ImportIdMappings;
672
- /** Target project ID (created during import) */
673
- projectId: number;
674
- /** Source JSON data */
675
- jsonData: any;
676
- /** Import options */
677
- options: JsonImportOptions;
678
- /** Statistics (updated during import) */
679
- stats: ImportStats;
680
- }
681
- /**
682
- * Import statistics
683
- * Note: agents_created, activity_log_created removed in v4.0
684
- * Note: files/tasks related stats removed in v5.0
685
- */
686
- export interface ImportStats {
687
- project_created: boolean;
688
- master_tables: {
689
- context_keys_created: number;
690
- tags_created: number;
691
- tags_reused: number;
692
- scopes_created: number;
693
- scopes_reused: number;
694
- };
695
- transaction_tables: {
696
- decisions_created: number;
697
- decisions_numeric_created: number;
698
- decision_history_created: number;
699
- decision_context_created: number;
700
- constraints_created: number;
701
- decision_policies_created: number;
702
- tag_index_created: number;
703
- };
704
- junction_tables: {
705
- decision_tags_created: number;
706
- decision_scopes_created: number;
707
- constraint_tags_created: number;
708
- };
709
- }
710
- /**
711
- * JSON import result
5
+ * All types are defined in src/types/ modules.
6
+ * Existing imports (e.g., `from './types.js'`) continue to work unchanged.
712
7
  */
713
- export interface JsonImportResult {
714
- success: boolean;
715
- project_id?: number;
716
- project_name?: string;
717
- stats?: ImportStats;
718
- error?: string;
719
- skipped?: boolean;
720
- skip_reason?: string;
721
- }
722
- export type { Database };
8
+ export * from './types/index.js';
723
9
  //# sourceMappingURL=types.d.ts.map