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