@tryfinch/finch-api-mcp 6.26.0 → 6.28.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 (474) hide show
  1. package/README.md +53 -1
  2. package/compat.d.mts +52 -0
  3. package/compat.d.mts.map +1 -0
  4. package/compat.d.ts +52 -0
  5. package/compat.d.ts.map +1 -0
  6. package/compat.js +342 -0
  7. package/compat.js.map +1 -0
  8. package/compat.mjs +332 -0
  9. package/compat.mjs.map +1 -0
  10. package/compat.test.d.mts +2 -0
  11. package/compat.test.d.mts.map +1 -0
  12. package/compat.test.d.ts +2 -0
  13. package/compat.test.d.ts.map +1 -0
  14. package/compat.test.js +950 -0
  15. package/compat.test.js.map +1 -0
  16. package/compat.test.mjs +948 -0
  17. package/compat.test.mjs.map +1 -0
  18. package/index.js +37 -110
  19. package/index.js.map +1 -1
  20. package/index.mjs +37 -107
  21. package/index.mjs.map +1 -1
  22. package/options.d.mts +9 -0
  23. package/options.d.mts.map +1 -0
  24. package/options.d.ts +9 -0
  25. package/options.d.ts.map +1 -0
  26. package/options.js +320 -0
  27. package/options.js.map +1 -0
  28. package/options.mjs +314 -0
  29. package/options.mjs.map +1 -0
  30. package/options.test.d.mts +2 -0
  31. package/options.test.d.mts.map +1 -0
  32. package/options.test.d.ts +2 -0
  33. package/options.test.d.ts.map +1 -0
  34. package/options.test.js +154 -0
  35. package/options.test.js.map +1 -0
  36. package/options.test.mjs +152 -0
  37. package/options.test.mjs.map +1 -0
  38. package/package.json +2 -2
  39. package/server.d.mts +3 -1
  40. package/server.d.mts.map +1 -1
  41. package/server.d.ts +3 -1
  42. package/server.d.ts.map +1 -1
  43. package/server.js +15 -11
  44. package/server.js.map +1 -1
  45. package/server.mjs +12 -8
  46. package/server.mjs.map +1 -1
  47. package/src/compat.test.ts +1068 -0
  48. package/src/compat.ts +429 -0
  49. package/src/index.ts +38 -122
  50. package/src/options.test.ts +193 -0
  51. package/src/options.ts +339 -0
  52. package/src/server.ts +15 -10
  53. package/src/tools/access-tokens/create-access-tokens.ts +2 -2
  54. package/src/tools/account/disconnect-account.ts +1 -2
  55. package/src/tools/account/introspect-account.ts +1 -2
  56. package/src/tools/connect/sessions/new-connect-sessions.ts +2 -2
  57. package/src/tools/connect/sessions/reauthenticate-connect-sessions.ts +2 -2
  58. package/src/tools/hris/benefits/create-hris-benefits.ts +38 -3
  59. package/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts +2 -2
  60. package/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts +2 -2
  61. package/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts +2 -2
  62. package/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts +2 -2
  63. package/src/tools/hris/benefits/list-hris-benefits.ts +1 -2
  64. package/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts +1 -2
  65. package/src/tools/hris/benefits/retrieve-hris-benefits.ts +2 -2
  66. package/src/tools/hris/benefits/update-hris-benefits.ts +2 -2
  67. package/src/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.ts +2 -2
  68. package/src/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.ts +2 -2
  69. package/src/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.ts +2 -2
  70. package/src/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.ts +1 -2
  71. package/src/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.ts +2 -2
  72. package/src/tools/hris/company/retrieve-hris-company.ts +1 -2
  73. package/src/tools/hris/directory/list-hris-directory.ts +2 -2
  74. package/src/tools/hris/directory/list-individuals-hris-directory.ts +2 -2
  75. package/src/tools/hris/documents/list-hris-documents.ts +2 -2
  76. package/src/tools/hris/documents/retreive-hris-documents.ts +2 -2
  77. package/src/tools/hris/employments/retrieve-many-hris-employments.ts +2 -2
  78. package/src/tools/hris/individuals/retrieve-many-hris-individuals.ts +2 -2
  79. package/src/tools/hris/pay-statements/retrieve-many-hris-pay-statements.ts +2 -2
  80. package/src/tools/hris/payments/list-hris-payments.ts +2 -2
  81. package/src/tools/index.ts +16 -2
  82. package/src/tools/jobs/automated/create-jobs-automated.ts +2 -2
  83. package/src/tools/jobs/automated/list-jobs-automated.ts +2 -2
  84. package/src/tools/jobs/automated/retrieve-jobs-automated.ts +2 -2
  85. package/src/tools/jobs/manual/retrieve-jobs-manual.ts +2 -2
  86. package/src/tools/payroll/pay-groups/list-payroll-pay-groups.ts +2 -2
  87. package/src/tools/payroll/pay-groups/retrieve-payroll-pay-groups.ts +2 -2
  88. package/src/tools/providers/list-providers.ts +1 -2
  89. package/src/tools/request-forwarding/forward-request-forwarding.ts +2 -2
  90. package/src/tools/sandbox/company/update-sandbox-company.ts +42 -37
  91. package/src/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.ts +2 -2
  92. package/src/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.ts +7 -2
  93. package/src/tools/sandbox/connections/create-sandbox-connections.ts +2 -2
  94. package/src/tools/sandbox/directory/create-sandbox-directory.ts +82 -74
  95. package/src/tools/sandbox/employment/update-sandbox-employment.ts +62 -54
  96. package/src/tools/sandbox/individual/update-sandbox-individual.ts +19 -14
  97. package/src/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.ts +1 -2
  98. package/src/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.ts +2 -2
  99. package/src/tools/sandbox/jobs/create-sandbox-jobs.ts +2 -2
  100. package/src/tools/sandbox/payment/create-sandbox-payment.ts +48 -40
  101. package/tools/access-tokens/create-access-tokens.d.mts +2 -2
  102. package/tools/access-tokens/create-access-tokens.d.mts.map +1 -1
  103. package/tools/access-tokens/create-access-tokens.d.ts +2 -2
  104. package/tools/access-tokens/create-access-tokens.d.ts.map +1 -1
  105. package/tools/access-tokens/create-access-tokens.js +1 -1
  106. package/tools/access-tokens/create-access-tokens.js.map +1 -1
  107. package/tools/access-tokens/create-access-tokens.mjs +1 -1
  108. package/tools/access-tokens/create-access-tokens.mjs.map +1 -1
  109. package/tools/account/disconnect-account.d.mts +2 -2
  110. package/tools/account/disconnect-account.d.mts.map +1 -1
  111. package/tools/account/disconnect-account.d.ts +2 -2
  112. package/tools/account/disconnect-account.d.ts.map +1 -1
  113. package/tools/account/disconnect-account.js +0 -1
  114. package/tools/account/disconnect-account.js.map +1 -1
  115. package/tools/account/disconnect-account.mjs +0 -1
  116. package/tools/account/disconnect-account.mjs.map +1 -1
  117. package/tools/account/introspect-account.d.mts +2 -2
  118. package/tools/account/introspect-account.d.mts.map +1 -1
  119. package/tools/account/introspect-account.d.ts +2 -2
  120. package/tools/account/introspect-account.d.ts.map +1 -1
  121. package/tools/account/introspect-account.js +0 -1
  122. package/tools/account/introspect-account.js.map +1 -1
  123. package/tools/account/introspect-account.mjs +0 -1
  124. package/tools/account/introspect-account.mjs.map +1 -1
  125. package/tools/connect/sessions/new-connect-sessions.d.mts +2 -2
  126. package/tools/connect/sessions/new-connect-sessions.d.mts.map +1 -1
  127. package/tools/connect/sessions/new-connect-sessions.d.ts +2 -2
  128. package/tools/connect/sessions/new-connect-sessions.d.ts.map +1 -1
  129. package/tools/connect/sessions/new-connect-sessions.js +1 -1
  130. package/tools/connect/sessions/new-connect-sessions.js.map +1 -1
  131. package/tools/connect/sessions/new-connect-sessions.mjs +1 -1
  132. package/tools/connect/sessions/new-connect-sessions.mjs.map +1 -1
  133. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts +2 -2
  134. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts.map +1 -1
  135. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts +2 -2
  136. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts.map +1 -1
  137. package/tools/connect/sessions/reauthenticate-connect-sessions.js +1 -1
  138. package/tools/connect/sessions/reauthenticate-connect-sessions.js.map +1 -1
  139. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs +1 -1
  140. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs.map +1 -1
  141. package/tools/hris/benefits/create-hris-benefits.d.mts +2 -2
  142. package/tools/hris/benefits/create-hris-benefits.d.mts.map +1 -1
  143. package/tools/hris/benefits/create-hris-benefits.d.ts +2 -2
  144. package/tools/hris/benefits/create-hris-benefits.d.ts.map +1 -1
  145. package/tools/hris/benefits/create-hris-benefits.js +37 -2
  146. package/tools/hris/benefits/create-hris-benefits.js.map +1 -1
  147. package/tools/hris/benefits/create-hris-benefits.mjs +37 -2
  148. package/tools/hris/benefits/create-hris-benefits.mjs.map +1 -1
  149. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts +2 -2
  150. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts.map +1 -1
  151. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts +2 -2
  152. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts.map +1 -1
  153. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js.map +1 -1
  154. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs.map +1 -1
  155. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts +2 -2
  156. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts.map +1 -1
  157. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts +2 -2
  158. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts.map +1 -1
  159. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js +1 -1
  160. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js.map +1 -1
  161. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs +1 -1
  162. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs.map +1 -1
  163. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts +2 -2
  164. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts.map +1 -1
  165. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts +2 -2
  166. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts.map +1 -1
  167. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js.map +1 -1
  168. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs.map +1 -1
  169. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts +2 -2
  170. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts.map +1 -1
  171. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts +2 -2
  172. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts.map +1 -1
  173. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js.map +1 -1
  174. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs.map +1 -1
  175. package/tools/hris/benefits/list-hris-benefits.d.mts +2 -2
  176. package/tools/hris/benefits/list-hris-benefits.d.mts.map +1 -1
  177. package/tools/hris/benefits/list-hris-benefits.d.ts +2 -2
  178. package/tools/hris/benefits/list-hris-benefits.d.ts.map +1 -1
  179. package/tools/hris/benefits/list-hris-benefits.js +0 -1
  180. package/tools/hris/benefits/list-hris-benefits.js.map +1 -1
  181. package/tools/hris/benefits/list-hris-benefits.mjs +0 -1
  182. package/tools/hris/benefits/list-hris-benefits.mjs.map +1 -1
  183. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts +2 -2
  184. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts.map +1 -1
  185. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts +2 -2
  186. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts.map +1 -1
  187. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js +0 -1
  188. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js.map +1 -1
  189. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs +0 -1
  190. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs.map +1 -1
  191. package/tools/hris/benefits/retrieve-hris-benefits.d.mts +2 -2
  192. package/tools/hris/benefits/retrieve-hris-benefits.d.mts.map +1 -1
  193. package/tools/hris/benefits/retrieve-hris-benefits.d.ts +2 -2
  194. package/tools/hris/benefits/retrieve-hris-benefits.d.ts.map +1 -1
  195. package/tools/hris/benefits/retrieve-hris-benefits.js +1 -1
  196. package/tools/hris/benefits/retrieve-hris-benefits.js.map +1 -1
  197. package/tools/hris/benefits/retrieve-hris-benefits.mjs +1 -1
  198. package/tools/hris/benefits/retrieve-hris-benefits.mjs.map +1 -1
  199. package/tools/hris/benefits/update-hris-benefits.d.mts +2 -2
  200. package/tools/hris/benefits/update-hris-benefits.d.mts.map +1 -1
  201. package/tools/hris/benefits/update-hris-benefits.d.ts +2 -2
  202. package/tools/hris/benefits/update-hris-benefits.d.ts.map +1 -1
  203. package/tools/hris/benefits/update-hris-benefits.js.map +1 -1
  204. package/tools/hris/benefits/update-hris-benefits.mjs.map +1 -1
  205. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts +2 -2
  206. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts.map +1 -1
  207. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts +2 -2
  208. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts.map +1 -1
  209. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js +1 -1
  210. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js.map +1 -1
  211. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs +1 -1
  212. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs.map +1 -1
  213. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts +2 -2
  214. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  215. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts +2 -2
  216. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  217. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js +1 -1
  218. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js.map +1 -1
  219. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs +1 -1
  220. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs.map +1 -1
  221. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts +2 -2
  222. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  223. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts +2 -2
  224. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  225. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js +1 -1
  226. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js.map +1 -1
  227. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs +1 -1
  228. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs.map +1 -1
  229. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts +2 -2
  230. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  231. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts +2 -2
  232. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  233. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js +0 -1
  234. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js.map +1 -1
  235. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs +0 -1
  236. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs.map +1 -1
  237. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts +2 -2
  238. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  239. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts +2 -2
  240. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  241. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js.map +1 -1
  242. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs.map +1 -1
  243. package/tools/hris/company/retrieve-hris-company.d.mts +2 -2
  244. package/tools/hris/company/retrieve-hris-company.d.mts.map +1 -1
  245. package/tools/hris/company/retrieve-hris-company.d.ts +2 -2
  246. package/tools/hris/company/retrieve-hris-company.d.ts.map +1 -1
  247. package/tools/hris/company/retrieve-hris-company.js +0 -1
  248. package/tools/hris/company/retrieve-hris-company.js.map +1 -1
  249. package/tools/hris/company/retrieve-hris-company.mjs +0 -1
  250. package/tools/hris/company/retrieve-hris-company.mjs.map +1 -1
  251. package/tools/hris/directory/list-hris-directory.d.mts +2 -2
  252. package/tools/hris/directory/list-hris-directory.d.mts.map +1 -1
  253. package/tools/hris/directory/list-hris-directory.d.ts +2 -2
  254. package/tools/hris/directory/list-hris-directory.d.ts.map +1 -1
  255. package/tools/hris/directory/list-hris-directory.js +1 -1
  256. package/tools/hris/directory/list-hris-directory.js.map +1 -1
  257. package/tools/hris/directory/list-hris-directory.mjs +1 -1
  258. package/tools/hris/directory/list-hris-directory.mjs.map +1 -1
  259. package/tools/hris/directory/list-individuals-hris-directory.d.mts +2 -2
  260. package/tools/hris/directory/list-individuals-hris-directory.d.mts.map +1 -1
  261. package/tools/hris/directory/list-individuals-hris-directory.d.ts +2 -2
  262. package/tools/hris/directory/list-individuals-hris-directory.d.ts.map +1 -1
  263. package/tools/hris/directory/list-individuals-hris-directory.js +1 -1
  264. package/tools/hris/directory/list-individuals-hris-directory.js.map +1 -1
  265. package/tools/hris/directory/list-individuals-hris-directory.mjs +1 -1
  266. package/tools/hris/directory/list-individuals-hris-directory.mjs.map +1 -1
  267. package/tools/hris/documents/list-hris-documents.d.mts +2 -2
  268. package/tools/hris/documents/list-hris-documents.d.mts.map +1 -1
  269. package/tools/hris/documents/list-hris-documents.d.ts +2 -2
  270. package/tools/hris/documents/list-hris-documents.d.ts.map +1 -1
  271. package/tools/hris/documents/list-hris-documents.js +1 -1
  272. package/tools/hris/documents/list-hris-documents.js.map +1 -1
  273. package/tools/hris/documents/list-hris-documents.mjs +1 -1
  274. package/tools/hris/documents/list-hris-documents.mjs.map +1 -1
  275. package/tools/hris/documents/retreive-hris-documents.d.mts +2 -2
  276. package/tools/hris/documents/retreive-hris-documents.d.mts.map +1 -1
  277. package/tools/hris/documents/retreive-hris-documents.d.ts +2 -2
  278. package/tools/hris/documents/retreive-hris-documents.d.ts.map +1 -1
  279. package/tools/hris/documents/retreive-hris-documents.js +1 -1
  280. package/tools/hris/documents/retreive-hris-documents.js.map +1 -1
  281. package/tools/hris/documents/retreive-hris-documents.mjs +1 -1
  282. package/tools/hris/documents/retreive-hris-documents.mjs.map +1 -1
  283. package/tools/hris/employments/retrieve-many-hris-employments.d.mts +2 -2
  284. package/tools/hris/employments/retrieve-many-hris-employments.d.mts.map +1 -1
  285. package/tools/hris/employments/retrieve-many-hris-employments.d.ts +2 -2
  286. package/tools/hris/employments/retrieve-many-hris-employments.d.ts.map +1 -1
  287. package/tools/hris/employments/retrieve-many-hris-employments.js +1 -1
  288. package/tools/hris/employments/retrieve-many-hris-employments.js.map +1 -1
  289. package/tools/hris/employments/retrieve-many-hris-employments.mjs +1 -1
  290. package/tools/hris/employments/retrieve-many-hris-employments.mjs.map +1 -1
  291. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts +2 -2
  292. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts.map +1 -1
  293. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts +2 -2
  294. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts.map +1 -1
  295. package/tools/hris/individuals/retrieve-many-hris-individuals.js +1 -1
  296. package/tools/hris/individuals/retrieve-many-hris-individuals.js.map +1 -1
  297. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs +1 -1
  298. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs.map +1 -1
  299. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts +2 -2
  300. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts.map +1 -1
  301. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts +2 -2
  302. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts.map +1 -1
  303. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js +1 -1
  304. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js.map +1 -1
  305. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs +1 -1
  306. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs.map +1 -1
  307. package/tools/hris/payments/list-hris-payments.d.mts +2 -2
  308. package/tools/hris/payments/list-hris-payments.d.mts.map +1 -1
  309. package/tools/hris/payments/list-hris-payments.d.ts +2 -2
  310. package/tools/hris/payments/list-hris-payments.d.ts.map +1 -1
  311. package/tools/hris/payments/list-hris-payments.js +1 -1
  312. package/tools/hris/payments/list-hris-payments.js.map +1 -1
  313. package/tools/hris/payments/list-hris-payments.mjs +1 -1
  314. package/tools/hris/payments/list-hris-payments.mjs.map +1 -1
  315. package/tools/index.d.mts +1 -1
  316. package/tools/index.d.mts.map +1 -1
  317. package/tools/index.d.ts +1 -1
  318. package/tools/index.d.ts.map +1 -1
  319. package/tools/index.js +12 -3
  320. package/tools/index.js.map +1 -1
  321. package/tools/index.mjs +10 -1
  322. package/tools/index.mjs.map +1 -1
  323. package/tools/jobs/automated/create-jobs-automated.d.mts +2 -2
  324. package/tools/jobs/automated/create-jobs-automated.d.mts.map +1 -1
  325. package/tools/jobs/automated/create-jobs-automated.d.ts +2 -2
  326. package/tools/jobs/automated/create-jobs-automated.d.ts.map +1 -1
  327. package/tools/jobs/automated/create-jobs-automated.js +1 -1
  328. package/tools/jobs/automated/create-jobs-automated.js.map +1 -1
  329. package/tools/jobs/automated/create-jobs-automated.mjs +1 -1
  330. package/tools/jobs/automated/create-jobs-automated.mjs.map +1 -1
  331. package/tools/jobs/automated/list-jobs-automated.d.mts +2 -2
  332. package/tools/jobs/automated/list-jobs-automated.d.mts.map +1 -1
  333. package/tools/jobs/automated/list-jobs-automated.d.ts +2 -2
  334. package/tools/jobs/automated/list-jobs-automated.d.ts.map +1 -1
  335. package/tools/jobs/automated/list-jobs-automated.js +1 -1
  336. package/tools/jobs/automated/list-jobs-automated.js.map +1 -1
  337. package/tools/jobs/automated/list-jobs-automated.mjs +1 -1
  338. package/tools/jobs/automated/list-jobs-automated.mjs.map +1 -1
  339. package/tools/jobs/automated/retrieve-jobs-automated.d.mts +2 -2
  340. package/tools/jobs/automated/retrieve-jobs-automated.d.mts.map +1 -1
  341. package/tools/jobs/automated/retrieve-jobs-automated.d.ts +2 -2
  342. package/tools/jobs/automated/retrieve-jobs-automated.d.ts.map +1 -1
  343. package/tools/jobs/automated/retrieve-jobs-automated.js +1 -1
  344. package/tools/jobs/automated/retrieve-jobs-automated.js.map +1 -1
  345. package/tools/jobs/automated/retrieve-jobs-automated.mjs +1 -1
  346. package/tools/jobs/automated/retrieve-jobs-automated.mjs.map +1 -1
  347. package/tools/jobs/manual/retrieve-jobs-manual.d.mts +2 -2
  348. package/tools/jobs/manual/retrieve-jobs-manual.d.mts.map +1 -1
  349. package/tools/jobs/manual/retrieve-jobs-manual.d.ts +2 -2
  350. package/tools/jobs/manual/retrieve-jobs-manual.d.ts.map +1 -1
  351. package/tools/jobs/manual/retrieve-jobs-manual.js +1 -1
  352. package/tools/jobs/manual/retrieve-jobs-manual.js.map +1 -1
  353. package/tools/jobs/manual/retrieve-jobs-manual.mjs +1 -1
  354. package/tools/jobs/manual/retrieve-jobs-manual.mjs.map +1 -1
  355. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts +2 -2
  356. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts.map +1 -1
  357. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts +2 -2
  358. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts.map +1 -1
  359. package/tools/payroll/pay-groups/list-payroll-pay-groups.js +1 -1
  360. package/tools/payroll/pay-groups/list-payroll-pay-groups.js.map +1 -1
  361. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs +1 -1
  362. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs.map +1 -1
  363. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts +2 -2
  364. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts.map +1 -1
  365. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts +2 -2
  366. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts.map +1 -1
  367. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js +1 -1
  368. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js.map +1 -1
  369. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs +1 -1
  370. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs.map +1 -1
  371. package/tools/providers/list-providers.d.mts +2 -2
  372. package/tools/providers/list-providers.d.mts.map +1 -1
  373. package/tools/providers/list-providers.d.ts +2 -2
  374. package/tools/providers/list-providers.d.ts.map +1 -1
  375. package/tools/providers/list-providers.js +0 -1
  376. package/tools/providers/list-providers.js.map +1 -1
  377. package/tools/providers/list-providers.mjs +0 -1
  378. package/tools/providers/list-providers.mjs.map +1 -1
  379. package/tools/request-forwarding/forward-request-forwarding.d.mts +2 -2
  380. package/tools/request-forwarding/forward-request-forwarding.d.mts.map +1 -1
  381. package/tools/request-forwarding/forward-request-forwarding.d.ts +2 -2
  382. package/tools/request-forwarding/forward-request-forwarding.d.ts.map +1 -1
  383. package/tools/request-forwarding/forward-request-forwarding.js +1 -1
  384. package/tools/request-forwarding/forward-request-forwarding.js.map +1 -1
  385. package/tools/request-forwarding/forward-request-forwarding.mjs +1 -1
  386. package/tools/request-forwarding/forward-request-forwarding.mjs.map +1 -1
  387. package/tools/sandbox/company/update-sandbox-company.d.mts +2 -2
  388. package/tools/sandbox/company/update-sandbox-company.d.mts.map +1 -1
  389. package/tools/sandbox/company/update-sandbox-company.d.ts +2 -2
  390. package/tools/sandbox/company/update-sandbox-company.d.ts.map +1 -1
  391. package/tools/sandbox/company/update-sandbox-company.js +41 -36
  392. package/tools/sandbox/company/update-sandbox-company.js.map +1 -1
  393. package/tools/sandbox/company/update-sandbox-company.mjs +41 -36
  394. package/tools/sandbox/company/update-sandbox-company.mjs.map +1 -1
  395. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts +2 -2
  396. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts.map +1 -1
  397. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts +2 -2
  398. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts.map +1 -1
  399. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js +1 -1
  400. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js.map +1 -1
  401. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs +1 -1
  402. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs.map +1 -1
  403. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts +2 -2
  404. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts.map +1 -1
  405. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts +2 -2
  406. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts.map +1 -1
  407. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js +6 -1
  408. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js.map +1 -1
  409. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs +6 -1
  410. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs.map +1 -1
  411. package/tools/sandbox/connections/create-sandbox-connections.d.mts +2 -2
  412. package/tools/sandbox/connections/create-sandbox-connections.d.mts.map +1 -1
  413. package/tools/sandbox/connections/create-sandbox-connections.d.ts +2 -2
  414. package/tools/sandbox/connections/create-sandbox-connections.d.ts.map +1 -1
  415. package/tools/sandbox/connections/create-sandbox-connections.js +1 -1
  416. package/tools/sandbox/connections/create-sandbox-connections.js.map +1 -1
  417. package/tools/sandbox/connections/create-sandbox-connections.mjs +1 -1
  418. package/tools/sandbox/connections/create-sandbox-connections.mjs.map +1 -1
  419. package/tools/sandbox/directory/create-sandbox-directory.d.mts +2 -2
  420. package/tools/sandbox/directory/create-sandbox-directory.d.mts.map +1 -1
  421. package/tools/sandbox/directory/create-sandbox-directory.d.ts +2 -2
  422. package/tools/sandbox/directory/create-sandbox-directory.d.ts.map +1 -1
  423. package/tools/sandbox/directory/create-sandbox-directory.js +79 -71
  424. package/tools/sandbox/directory/create-sandbox-directory.js.map +1 -1
  425. package/tools/sandbox/directory/create-sandbox-directory.mjs +79 -71
  426. package/tools/sandbox/directory/create-sandbox-directory.mjs.map +1 -1
  427. package/tools/sandbox/employment/update-sandbox-employment.d.mts +2 -2
  428. package/tools/sandbox/employment/update-sandbox-employment.d.mts.map +1 -1
  429. package/tools/sandbox/employment/update-sandbox-employment.d.ts +2 -2
  430. package/tools/sandbox/employment/update-sandbox-employment.d.ts.map +1 -1
  431. package/tools/sandbox/employment/update-sandbox-employment.js +60 -52
  432. package/tools/sandbox/employment/update-sandbox-employment.js.map +1 -1
  433. package/tools/sandbox/employment/update-sandbox-employment.mjs +60 -52
  434. package/tools/sandbox/employment/update-sandbox-employment.mjs.map +1 -1
  435. package/tools/sandbox/individual/update-sandbox-individual.d.mts +2 -2
  436. package/tools/sandbox/individual/update-sandbox-individual.d.mts.map +1 -1
  437. package/tools/sandbox/individual/update-sandbox-individual.d.ts +2 -2
  438. package/tools/sandbox/individual/update-sandbox-individual.d.ts.map +1 -1
  439. package/tools/sandbox/individual/update-sandbox-individual.js +16 -11
  440. package/tools/sandbox/individual/update-sandbox-individual.js.map +1 -1
  441. package/tools/sandbox/individual/update-sandbox-individual.mjs +16 -11
  442. package/tools/sandbox/individual/update-sandbox-individual.mjs.map +1 -1
  443. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts +2 -2
  444. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts.map +1 -1
  445. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts +2 -2
  446. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts.map +1 -1
  447. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js +0 -1
  448. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js.map +1 -1
  449. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs +0 -1
  450. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs.map +1 -1
  451. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts +2 -2
  452. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts.map +1 -1
  453. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts +2 -2
  454. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts.map +1 -1
  455. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js +1 -1
  456. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js.map +1 -1
  457. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs +1 -1
  458. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs.map +1 -1
  459. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts +2 -2
  460. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts.map +1 -1
  461. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts +2 -2
  462. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts.map +1 -1
  463. package/tools/sandbox/jobs/create-sandbox-jobs.js +1 -1
  464. package/tools/sandbox/jobs/create-sandbox-jobs.js.map +1 -1
  465. package/tools/sandbox/jobs/create-sandbox-jobs.mjs +1 -1
  466. package/tools/sandbox/jobs/create-sandbox-jobs.mjs.map +1 -1
  467. package/tools/sandbox/payment/create-sandbox-payment.d.mts +2 -2
  468. package/tools/sandbox/payment/create-sandbox-payment.d.mts.map +1 -1
  469. package/tools/sandbox/payment/create-sandbox-payment.d.ts +2 -2
  470. package/tools/sandbox/payment/create-sandbox-payment.d.ts.map +1 -1
  471. package/tools/sandbox/payment/create-sandbox-payment.js +47 -39
  472. package/tools/sandbox/payment/create-sandbox-payment.js.map +1 -1
  473. package/tools/sandbox/payment/create-sandbox-payment.mjs +47 -39
  474. package/tools/sandbox/payment/create-sandbox-payment.mjs.map +1 -1
