sqlew 5.0.8 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +2 -2
  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.d.ts.map +1 -1
  49. package/dist/cli.js +1 -12
  50. package/dist/cli.js.map +1 -1
  51. package/dist/config/cloud-config-loader.d.ts +8 -8
  52. package/dist/config/cloud-config-loader.d.ts.map +1 -1
  53. package/dist/config/cloud-config-loader.js +12 -12
  54. package/dist/config/cloud-config-loader.js.map +1 -1
  55. package/dist/config/global-config.d.ts +17 -45
  56. package/dist/config/global-config.d.ts.map +1 -1
  57. package/dist/config/global-config.js +169 -30
  58. package/dist/config/global-config.js.map +1 -1
  59. package/dist/config/loader.d.ts +1 -18
  60. package/dist/config/loader.d.ts.map +1 -1
  61. package/dist/config/loader.js +1 -89
  62. package/dist/config/loader.js.map +1 -1
  63. package/dist/config/types.d.ts +2 -64
  64. package/dist/config/types.d.ts.map +1 -1
  65. package/dist/config/types.js +0 -18
  66. package/dist/config/types.js.map +1 -1
  67. package/dist/database/index.d.ts +1 -2
  68. package/dist/database/index.d.ts.map +1 -1
  69. package/dist/database/index.js +1 -3
  70. package/dist/database/index.js.map +1 -1
  71. package/dist/database/operations/queries.d.ts +0 -4
  72. package/dist/database/operations/queries.d.ts.map +1 -1
  73. package/dist/database/operations/queries.js +0 -8
  74. package/dist/database/operations/queries.js.map +1 -1
  75. package/dist/index.d.ts +1 -1
  76. package/dist/index.js +2 -2
  77. package/dist/index.js.map +1 -1
  78. package/dist/init-rules.d.ts.map +1 -1
  79. package/dist/init-rules.js +0 -1
  80. package/dist/init-rules.js.map +1 -1
  81. package/dist/knexfile.d.ts.map +1 -1
  82. package/dist/knexfile.js +2 -1
  83. package/dist/knexfile.js.map +1 -1
  84. package/dist/migration/local-to-global.d.ts +19 -0
  85. package/dist/migration/local-to-global.d.ts.map +1 -0
  86. package/dist/migration/local-to-global.js +133 -0
  87. package/dist/migration/local-to-global.js.map +1 -0
  88. package/dist/saas-connector/client/types.d.ts +1 -1
  89. package/dist/saas-connector/client/types.d.ts.map +1 -1
  90. package/dist/schema.js +1 -1
  91. package/dist/server/setup.d.ts.map +1 -1
  92. package/dist/server/setup.js +15 -7
  93. package/dist/server/setup.js.map +1 -1
  94. package/dist/tests/backend/backend-factory.test.js +2 -2
  95. package/dist/tests/backend/backend-factory.test.js.map +1 -1
  96. package/dist/tests/docker/native/constraint-operations.test.d.ts +2 -17
  97. package/dist/tests/docker/native/constraint-operations.test.d.ts.map +1 -1
  98. package/dist/tests/docker/native/constraint-operations.test.js +3 -82
  99. package/dist/tests/docker/native/constraint-operations.test.js.map +1 -1
  100. package/dist/tests/docker/native/db-init.d.ts +3 -34
  101. package/dist/tests/docker/native/db-init.d.ts.map +1 -1
  102. package/dist/tests/docker/native/db-init.js +15 -77
  103. package/dist/tests/docker/native/db-init.js.map +1 -1
  104. package/dist/tests/docker/native/decision-operations.test.d.ts +2 -10
  105. package/dist/tests/docker/native/decision-operations.test.d.ts.map +1 -1
  106. package/dist/tests/docker/native/decision-operations.test.js +2 -84
  107. package/dist/tests/docker/native/decision-operations.test.js.map +1 -1
  108. package/dist/tests/docker/native/help-system.test.d.ts +2 -5
  109. package/dist/tests/docker/native/help-system.test.d.ts.map +1 -1
  110. package/dist/tests/docker/native/help-system.test.js +2 -47
  111. package/dist/tests/docker/native/help-system.test.js.map +1 -1
  112. package/dist/tests/docker/native/suggest-tool.test.d.ts +3 -11
  113. package/dist/tests/docker/native/suggest-tool.test.d.ts.map +1 -1
  114. package/dist/tests/docker/native/suggest-tool.test.js +3 -60
  115. package/dist/tests/docker/native/suggest-tool.test.js.map +1 -1
  116. package/dist/tests/docker/native/test-harness.d.ts +2 -23
  117. package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
  118. package/dist/tests/docker/native/test-harness.js +5 -59
  119. package/dist/tests/docker/native/test-harness.js.map +1 -1
  120. package/dist/tests/feature/decision/analytics.test.js +2 -1
  121. package/dist/tests/feature/decision/analytics.test.js.map +1 -1
  122. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js +2 -7
  123. package/dist/tests/feature/decision/batch-validation-comprehensive.test.js.map +1 -1
  124. package/dist/tests/feature/decision/batch-validation.test.js +2 -1
  125. package/dist/tests/feature/decision/batch-validation.test.js.map +1 -1
  126. package/dist/tests/integration/auto-trigger-suggestions.test.js +4 -37
  127. package/dist/tests/integration/auto-trigger-suggestions.test.js.map +1 -1
  128. package/dist/tests/integration/hybrid-similarity-detection.test.js +2 -1
  129. package/dist/tests/integration/hybrid-similarity-detection.test.js.map +1 -1
  130. package/dist/tests/integration/json-export-import.test.d.ts.map +1 -0
  131. package/dist/tests/integration/json-export-import.test.js.map +1 -0
  132. package/dist/tests/unit/case-insensitive-validator.test.d.ts +0 -7
  133. package/dist/tests/unit/case-insensitive-validator.test.d.ts.map +1 -1
  134. package/dist/tests/unit/case-insensitive-validator.test.js +0 -22
  135. package/dist/tests/unit/case-insensitive-validator.test.js.map +1 -1
  136. package/dist/tests/unit/config/cloud-config-loader.test.js +4 -2
  137. package/dist/tests/unit/config/cloud-config-loader.test.js.map +1 -1
  138. package/dist/tests/unit/config/global-db-migration.test.d.ts +12 -0
  139. package/dist/tests/unit/config/global-db-migration.test.d.ts.map +1 -0
  140. package/dist/tests/unit/config/global-db-migration.test.js +117 -0
  141. package/dist/tests/unit/config/global-db-migration.test.js.map +1 -0
  142. package/dist/tests/unit/constraint-scorer.test.d.ts +2 -7
  143. package/dist/tests/unit/constraint-scorer.test.d.ts.map +1 -1
  144. package/dist/tests/unit/constraint-scorer.test.js +2 -28
  145. package/dist/tests/unit/constraint-scorer.test.js.map +1 -1
  146. package/dist/tests/unit/universal-knex.test.js +9 -0
  147. package/dist/tests/unit/universal-knex.test.js.map +1 -1
  148. package/dist/tests/unit/validation/parameter-validation.test.js +0 -24
  149. package/dist/tests/unit/validation/parameter-validation.test.js.map +1 -1
  150. package/dist/tests/utils/db-config.d.ts.map +1 -1
  151. package/dist/tests/utils/db-config.js +0 -9
  152. package/dist/tests/utils/db-config.js.map +1 -1
  153. package/dist/tests/utils/db-import.d.ts.map +1 -1
  154. package/dist/tests/utils/db-import.js +0 -3
  155. package/dist/tests/utils/db-import.js.map +1 -1
  156. package/dist/tests/utils/db-schema.d.ts.map +1 -1
  157. package/dist/tests/utils/db-schema.js +48 -51
  158. package/dist/tests/utils/db-schema.js.map +1 -1
  159. package/dist/tests/utils/db-seeding.d.ts.map +1 -1
  160. package/dist/tests/utils/db-seeding.js +0 -3
  161. package/dist/tests/utils/db-seeding.js.map +1 -1
  162. package/dist/tests/utils/index.d.ts +0 -1
  163. package/dist/tests/utils/index.d.ts.map +1 -1
  164. package/dist/tests/utils/index.js +0 -2
  165. package/dist/tests/utils/index.js.map +1 -1
  166. package/dist/tests/utils/test-helpers.d.ts +6 -76
  167. package/dist/tests/utils/test-helpers.d.ts.map +1 -1
  168. package/dist/tests/utils/test-helpers.js +56 -162
  169. package/dist/tests/utils/test-helpers.js.map +1 -1
  170. package/dist/tests/utils/test-lifecycle.d.ts +2 -28
  171. package/dist/tests/utils/test-lifecycle.d.ts.map +1 -1
  172. package/dist/tests/utils/test-lifecycle.js +2 -31
  173. package/dist/tests/utils/test-lifecycle.js.map +1 -1
  174. package/dist/tools/context/index.d.ts +0 -1
  175. package/dist/tools/context/index.d.ts.map +1 -1
  176. package/dist/tools/context/index.js +0 -2
  177. package/dist/tools/context/index.js.map +1 -1
  178. package/dist/tools/context/types.d.ts +1 -1
  179. package/dist/tools/context/types.d.ts.map +1 -1
  180. package/dist/types/actions.d.ts +6 -29
  181. package/dist/types/actions.d.ts.map +1 -1
  182. package/dist/types/actions.js +1 -2
  183. package/dist/types/actions.js.map +1 -1
  184. package/dist/types/constraint/params.d.ts +24 -1
  185. package/dist/types/constraint/params.d.ts.map +1 -1
  186. package/dist/types/constraint/params.js +3 -0
  187. package/dist/types/constraint/params.js.map +1 -1
  188. package/dist/types/constraint/responses.d.ts +18 -1
  189. package/dist/types/constraint/responses.d.ts.map +1 -1
  190. package/dist/types/constraint/responses.js +3 -0
  191. package/dist/types/constraint/responses.js.map +1 -1
  192. package/dist/types/decision/batch.d.ts +2 -5
  193. package/dist/types/decision/batch.d.ts.map +1 -1
  194. package/dist/types/decision/batch.js +3 -3
  195. package/dist/types/decision/batch.js.map +1 -1
  196. package/dist/types/decision/params.d.ts +7 -4
  197. package/dist/types/decision/params.d.ts.map +1 -1
  198. package/dist/types/decision/responses.d.ts +49 -35
  199. package/dist/types/decision/responses.d.ts.map +1 -1
  200. package/dist/types/decision/templates.d.ts +2 -18
  201. package/dist/types/decision/templates.d.ts.map +1 -1
  202. package/dist/types/decision/templates.js +3 -3
  203. package/dist/types/decision/templates.js.map +1 -1
  204. package/dist/types/enums.d.ts +11 -13
  205. package/dist/types/enums.d.ts.map +1 -1
  206. package/dist/types/enums.js +5 -13
  207. package/dist/types/enums.js.map +1 -1
  208. package/dist/types/import-export.d.ts +7 -30
  209. package/dist/types/import-export.d.ts.map +1 -1
  210. package/dist/types/import-export.js +1 -2
  211. package/dist/types/import-export.js.map +1 -1
  212. package/dist/types/index.d.ts +18 -22
  213. package/dist/types/index.d.ts.map +1 -1
  214. package/dist/types/index.js +4 -32
  215. package/dist/types/index.js.map +1 -1
  216. package/dist/types/master-entities.d.ts +1 -10
  217. package/dist/types/master-entities.d.ts.map +1 -1
  218. package/dist/types/master-entities.js +1 -2
  219. package/dist/types/master-entities.js.map +1 -1
  220. package/dist/types/transaction-entities.d.ts +2 -21
  221. package/dist/types/transaction-entities.d.ts.map +1 -1
  222. package/dist/types/transaction-entities.js +1 -1
  223. package/dist/types/validation.d.ts +1 -16
  224. package/dist/types/validation.d.ts.map +1 -1
  225. package/dist/types/validation.js +1 -2
  226. package/dist/types/validation.js.map +1 -1
  227. package/dist/types/view-entities.d.ts +3 -12
  228. package/dist/types/view-entities.d.ts.map +1 -1
  229. package/dist/types/view-entities.js +1 -1
  230. package/dist/types.d.ts +4 -718
  231. package/dist/types.d.ts.map +1 -1
  232. package/dist/types.js +5 -39
  233. package/dist/types.js.map +1 -1
  234. package/dist/utils/parameter-validator.d.ts +2 -2
  235. package/dist/utils/parameter-validator.d.ts.map +1 -1
  236. package/dist/utils/parameter-validator.js.map +1 -1
  237. package/docs/CLI_USAGE.md +27 -107
  238. package/docs/CONFIGURATION.md +10 -5
  239. package/docs/DATABASE_AUTH.md +3 -3
  240. package/docs/MIGRATION_TO_SAAS.md +2 -2
  241. package/docs/SHARED_DATABASE.md +108 -0
  242. package/package.json +4 -3
  243. package/dist/adapters/auth/auth-types.d.ts +0 -30
  244. package/dist/adapters/auth/auth-types.d.ts.map +0 -1
  245. package/dist/adapters/auth/auth-types.js +0 -30
  246. package/dist/adapters/auth/auth-types.js.map +0 -1
  247. package/dist/cli/db-dump.d.ts +0 -36
  248. package/dist/cli/db-dump.d.ts.map +0 -1
  249. package/dist/cli/db-dump.js +0 -384
  250. package/dist/cli/db-dump.js.map +0 -1
  251. package/dist/database/config/config-ops.d.ts +0 -42
  252. package/dist/database/config/config-ops.d.ts.map +0 -1
  253. package/dist/database/config/config-ops.js +0 -102
  254. package/dist/database/config/config-ops.js.map +0 -1
  255. package/dist/formatters/adr-formatter.d.ts +0 -22
  256. package/dist/formatters/adr-formatter.d.ts.map +0 -1
  257. package/dist/formatters/adr-formatter.js +0 -127
  258. package/dist/formatters/adr-formatter.js.map +0 -1
  259. package/dist/formatters/confluence-formatter.d.ts +0 -26
  260. package/dist/formatters/confluence-formatter.d.ts.map +0 -1
  261. package/dist/formatters/confluence-formatter.js +0 -129
  262. package/dist/formatters/confluence-formatter.js.map +0 -1
  263. package/dist/formatters/index.d.ts +0 -34
  264. package/dist/formatters/index.d.ts.map +0 -1
  265. package/dist/formatters/index.js +0 -57
  266. package/dist/formatters/index.js.map +0 -1
  267. package/dist/formatters/markdown-formatter.d.ts +0 -16
  268. package/dist/formatters/markdown-formatter.d.ts.map +0 -1
  269. package/dist/formatters/markdown-formatter.js +0 -110
  270. package/dist/formatters/markdown-formatter.js.map +0 -1
  271. package/dist/formatters/notion-formatter.d.ts +0 -29
  272. package/dist/formatters/notion-formatter.d.ts.map +0 -1
  273. package/dist/formatters/notion-formatter.js +0 -177
  274. package/dist/formatters/notion-formatter.js.map +0 -1
  275. package/dist/formatters/types.d.ts +0 -31
  276. package/dist/formatters/types.d.ts.map +0 -1
  277. package/dist/formatters/types.js +0 -6
  278. package/dist/formatters/types.js.map +0 -1
  279. package/dist/tests/database/sql-dump/converters.test.d.ts +0 -7
  280. package/dist/tests/database/sql-dump/converters.test.d.ts.map +0 -1
  281. package/dist/tests/database/sql-dump/converters.test.js +0 -314
  282. package/dist/tests/database/sql-dump/converters.test.js.map +0 -1
  283. package/dist/tests/database/sql-dump/default-conversions.test.d.ts +0 -8
  284. package/dist/tests/database/sql-dump/default-conversions.test.d.ts.map +0 -1
  285. package/dist/tests/database/sql-dump/default-conversions.test.js +0 -141
  286. package/dist/tests/database/sql-dump/default-conversions.test.js.map +0 -1
  287. package/dist/tests/database/sql-dump/table-ordering.test.d.ts +0 -27
  288. package/dist/tests/database/sql-dump/table-ordering.test.d.ts.map +0 -1
  289. package/dist/tests/database/sql-dump/table-ordering.test.js +0 -284
  290. package/dist/tests/database/sql-dump/table-ordering.test.js.map +0 -1
  291. package/dist/tests/database/sql-dump/type-conversion.test.d.ts +0 -8
  292. package/dist/tests/database/sql-dump/type-conversion.test.d.ts.map +0 -1
  293. package/dist/tests/database/sql-dump/type-conversion.test.js +0 -361
  294. package/dist/tests/database/sql-dump/type-conversion.test.js.map +0 -1
  295. package/dist/tests/docker/cross-database.test.d.ts +0 -21
  296. package/dist/tests/docker/cross-database.test.d.ts.map +0 -1
  297. package/dist/tests/docker/cross-database.test.js +0 -308
  298. package/dist/tests/docker/cross-database.test.js.map +0 -1
  299. package/dist/tests/docker/dump-import.test.d.ts +0 -15
  300. package/dist/tests/docker/dump-import.test.d.ts.map +0 -1
  301. package/dist/tests/docker/dump-import.test.js +0 -424
  302. package/dist/tests/docker/dump-import.test.js.map +0 -1
  303. package/dist/tests/docker/fk-constraints.test.d.ts +0 -13
  304. package/dist/tests/docker/fk-constraints.test.d.ts.map +0 -1
  305. package/dist/tests/docker/fk-constraints.test.js +0 -381
  306. package/dist/tests/docker/fk-constraints.test.js.map +0 -1
  307. package/dist/tests/docker/indexes.test.d.ts +0 -12
  308. package/dist/tests/docker/indexes.test.d.ts.map +0 -1
  309. package/dist/tests/docker/indexes.test.js +0 -250
  310. package/dist/tests/docker/indexes.test.js.map +0 -1
  311. package/dist/tests/docker/integration.test.d.ts +0 -16
  312. package/dist/tests/docker/integration.test.d.ts.map +0 -1
  313. package/dist/tests/docker/integration.test.js +0 -323
  314. package/dist/tests/docker/integration.test.js.map +0 -1
  315. package/dist/tests/docker/multi-project-migration.test.d.ts +0 -17
  316. package/dist/tests/docker/multi-project-migration.test.d.ts.map +0 -1
  317. package/dist/tests/docker/multi-project-migration.test.js +0 -394
  318. package/dist/tests/docker/multi-project-migration.test.js.map +0 -1
  319. package/dist/tests/docker/schema-migration.test.d.ts +0 -8
  320. package/dist/tests/docker/schema-migration.test.d.ts.map +0 -1
  321. package/dist/tests/docker/schema-migration.test.js +0 -98
  322. package/dist/tests/docker/schema-migration.test.js.map +0 -1
  323. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts +0 -5
  324. package/dist/tests/integration/e2e-workflow1-debug.test.d.ts.map +0 -1
  325. package/dist/tests/integration/e2e-workflow1-debug.test.js +0 -85
  326. package/dist/tests/integration/e2e-workflow1-debug.test.js.map +0 -1
  327. package/dist/tests/integration/suggest-simple.test.d.ts +0 -5
  328. package/dist/tests/integration/suggest-simple.test.d.ts.map +0 -1
  329. package/dist/tests/integration/suggest-simple.test.js +0 -90
  330. package/dist/tests/integration/suggest-simple.test.js.map +0 -1
  331. package/dist/tests/migrations/test-all-versions-real.d.ts +0 -8
  332. package/dist/tests/migrations/test-all-versions-real.d.ts.map +0 -1
  333. package/dist/tests/migrations/test-all-versions-real.js +0 -236
  334. package/dist/tests/migrations/test-all-versions-real.js.map +0 -1
  335. package/dist/tests/migrations/test-all-versions.d.ts +0 -14
  336. package/dist/tests/migrations/test-all-versions.d.ts.map +0 -1
  337. package/dist/tests/migrations/test-all-versions.js +0 -519
  338. package/dist/tests/migrations/test-all-versions.js.map +0 -1
  339. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts +0 -7
  340. package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts.map +0 -1
  341. package/dist/tests/migrations/v4/v4-fresh-install.test.js +0 -168
  342. package/dist/tests/migrations/v4/v4-fresh-install.test.js.map +0 -1
  343. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts +0 -13
  344. package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts.map +0 -1
  345. package/dist/tests/migrations/v4/v4-migrate-data.test.js +0 -264
  346. package/dist/tests/migrations/v4/v4-migrate-data.test.js.map +0 -1
  347. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts +0 -2
  348. package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts.map +0 -1
  349. package/dist/tests/unit/utils/case-insensitive-validator.test.js +0 -97
  350. package/dist/tests/unit/utils/case-insensitive-validator.test.js.map +0 -1
  351. package/dist/tests/utils/json-export-import.test.d.ts.map +0 -1
  352. package/dist/tests/utils/json-export-import.test.js.map +0 -1
  353. package/dist/tests/utils/task-helpers.d.ts +0 -67
  354. package/dist/tests/utils/task-helpers.d.ts.map +0 -1
  355. package/dist/tests/utils/task-helpers.js +0 -134
  356. package/dist/tests/utils/task-helpers.js.map +0 -1
  357. package/dist/tools/context/actions/export.d.ts +0 -35
  358. package/dist/tools/context/actions/export.d.ts.map +0 -1
  359. package/dist/tools/context/actions/export.js +0 -93
  360. package/dist/tools/context/actions/export.js.map +0 -1
  361. package/dist/types/file/params.d.ts +0 -40
  362. package/dist/types/file/params.d.ts.map +0 -1
  363. package/dist/types/file/params.js +0 -6
  364. package/dist/types/file/params.js.map +0 -1
  365. package/dist/types/file/responses.d.ts +0 -2
  366. package/dist/types/file/responses.d.ts.map +0 -1
  367. package/dist/types/file/responses.js +0 -2
  368. package/dist/types/file/responses.js.map +0 -1
  369. package/dist/types/task/params.d.ts +0 -173
  370. package/dist/types/task/params.d.ts.map +0 -1
  371. package/dist/types/task/params.js +0 -8
  372. package/dist/types/task/params.js.map +0 -1
  373. package/dist/types/task/responses.d.ts +0 -334
  374. package/dist/types/task/responses.d.ts.map +0 -1
  375. package/dist/types/task/responses.js +0 -8
  376. package/dist/types/task/responses.js.map +0 -1
  377. package/dist/utils/sql-dump/core/dependency-sort.d.ts +0 -16
  378. package/dist/utils/sql-dump/core/dependency-sort.d.ts.map +0 -1
  379. package/dist/utils/sql-dump/core/dependency-sort.js +0 -105
  380. package/dist/utils/sql-dump/core/dependency-sort.js.map +0 -1
  381. package/dist/utils/sql-dump/core/generate-dump.d.ts +0 -13
  382. package/dist/utils/sql-dump/core/generate-dump.d.ts.map +0 -1
  383. package/dist/utils/sql-dump/core/generate-dump.js +0 -201
  384. package/dist/utils/sql-dump/core/generate-dump.js.map +0 -1
  385. package/dist/utils/sql-dump/core/index-export.d.ts +0 -10
  386. package/dist/utils/sql-dump/core/index-export.d.ts.map +0 -1
  387. package/dist/utils/sql-dump/core/index-export.js +0 -173
  388. package/dist/utils/sql-dump/core/index-export.js.map +0 -1
  389. package/dist/utils/sql-dump/core/sequence-reset.d.ts +0 -6
  390. package/dist/utils/sql-dump/core/sequence-reset.d.ts.map +0 -1
  391. package/dist/utils/sql-dump/core/sequence-reset.js +0 -28
  392. package/dist/utils/sql-dump/core/sequence-reset.js.map +0 -1
  393. package/dist/utils/sql-dump/core/table-export.d.ts +0 -2
  394. package/dist/utils/sql-dump/core/table-export.d.ts.map +0 -1
  395. package/dist/utils/sql-dump/core/table-export.js +0 -4
  396. package/dist/utils/sql-dump/core/table-export.js.map +0 -1
  397. package/dist/utils/sql-dump/core/view-export.d.ts +0 -2
  398. package/dist/utils/sql-dump/core/view-export.d.ts.map +0 -1
  399. package/dist/utils/sql-dump/core/view-export.js +0 -4
  400. package/dist/utils/sql-dump/core/view-export.js.map +0 -1
  401. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts +0 -14
  402. package/dist/utils/sql-dump/formatters/bulk-insert.d.ts.map +0 -1
  403. package/dist/utils/sql-dump/formatters/bulk-insert.js +0 -177
  404. package/dist/utils/sql-dump/formatters/bulk-insert.js.map +0 -1
  405. package/dist/utils/sql-dump/formatters/identifiers.d.ts +0 -6
  406. package/dist/utils/sql-dump/formatters/identifiers.d.ts.map +0 -1
  407. package/dist/utils/sql-dump/formatters/identifiers.js +0 -16
  408. package/dist/utils/sql-dump/formatters/identifiers.js.map +0 -1
  409. package/dist/utils/sql-dump/formatters/value-formatter.d.ts +0 -14
  410. package/dist/utils/sql-dump/formatters/value-formatter.d.ts.map +0 -1
  411. package/dist/utils/sql-dump/formatters/value-formatter.js +0 -281
  412. package/dist/utils/sql-dump/formatters/value-formatter.js.map +0 -1
  413. package/dist/utils/sql-dump/generators/controls.d.ts +0 -10
  414. package/dist/utils/sql-dump/generators/controls.d.ts.map +0 -1
  415. package/dist/utils/sql-dump/generators/controls.js +0 -36
  416. package/dist/utils/sql-dump/generators/controls.js.map +0 -1
  417. package/dist/utils/sql-dump/generators/headers.d.ts +0 -6
  418. package/dist/utils/sql-dump/generators/headers.d.ts.map +0 -1
  419. package/dist/utils/sql-dump/generators/headers.js +0 -19
  420. package/dist/utils/sql-dump/generators/headers.js.map +0 -1
  421. package/dist/utils/sql-dump/index.d.ts +0 -14
  422. package/dist/utils/sql-dump/index.d.ts.map +0 -1
  423. package/dist/utils/sql-dump/index.js +0 -16
  424. package/dist/utils/sql-dump/index.js.map +0 -1
  425. package/dist/utils/sql-dump/schema/indexes.d.ts +0 -20
  426. package/dist/utils/sql-dump/schema/indexes.d.ts.map +0 -1
  427. package/dist/utils/sql-dump/schema/indexes.js +0 -108
  428. package/dist/utils/sql-dump/schema/indexes.js.map +0 -1
  429. package/dist/utils/sql-dump/schema/primary-keys.d.ts +0 -6
  430. package/dist/utils/sql-dump/schema/primary-keys.d.ts.map +0 -1
  431. package/dist/utils/sql-dump/schema/primary-keys.js +0 -41
  432. package/dist/utils/sql-dump/schema/primary-keys.js.map +0 -1
  433. package/dist/utils/sql-dump/schema/tables.d.ts +0 -15
  434. package/dist/utils/sql-dump/schema/tables.d.ts.map +0 -1
  435. package/dist/utils/sql-dump/schema/tables.js +0 -518
  436. package/dist/utils/sql-dump/schema/tables.js.map +0 -1
  437. package/dist/utils/sql-dump/schema/views.d.ts +0 -11
  438. package/dist/utils/sql-dump/schema/views.d.ts.map +0 -1
  439. package/dist/utils/sql-dump/schema/views.js +0 -116
  440. package/dist/utils/sql-dump/schema/views.js.map +0 -1
  441. package/dist/utils/sql-dump/types.d.ts +0 -10
  442. package/dist/utils/sql-dump/types.d.ts.map +0 -1
  443. package/dist/utils/sql-dump/types.js +0 -3
  444. package/dist/utils/sql-dump/types.js.map +0 -1
  445. package/dist/utils/sql-dump-converters.d.ts +0 -188
  446. package/dist/utils/sql-dump-converters.d.ts.map +0 -1
  447. package/dist/utils/sql-dump-converters.js +0 -315
  448. package/dist/utils/sql-dump-converters.js.map +0 -1
  449. package/dist/watcher/gitignore-parser.d.ts +0 -70
  450. package/dist/watcher/gitignore-parser.d.ts.map +0 -1
  451. package/dist/watcher/gitignore-parser.js +0 -195
  452. package/dist/watcher/gitignore-parser.js.map +0 -1
  453. package/dist/watcher/index.d.ts +0 -9
  454. package/dist/watcher/index.d.ts.map +0 -1
  455. package/dist/watcher/index.js +0 -8
  456. package/dist/watcher/index.js.map +0 -1
  457. /package/dist/tests/{utils → integration}/json-export-import.test.d.ts +0 -0
  458. /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