@@ -0,0 +1,948 @@
1
+ import { truncateToolNames, removeTopLevelUnions, removeAnyOf, inlineRefs, applyCompatibilityTransformations, removeFormats, } from "./compat.mjs";
2
+ describe('truncateToolNames', () => {
3
+ it('should return original names when maxLength is 0 or negative', () => {
4
+ const names = ['tool1', 'tool2', 'tool3'];
5
+ expect(truncateToolNames(names, 0)).toEqual(new Map());
6
+ expect(truncateToolNames(names, -1)).toEqual(new Map());
7
+ });
8
+ it('should return original names when all names are shorter than maxLength', () => {
9
+ const names = ['tool1', 'tool2', 'tool3'];
10
+ expect(truncateToolNames(names, 10)).toEqual(new Map());
11
+ });
12
+ it('should truncate names longer than maxLength', () => {
13
+ const names = ['very-long-tool-name', 'another-long-tool-name', 'short'];
14
+ expect(truncateToolNames(names, 10)).toEqual(new Map([
15
+ ['very-long-tool-name', 'very-long-'],
16
+ ['another-long-tool-name', 'another-lo'],
17
+ ]));
18
+ });
19
+ it('should handle duplicate truncated names by appending numbers', () => {
20
+ const names = ['tool-name-a', 'tool-name-b', 'tool-name-c'];
21
+ expect(truncateToolNames(names, 8)).toEqual(new Map([
22
+ ['tool-name-a', 'tool-na1'],
23
+ ['tool-name-b', 'tool-na2'],
24
+ ['tool-name-c', 'tool-na3'],
25
+ ]));
26
+ });
27
+ });
28
+ describe('removeTopLevelUnions', () => {
29
+ const createTestTool = (overrides = {}) => ({
30
+ name: 'test-tool',
31
+ description: 'Test tool',
32
+ inputSchema: {
33
+ type: 'object',
34
+ properties: {},
35
+ },
36
+ ...overrides,
37
+ });
38
+ it('should return the original tool if it has no anyOf at the top level', () => {
39
+ const tool = createTestTool({
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {
43
+ foo: { type: 'string' },
44
+ },
45
+ },
46
+ });
47
+ expect(removeTopLevelUnions(tool)).toEqual([tool]);
48
+ });
49
+ it('should split a tool with top-level anyOf into multiple tools', () => {
50
+ const tool = createTestTool({
51
+ name: 'union-tool',
52
+ description: 'A tool with unions',
53
+ inputSchema: {
54
+ type: 'object',
55
+ properties: {
56
+ common: { type: 'string' },
57
+ },
58
+ anyOf: [
59
+ {
60
+ title: 'first variant',
61
+ description: 'Its the first variant',
62
+ properties: {
63
+ variant1: { type: 'string' },
64
+ },
65
+ required: ['variant1'],
66
+ },
67
+ {
68
+ title: 'second variant',
69
+ properties: {
70
+ variant2: { type: 'number' },
71
+ },
72
+ required: ['variant2'],
73
+ },
74
+ ],
75
+ },
76
+ });
77
+ const result = removeTopLevelUnions(tool);
78
+ expect(result).toEqual([
79
+ {
80
+ name: 'union-tool_first_variant',
81
+ description: 'Its the first variant',
82
+ inputSchema: {
83
+ type: 'object',
84
+ title: 'first variant',
85
+ description: 'Its the first variant',
86
+ properties: {
87
+ common: { type: 'string' },
88
+ variant1: { type: 'string' },
89
+ },
90
+ required: ['variant1'],
91
+ },
92
+ },
93
+ {
94
+ name: 'union-tool_second_variant',
95
+ description: 'A tool with unions',
96
+ inputSchema: {
97
+ type: 'object',
98
+ title: 'second variant',
99
+ description: 'A tool with unions',
100
+ properties: {
101
+ common: { type: 'string' },
102
+ variant2: { type: 'number' },
103
+ },
104
+ required: ['variant2'],
105
+ },
106
+ },
107
+ ]);
108
+ });
109
+ it('should handle $defs and only include those used by the variant', () => {
110
+ const tool = createTestTool({
111
+ name: 'defs-tool',
112
+ description: 'A tool with $defs',
113
+ inputSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ common: { type: 'string' },
117
+ },
118
+ $defs: {
119
+ def1: { type: 'string', format: 'email' },
120
+ def2: { type: 'number', minimum: 0 },
121
+ unused: { type: 'boolean' },
122
+ },
123
+ anyOf: [
124
+ {
125
+ properties: {
126
+ email: { $ref: '#/$defs/def1' },
127
+ },
128
+ },
129
+ {
130
+ properties: {
131
+ count: { $ref: '#/$defs/def2' },
132
+ },
133
+ },
134
+ ],
135
+ },
136
+ });
137
+ const result = removeTopLevelUnions(tool);
138
+ expect(result).toEqual([
139
+ {
140
+ name: 'defs-tool_variant1',
141
+ description: 'A tool with $defs',
142
+ inputSchema: {
143
+ type: 'object',
144
+ description: 'A tool with $defs',
145
+ properties: {
146
+ common: { type: 'string' },
147
+ email: { $ref: '#/$defs/def1' },
148
+ },
149
+ $defs: {
150
+ def1: { type: 'string', format: 'email' },
151
+ },
152
+ },
153
+ },
154
+ {
155
+ name: 'defs-tool_variant2',
156
+ description: 'A tool with $defs',
157
+ inputSchema: {
158
+ type: 'object',
159
+ description: 'A tool with $defs',
160
+ properties: {
161
+ common: { type: 'string' },
162
+ count: { $ref: '#/$defs/def2' },
163
+ },
164
+ $defs: {
165
+ def2: { type: 'number', minimum: 0 },
166
+ },
167
+ },
168
+ },
169
+ ]);
170
+ });
171
+ });
172
+ describe('removeAnyOf', () => {
173
+ it('should return original schema if it has no anyOf', () => {
174
+ const schema = {
175
+ type: 'object',
176
+ properties: {
177
+ foo: { type: 'string' },
178
+ bar: { type: 'number' },
179
+ },
180
+ };
181
+ expect(removeAnyOf(schema)).toEqual(schema);
182
+ });
183
+ it('should remove anyOf field and use the first variant', () => {
184
+ const schema = {
185
+ type: 'object',
186
+ properties: {
187
+ common: { type: 'string' },
188
+ },
189
+ anyOf: [
190
+ {
191
+ properties: {
192
+ variant1: { type: 'string' },
193
+ },
194
+ required: ['variant1'],
195
+ },
196
+ {
197
+ properties: {
198
+ variant2: { type: 'number' },
199
+ },
200
+ required: ['variant2'],
201
+ },
202
+ ],
203
+ };
204
+ const expected = {
205
+ type: 'object',
206
+ properties: {
207
+ common: { type: 'string' },
208
+ variant1: { type: 'string' },
209
+ },
210
+ required: ['variant1'],
211
+ };
212
+ expect(removeAnyOf(schema)).toEqual(expected);
213
+ });
214
+ it('should recursively remove anyOf fields from nested properties', () => {
215
+ const schema = {
216
+ type: 'object',
217
+ properties: {
218
+ foo: { type: 'string' },
219
+ nested: {
220
+ type: 'object',
221
+ properties: {
222
+ bar: { type: 'number' },
223
+ },
224
+ anyOf: [
225
+ {
226
+ properties: {
227
+ option1: { type: 'boolean' },
228
+ },
229
+ },
230
+ {
231
+ properties: {
232
+ option2: { type: 'array' },
233
+ },
234
+ },
235
+ ],
236
+ },
237
+ },
238
+ };
239
+ const expected = {
240
+ type: 'object',
241
+ properties: {
242
+ foo: { type: 'string' },
243
+ nested: {
244
+ type: 'object',
245
+ properties: {
246
+ bar: { type: 'number' },
247
+ option1: { type: 'boolean' },
248
+ },
249
+ },
250
+ },
251
+ };
252
+ expect(removeAnyOf(schema)).toEqual(expected);
253
+ });
254
+ it('should handle arrays', () => {
255
+ const schema = {
256
+ type: 'object',
257
+ properties: {
258
+ items: {
259
+ type: 'array',
260
+ items: {
261
+ anyOf: [{ type: 'string' }, { type: 'number' }],
262
+ },
263
+ },
264
+ },
265
+ };
266
+ const expected = {
267
+ type: 'object',
268
+ properties: {
269
+ items: {
270
+ type: 'array',
271
+ items: {
272
+ type: 'string',
273
+ },
274
+ },
275
+ },
276
+ };
277
+ expect(removeAnyOf(schema)).toEqual(expected);
278
+ });
279
+ });
280
+ describe('inlineRefs', () => {
281
+ it('should return the original schema if it does not contain $refs', () => {
282
+ const schema = {
283
+ type: 'object',
284
+ properties: {
285
+ name: { type: 'string' },
286
+ age: { type: 'number' },
287
+ },
288
+ };
289
+ expect(inlineRefs(schema)).toEqual(schema);
290
+ });
291
+ it('should inline simple $refs', () => {
292
+ const schema = {
293
+ type: 'object',
294
+ properties: {
295
+ user: { $ref: '#/$defs/user' },
296
+ },
297
+ $defs: {
298
+ user: {
299
+ type: 'object',
300
+ properties: {
301
+ name: { type: 'string' },
302
+ email: { type: 'string' },
303
+ },
304
+ },
305
+ },
306
+ };
307
+ const expected = {
308
+ type: 'object',
309
+ properties: {
310
+ user: {
311
+ type: 'object',
312
+ properties: {
313
+ name: { type: 'string' },
314
+ email: { type: 'string' },
315
+ },
316
+ },
317
+ },
318
+ };
319
+ expect(inlineRefs(schema)).toEqual(expected);
320
+ });
321
+ it('should inline nested $refs', () => {
322
+ const schema = {
323
+ type: 'object',
324
+ properties: {
325
+ order: { $ref: '#/$defs/order' },
326
+ },
327
+ $defs: {
328
+ order: {
329
+ type: 'object',
330
+ properties: {
331
+ id: { type: 'string' },
332
+ items: { type: 'array', items: { $ref: '#/$defs/item' } },
333
+ },
334
+ },
335
+ item: {
336
+ type: 'object',
337
+ properties: {
338
+ product: { type: 'string' },
339
+ quantity: { type: 'integer' },
340
+ },
341
+ },
342
+ },
343
+ };
344
+ const expected = {
345
+ type: 'object',
346
+ properties: {
347
+ order: {
348
+ type: 'object',
349
+ properties: {
350
+ id: { type: 'string' },
351
+ items: {
352
+ type: 'array',
353
+ items: {
354
+ type: 'object',
355
+ properties: {
356
+ product: { type: 'string' },
357
+ quantity: { type: 'integer' },
358
+ },
359
+ },
360
+ },
361
+ },
362
+ },
363
+ },
364
+ };
365
+ expect(inlineRefs(schema)).toEqual(expected);
366
+ });
367
+ it('should handle circular references by removing the circular part', () => {
368
+ const schema = {
369
+ type: 'object',
370
+ properties: {
371
+ person: { $ref: '#/$defs/person' },
372
+ },
373
+ $defs: {
374
+ person: {
375
+ type: 'object',
376
+ properties: {
377
+ name: { type: 'string' },
378
+ friend: { $ref: '#/$defs/person' }, // Circular reference
379
+ },
380
+ },
381
+ },
382
+ };
383
+ const expected = {
384
+ type: 'object',
385
+ properties: {
386
+ person: {
387
+ type: 'object',
388
+ properties: {
389
+ name: { type: 'string' },
390
+ // friend property is removed to break the circular reference
391
+ },
392
+ },
393
+ },
394
+ };
395
+ expect(inlineRefs(schema)).toEqual(expected);
396
+ });
397
+ it('should handle indirect circular references', () => {
398
+ const schema = {
399
+ type: 'object',
400
+ properties: {
401
+ node: { $ref: '#/$defs/node' },
402
+ },
403
+ $defs: {
404
+ node: {
405
+ type: 'object',
406
+ properties: {
407
+ value: { type: 'string' },
408
+ child: { $ref: '#/$defs/childNode' },
409
+ },
410
+ },
411
+ childNode: {
412
+ type: 'object',
413
+ properties: {
414
+ value: { type: 'string' },
415
+ parent: { $ref: '#/$defs/node' }, // Circular reference through childNode
416
+ },
417
+ },
418
+ },
419
+ };
420
+ const expected = {
421
+ type: 'object',
422
+ properties: {
423
+ node: {
424
+ type: 'object',
425
+ properties: {
426
+ value: { type: 'string' },
427
+ child: {
428
+ type: 'object',
429
+ properties: {
430
+ value: { type: 'string' },
431
+ // parent property is removed to break the circular reference
432
+ },
433
+ },
434
+ },
435
+ },
436
+ },
437
+ };
438
+ expect(inlineRefs(schema)).toEqual(expected);
439
+ });
440
+ it('should preserve other properties when inlining references', () => {
441
+ const schema = {
442
+ type: 'object',
443
+ properties: {
444
+ address: { $ref: '#/$defs/address', description: 'User address' },
445
+ },
446
+ $defs: {
447
+ address: {
448
+ type: 'object',
449
+ properties: {
450
+ street: { type: 'string' },
451
+ city: { type: 'string' },
452
+ },
453
+ required: ['street'],
454
+ },
455
+ },
456
+ };
457
+ const expected = {
458
+ type: 'object',
459
+ properties: {
460
+ address: {
461
+ type: 'object',
462
+ description: 'User address',
463
+ properties: {
464
+ street: { type: 'string' },
465
+ city: { type: 'string' },
466
+ },
467
+ required: ['street'],
468
+ },
469
+ },
470
+ };
471
+ expect(inlineRefs(schema)).toEqual(expected);
472
+ });
473
+ });
474
+ describe('removeFormats', () => {
475
+ it('should return original schema if formats capability is true', () => {
476
+ const schema = {
477
+ type: 'object',
478
+ properties: {
479
+ date: { type: 'string', description: 'A date field', format: 'date' },
480
+ email: { type: 'string', description: 'An email field', format: 'email' },
481
+ },
482
+ };
483
+ expect(removeFormats(schema, true)).toEqual(schema);
484
+ });
485
+ it('should move format to description when formats capability is false', () => {
486
+ const schema = {
487
+ type: 'object',
488
+ properties: {
489
+ date: { type: 'string', description: 'A date field', format: 'date' },
490
+ email: { type: 'string', description: 'An email field', format: 'email' },
491
+ },
492
+ };
493
+ const expected = {
494
+ type: 'object',
495
+ properties: {
496
+ date: { type: 'string', description: 'A date field (format: "date")' },
497
+ email: { type: 'string', description: 'An email field (format: "email")' },
498
+ },
499
+ };
500
+ expect(removeFormats(schema, false)).toEqual(expected);
501
+ });
502
+ it('should handle properties without description', () => {
503
+ const schema = {
504
+ type: 'object',
505
+ properties: {
506
+ date: { type: 'string', format: 'date' },
507
+ },
508
+ };
509
+ const expected = {
510
+ type: 'object',
511
+ properties: {
512
+ date: { type: 'string', description: '(format: "date")' },
513
+ },
514
+ };
515
+ expect(removeFormats(schema, false)).toEqual(expected);
516
+ });
517
+ it('should handle nested properties', () => {
518
+ const schema = {
519
+ type: 'object',
520
+ properties: {
521
+ user: {
522
+ type: 'object',
523
+ properties: {
524
+ created_at: { type: 'string', description: 'Creation date', format: 'date-time' },
525
+ },
526
+ },
527
+ },
528
+ };
529
+ const expected = {
530
+ type: 'object',
531
+ properties: {
532
+ user: {
533
+ type: 'object',
534
+ properties: {
535
+ created_at: { type: 'string', description: 'Creation date (format: "date-time")' },
536
+ },
537
+ },
538
+ },
539
+ };
540
+ expect(removeFormats(schema, false)).toEqual(expected);
541
+ });
542
+ it('should handle arrays of objects', () => {
543
+ const schema = {
544
+ type: 'object',
545
+ properties: {
546
+ dates: {
547
+ type: 'array',
548
+ items: {
549
+ type: 'object',
550
+ properties: {
551
+ start: { type: 'string', description: 'Start date', format: 'date' },
552
+ end: { type: 'string', description: 'End date', format: 'date' },
553
+ },
554
+ },
555
+ },
556
+ },
557
+ };
558
+ const expected = {
559
+ type: 'object',
560
+ properties: {
561
+ dates: {
562
+ type: 'array',
563
+ items: {
564
+ type: 'object',
565
+ properties: {
566
+ start: { type: 'string', description: 'Start date (format: "date")' },
567
+ end: { type: 'string', description: 'End date (format: "date")' },
568
+ },
569
+ },
570
+ },
571
+ },
572
+ };
573
+ expect(removeFormats(schema, false)).toEqual(expected);
574
+ });
575
+ it('should handle schemas with $defs', () => {
576
+ const schema = {
577
+ type: 'object',
578
+ properties: {
579
+ date: { type: 'string', description: 'A date field', format: 'date' },
580
+ },
581
+ $defs: {
582
+ timestamp: {
583
+ type: 'string',
584
+ description: 'A timestamp field',
585
+ format: 'date-time',
586
+ },
587
+ },
588
+ };
589
+ const expected = {
590
+ type: 'object',
591
+ properties: {
592
+ date: { type: 'string', description: 'A date field (format: "date")' },
593
+ },
594
+ $defs: {
595
+ timestamp: {
596
+ type: 'string',
597
+ description: 'A timestamp field (format: "date-time")',
598
+ },
599
+ },
600
+ };
601
+ expect(removeFormats(schema, false)).toEqual(expected);
602
+ });
603
+ });
604
+ describe('applyCompatibilityTransformations', () => {
605
+ const createTestTool = (name, overrides = {}) => ({
606
+ name,
607
+ description: 'Test tool',
608
+ inputSchema: {
609
+ type: 'object',
610
+ properties: {},
611
+ },
612
+ ...overrides,
613
+ });
614
+ const createTestEndpoint = (tool) => ({
615
+ tool,
616
+ handler: jest.fn(),
617
+ metadata: {
618
+ resource: 'test',
619
+ operation: 'read',
620
+ tags: [],
621
+ },
622
+ });
623
+ it('should not modify endpoints when all capabilities are enabled', () => {
624
+ const tool = createTestTool('test-tool');
625
+ const endpoints = [createTestEndpoint(tool)];
626
+ const capabilities = {
627
+ topLevelUnions: true,
628
+ validJson: true,
629
+ refs: true,
630
+ unions: true,
631
+ formats: true,
632
+ toolNameLength: undefined,
633
+ };
634
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
635
+ expect(transformed).toEqual(endpoints);
636
+ });
637
+ it('should split tools with top-level unions when topLevelUnions is disabled', () => {
638
+ const tool = createTestTool('union-tool', {
639
+ inputSchema: {
640
+ type: 'object',
641
+ properties: {
642
+ common: { type: 'string' },
643
+ },
644
+ anyOf: [
645
+ {
646
+ title: 'first variant',
647
+ properties: {
648
+ variant1: { type: 'string' },
649
+ },
650
+ },
651
+ {
652
+ title: 'second variant',
653
+ properties: {
654
+ variant2: { type: 'number' },
655
+ },
656
+ },
657
+ ],
658
+ },
659
+ });
660
+ const endpoints = [createTestEndpoint(tool)];
661
+ const capabilities = {
662
+ topLevelUnions: false,
663
+ validJson: true,
664
+ refs: true,
665
+ unions: true,
666
+ formats: true,
667
+ toolNameLength: undefined,
668
+ };
669
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
670
+ expect(transformed.length).toBe(2);
671
+ expect(transformed[0].tool.name).toBe('union-tool_first_variant');
672
+ expect(transformed[1].tool.name).toBe('union-tool_second_variant');
673
+ });
674
+ it('should handle variants without titles in removeTopLevelUnions', () => {
675
+ const tool = createTestTool('union-tool', {
676
+ inputSchema: {
677
+ type: 'object',
678
+ properties: {
679
+ common: { type: 'string' },
680
+ },
681
+ anyOf: [
682
+ {
683
+ properties: {
684
+ variant1: { type: 'string' },
685
+ },
686
+ },
687
+ {
688
+ properties: {
689
+ variant2: { type: 'number' },
690
+ },
691
+ },
692
+ ],
693
+ },
694
+ });
695
+ const endpoints = [createTestEndpoint(tool)];
696
+ const capabilities = {
697
+ topLevelUnions: false,
698
+ validJson: true,
699
+ refs: true,
700
+ unions: true,
701
+ formats: true,
702
+ toolNameLength: undefined,
703
+ };
704
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
705
+ expect(transformed.length).toBe(2);
706
+ expect(transformed[0].tool.name).toBe('union-tool_variant1');
707
+ expect(transformed[1].tool.name).toBe('union-tool_variant2');
708
+ });
709
+ it('should truncate tool names when toolNameLength is set', () => {
710
+ const tools = [
711
+ createTestTool('very-long-tool-name-that-exceeds-limit'),
712
+ createTestTool('another-long-tool-name-to-truncate'),
713
+ createTestTool('short-name'),
714
+ ];
715
+ const endpoints = tools.map(createTestEndpoint);
716
+ const capabilities = {
717
+ topLevelUnions: true,
718
+ validJson: true,
719
+ refs: true,
720
+ unions: true,
721
+ formats: true,
722
+ toolNameLength: 20,
723
+ };
724
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
725
+ expect(transformed[0].tool.name).toBe('very-long-tool-name-');
726
+ expect(transformed[1].tool.name).toBe('another-long-tool-na');
727
+ expect(transformed[2].tool.name).toBe('short-name');
728
+ });
729
+ it('should inline refs when refs capability is disabled', () => {
730
+ const tool = createTestTool('ref-tool', {
731
+ inputSchema: {
732
+ type: 'object',
733
+ properties: {
734
+ user: { $ref: '#/$defs/user' },
735
+ },
736
+ $defs: {
737
+ user: {
738
+ type: 'object',
739
+ properties: {
740
+ name: { type: 'string' },
741
+ email: { type: 'string' },
742
+ },
743
+ },
744
+ },
745
+ },
746
+ });
747
+ const endpoints = [createTestEndpoint(tool)];
748
+ const capabilities = {
749
+ topLevelUnions: true,
750
+ validJson: true,
751
+ refs: false,
752
+ unions: true,
753
+ formats: true,
754
+ toolNameLength: undefined,
755
+ };
756
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
757
+ const schema = transformed[0].tool.inputSchema;
758
+ expect(schema.$defs).toBeUndefined();
759
+ if (schema.properties) {
760
+ expect(schema.properties['user']).toEqual({
761
+ type: 'object',
762
+ properties: {
763
+ name: { type: 'string' },
764
+ email: { type: 'string' },
765
+ },
766
+ });
767
+ }
768
+ });
769
+ it('should preserve external refs when inlining', () => {
770
+ const tool = createTestTool('ref-tool', {
771
+ inputSchema: {
772
+ type: 'object',
773
+ properties: {
774
+ internal: { $ref: '#/$defs/internal' },
775
+ external: { $ref: 'https://example.com/schemas/external.json' },
776
+ },
777
+ $defs: {
778
+ internal: {
779
+ type: 'object',
780
+ properties: {
781
+ name: { type: 'string' },
782
+ },
783
+ },
784
+ },
785
+ },
786
+ });
787
+ const endpoints = [createTestEndpoint(tool)];
788
+ const capabilities = {
789
+ topLevelUnions: true,
790
+ validJson: true,
791
+ refs: false,
792
+ unions: true,
793
+ formats: true,
794
+ toolNameLength: undefined,
795
+ };
796
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
797
+ const schema = transformed[0].tool.inputSchema;
798
+ if (schema.properties) {
799
+ expect(schema.properties['internal']).toEqual({
800
+ type: 'object',
801
+ properties: {
802
+ name: { type: 'string' },
803
+ },
804
+ });
805
+ expect(schema.properties['external']).toEqual({
806
+ $ref: 'https://example.com/schemas/external.json',
807
+ });
808
+ }
809
+ });
810
+ it('should remove anyOf fields when unions capability is disabled', () => {
811
+ const tool = createTestTool('union-tool', {
812
+ inputSchema: {
813
+ type: 'object',
814
+ properties: {
815
+ field: {
816
+ anyOf: [{ type: 'string' }, { type: 'number' }],
817
+ },
818
+ },
819
+ },
820
+ });
821
+ const endpoints = [createTestEndpoint(tool)];
822
+ const capabilities = {
823
+ topLevelUnions: true,
824
+ validJson: true,
825
+ refs: true,
826
+ unions: false,
827
+ formats: true,
828
+ toolNameLength: undefined,
829
+ };
830
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
831
+ const schema = transformed[0].tool.inputSchema;
832
+ if (schema.properties && schema.properties['field']) {
833
+ const field = schema.properties['field'];
834
+ expect(field.anyOf).toBeUndefined();
835
+ expect(field.type).toBe('string');
836
+ }
837
+ });
838
+ it('should correctly combine topLevelUnions and toolNameLength transformations', () => {
839
+ const tool = createTestTool('very-long-union-tool-name', {
840
+ inputSchema: {
841
+ type: 'object',
842
+ properties: {
843
+ common: { type: 'string' },
844
+ },
845
+ anyOf: [
846
+ {
847
+ title: 'first variant',
848
+ properties: {
849
+ variant1: { type: 'string' },
850
+ },
851
+ },
852
+ {
853
+ title: 'second variant',
854
+ properties: {
855
+ variant2: { type: 'number' },
856
+ },
857
+ },
858
+ ],
859
+ },
860
+ });
861
+ const endpoints = [createTestEndpoint(tool)];
862
+ const capabilities = {
863
+ topLevelUnions: false,
864
+ validJson: true,
865
+ refs: true,
866
+ unions: true,
867
+ formats: true,
868
+ toolNameLength: 20,
869
+ };
870
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
871
+ expect(transformed.length).toBe(2);
872
+ // Both names should be truncated because they exceed 20 characters
873
+ expect(transformed[0].tool.name).toBe('very-long-union-too1');
874
+ expect(transformed[1].tool.name).toBe('very-long-union-too2');
875
+ });
876
+ it('should correctly combine refs and unions transformations', () => {
877
+ const tool = createTestTool('complex-tool', {
878
+ inputSchema: {
879
+ type: 'object',
880
+ properties: {
881
+ user: { $ref: '#/$defs/user' },
882
+ },
883
+ $defs: {
884
+ user: {
885
+ type: 'object',
886
+ properties: {
887
+ preference: {
888
+ anyOf: [{ type: 'string' }, { type: 'number' }],
889
+ },
890
+ },
891
+ },
892
+ },
893
+ },
894
+ });
895
+ const endpoints = [createTestEndpoint(tool)];
896
+ const capabilities = {
897
+ topLevelUnions: true,
898
+ validJson: true,
899
+ refs: false,
900
+ unions: false,
901
+ formats: true,
902
+ toolNameLength: undefined,
903
+ };
904
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
905
+ const schema = transformed[0].tool.inputSchema;
906
+ // Refs should be inlined
907
+ expect(schema.$defs).toBeUndefined();
908
+ // Safely access nested properties
909
+ if (schema.properties && schema.properties['user']) {
910
+ const user = schema.properties['user'];
911
+ // User should be inlined
912
+ expect(user.type).toBe('object');
913
+ // AnyOf in the inlined user.preference should be removed
914
+ if (user.properties && user.properties['preference']) {
915
+ const preference = user.properties['preference'];
916
+ expect(preference.anyOf).toBeUndefined();
917
+ expect(preference.type).toBe('string');
918
+ }
919
+ }
920
+ });
921
+ it('should handle formats capability being false', () => {
922
+ const tool = createTestTool('format-tool', {
923
+ inputSchema: {
924
+ type: 'object',
925
+ properties: {
926
+ date: { type: 'string', description: 'A date', format: 'date' },
927
+ },
928
+ },
929
+ });
930
+ const endpoints = [createTestEndpoint(tool)];
931
+ const capabilities = {
932
+ topLevelUnions: true,
933
+ validJson: true,
934
+ refs: true,
935
+ unions: true,
936
+ formats: false,
937
+ toolNameLength: undefined,
938
+ };
939
+ const transformed = applyCompatibilityTransformations(endpoints, capabilities);
940
+ const schema = transformed[0].tool.inputSchema;
941
+ if (schema.properties && schema.properties['date']) {
942
+ const dateField = schema.properties['date'];
943
+ expect(dateField['format']).toBeUndefined();
944
+ expect(dateField['description']).toBe('A date (format: "date")');
945
+ }
946
+ });
947
+ });
948
+ //# sourceMappingURL=compat.test.mjs.map