scorecard-ai-mcp 2.6.0 → 3.0.0-beta.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 (401) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +14 -225
  3. package/code-tool-types.d.mts +6 -9
  4. package/code-tool-types.d.mts.map +1 -1
  5. package/code-tool-types.d.ts +6 -9
  6. package/code-tool-types.d.ts.map +1 -1
  7. package/code-tool.d.mts +2 -44
  8. package/code-tool.d.mts.map +1 -1
  9. package/code-tool.d.ts +2 -44
  10. package/code-tool.d.ts.map +1 -1
  11. package/code-tool.js +39 -7
  12. package/code-tool.js.map +1 -1
  13. package/code-tool.mjs +40 -8
  14. package/code-tool.mjs.map +1 -1
  15. package/docs-search-tool.d.mts +3 -3
  16. package/docs-search-tool.d.mts.map +1 -1
  17. package/docs-search-tool.d.ts +3 -3
  18. package/docs-search-tool.d.ts.map +1 -1
  19. package/docs-search-tool.js +1 -1
  20. package/docs-search-tool.js.map +1 -1
  21. package/docs-search-tool.mjs +1 -1
  22. package/http.d.mts.map +1 -1
  23. package/http.d.ts.map +1 -1
  24. package/http.js +1 -18
  25. package/http.js.map +1 -1
  26. package/http.mjs +1 -18
  27. package/http.mjs.map +1 -1
  28. package/index.js +4 -40
  29. package/index.js.map +1 -1
  30. package/index.mjs +4 -40
  31. package/index.mjs.map +1 -1
  32. package/options.d.mts +0 -9
  33. package/options.d.mts.map +1 -1
  34. package/options.d.ts +0 -9
  35. package/options.d.ts.map +1 -1
  36. package/options.js +6 -361
  37. package/options.js.map +1 -1
  38. package/options.mjs +6 -361
  39. package/options.mjs.map +1 -1
  40. package/package.json +9 -49
  41. package/server.d.mts +3 -8
  42. package/server.d.mts.map +1 -1
  43. package/server.d.ts +3 -8
  44. package/server.d.ts.map +1 -1
  45. package/server.js +12 -65
  46. package/server.js.map +1 -1
  47. package/server.mjs +11 -62
  48. package/server.mjs.map +1 -1
  49. package/src/code-tool-types.ts +6 -9
  50. package/src/code-tool.ts +45 -11
  51. package/src/docs-search-tool.ts +1 -1
  52. package/src/http.ts +1 -19
  53. package/src/index.ts +5 -52
  54. package/src/options.ts +7 -388
  55. package/src/server.ts +12 -72
  56. package/src/stdio.ts +2 -3
  57. package/src/{tools/types.ts → types.ts} +1 -1
  58. package/stdio.d.mts +1 -2
  59. package/stdio.d.mts.map +1 -1
  60. package/stdio.d.ts +1 -2
  61. package/stdio.d.ts.map +1 -1
  62. package/stdio.js +2 -2
  63. package/stdio.js.map +1 -1
  64. package/stdio.mjs +2 -2
  65. package/stdio.mjs.map +1 -1
  66. package/{tools/types.d.mts → types.d.mts} +1 -1
  67. package/types.d.mts.map +1 -0
  68. package/{tools/types.d.ts → types.d.ts} +1 -1
  69. package/types.d.ts.map +1 -0
  70. package/types.js.map +1 -0
  71. package/types.mjs.map +1 -0
  72. package/compat.d.mts +0 -58
  73. package/compat.d.mts.map +0 -1
  74. package/compat.d.ts +0 -58
  75. package/compat.d.ts.map +0 -1
  76. package/compat.js +0 -387
  77. package/compat.js.map +0 -1
  78. package/compat.mjs +0 -378
  79. package/compat.mjs.map +0 -1
  80. package/dynamic-tools.d.mts +0 -12
  81. package/dynamic-tools.d.mts.map +0 -1
  82. package/dynamic-tools.d.ts +0 -12
  83. package/dynamic-tools.d.ts.map +0 -1
  84. package/dynamic-tools.js +0 -135
  85. package/dynamic-tools.js.map +0 -1
  86. package/dynamic-tools.mjs +0 -132
  87. package/dynamic-tools.mjs.map +0 -1
  88. package/filtering.d.mts +0 -3
  89. package/filtering.d.mts.map +0 -1
  90. package/filtering.d.ts +0 -3
  91. package/filtering.d.ts.map +0 -1
  92. package/filtering.js +0 -24
  93. package/filtering.js.map +0 -1
  94. package/filtering.mjs +0 -16
  95. package/filtering.mjs.map +0 -1
  96. package/src/compat.ts +0 -483
  97. package/src/dynamic-tools.ts +0 -159
  98. package/src/filtering.ts +0 -18
  99. package/src/tools/index.ts +0 -131
  100. package/src/tools/metrics/create-metrics.ts +0 -383
  101. package/src/tools/metrics/delete-metrics.ts +0 -54
  102. package/src/tools/metrics/get-metrics.ts +0 -46
  103. package/src/tools/metrics/list-metrics.ts +0 -58
  104. package/src/tools/metrics/update-metrics.ts +0 -383
  105. package/src/tools/projects/create-projects.ts +0 -57
  106. package/src/tools/projects/list-projects.ts +0 -62
  107. package/src/tools/records/create-records.ts +0 -71
  108. package/src/tools/records/delete-records.ts +0 -54
  109. package/src/tools/records/list-records.ts +0 -65
  110. package/src/tools/runs/create-runs.ts +0 -67
  111. package/src/tools/runs/get-runs.ts +0 -54
  112. package/src/tools/runs/list-runs.ts +0 -65
  113. package/src/tools/scores/upsert-scores.ts +0 -65
  114. package/src/tools/systems/delete-systems.ts +0 -54
  115. package/src/tools/systems/get-systems.ts +0 -54
  116. package/src/tools/systems/list-systems.ts +0 -65
  117. package/src/tools/systems/update-systems.ts +0 -64
  118. package/src/tools/systems/upsert-systems.ts +0 -66
  119. package/src/tools/systems/versions/get-systems-versions.ts +0 -56
  120. package/src/tools/systems/versions/upsert-systems-versions.ts +0 -64
  121. package/src/tools/testcases/create-testcases.ts +0 -67
  122. package/src/tools/testcases/delete-testcases.ts +0 -56
  123. package/src/tools/testcases/get-testcases.ts +0 -54
  124. package/src/tools/testcases/list-testcases.ts +0 -65
  125. package/src/tools/testcases/update-testcases.ts +0 -59
  126. package/src/tools/testsets/create-testsets.ts +0 -94
  127. package/src/tools/testsets/delete-testsets.ts +0 -54
  128. package/src/tools/testsets/get-testsets.ts +0 -54
  129. package/src/tools/testsets/list-testsets.ts +0 -65
  130. package/src/tools/testsets/update-testsets.ts +0 -94
  131. package/src/tools.ts +0 -1
  132. package/tools/index.d.mts +0 -10
  133. package/tools/index.d.mts.map +0 -1
  134. package/tools/index.d.ts +0 -10
  135. package/tools/index.d.ts.map +0 -1
  136. package/tools/index.js +0 -115
  137. package/tools/index.js.map +0 -1
  138. package/tools/index.mjs +0 -108
  139. package/tools/index.mjs.map +0 -1
  140. package/tools/metrics/create-metrics.d.mts +0 -51
  141. package/tools/metrics/create-metrics.d.mts.map +0 -1
  142. package/tools/metrics/create-metrics.d.ts +0 -51
  143. package/tools/metrics/create-metrics.d.ts.map +0 -1
  144. package/tools/metrics/create-metrics.js +0 -381
  145. package/tools/metrics/create-metrics.js.map +0 -1
  146. package/tools/metrics/create-metrics.mjs +0 -374
  147. package/tools/metrics/create-metrics.mjs.map +0 -1
  148. package/tools/metrics/delete-metrics.d.mts +0 -51
  149. package/tools/metrics/delete-metrics.d.mts.map +0 -1
  150. package/tools/metrics/delete-metrics.d.ts +0 -51
  151. package/tools/metrics/delete-metrics.d.ts.map +0 -1
  152. package/tools/metrics/delete-metrics.js +0 -54
  153. package/tools/metrics/delete-metrics.js.map +0 -1
  154. package/tools/metrics/delete-metrics.mjs +0 -47
  155. package/tools/metrics/delete-metrics.mjs.map +0 -1
  156. package/tools/metrics/get-metrics.d.mts +0 -51
  157. package/tools/metrics/get-metrics.d.mts.map +0 -1
  158. package/tools/metrics/get-metrics.d.ts +0 -51
  159. package/tools/metrics/get-metrics.d.ts.map +0 -1
  160. package/tools/metrics/get-metrics.js +0 -48
  161. package/tools/metrics/get-metrics.js.map +0 -1
  162. package/tools/metrics/get-metrics.mjs +0 -41
  163. package/tools/metrics/get-metrics.mjs.map +0 -1
  164. package/tools/metrics/list-metrics.d.mts +0 -51
  165. package/tools/metrics/list-metrics.d.mts.map +0 -1
  166. package/tools/metrics/list-metrics.d.ts +0 -51
  167. package/tools/metrics/list-metrics.d.ts.map +0 -1
  168. package/tools/metrics/list-metrics.js +0 -57
  169. package/tools/metrics/list-metrics.js.map +0 -1
  170. package/tools/metrics/list-metrics.mjs +0 -50
  171. package/tools/metrics/list-metrics.mjs.map +0 -1
  172. package/tools/metrics/update-metrics.d.mts +0 -51
  173. package/tools/metrics/update-metrics.d.mts.map +0 -1
  174. package/tools/metrics/update-metrics.d.ts +0 -51
  175. package/tools/metrics/update-metrics.d.ts.map +0 -1
  176. package/tools/metrics/update-metrics.js +0 -381
  177. package/tools/metrics/update-metrics.js.map +0 -1
  178. package/tools/metrics/update-metrics.mjs +0 -374
  179. package/tools/metrics/update-metrics.mjs.map +0 -1
  180. package/tools/projects/create-projects.d.mts +0 -51
  181. package/tools/projects/create-projects.d.mts.map +0 -1
  182. package/tools/projects/create-projects.d.ts +0 -51
  183. package/tools/projects/create-projects.d.ts.map +0 -1
  184. package/tools/projects/create-projects.js +0 -57
  185. package/tools/projects/create-projects.js.map +0 -1
  186. package/tools/projects/create-projects.mjs +0 -50
  187. package/tools/projects/create-projects.mjs.map +0 -1
  188. package/tools/projects/list-projects.d.mts +0 -51
  189. package/tools/projects/list-projects.d.mts.map +0 -1
  190. package/tools/projects/list-projects.d.ts +0 -51
  191. package/tools/projects/list-projects.d.ts.map +0 -1
  192. package/tools/projects/list-projects.js +0 -60
  193. package/tools/projects/list-projects.js.map +0 -1
  194. package/tools/projects/list-projects.mjs +0 -53
  195. package/tools/projects/list-projects.mjs.map +0 -1
  196. package/tools/records/create-records.d.mts +0 -51
  197. package/tools/records/create-records.d.mts.map +0 -1
  198. package/tools/records/create-records.d.ts +0 -51
  199. package/tools/records/create-records.d.ts.map +0 -1
  200. package/tools/records/create-records.js +0 -71
  201. package/tools/records/create-records.js.map +0 -1
  202. package/tools/records/create-records.mjs +0 -64
  203. package/tools/records/create-records.mjs.map +0 -1
  204. package/tools/records/delete-records.d.mts +0 -51
  205. package/tools/records/delete-records.d.mts.map +0 -1
  206. package/tools/records/delete-records.d.ts +0 -51
  207. package/tools/records/delete-records.d.ts.map +0 -1
  208. package/tools/records/delete-records.js +0 -54
  209. package/tools/records/delete-records.js.map +0 -1
  210. package/tools/records/delete-records.mjs +0 -47
  211. package/tools/records/delete-records.mjs.map +0 -1
  212. package/tools/records/list-records.d.mts +0 -51
  213. package/tools/records/list-records.d.mts.map +0 -1
  214. package/tools/records/list-records.d.ts +0 -51
  215. package/tools/records/list-records.d.ts.map +0 -1
  216. package/tools/records/list-records.js +0 -63
  217. package/tools/records/list-records.js.map +0 -1
  218. package/tools/records/list-records.mjs +0 -56
  219. package/tools/records/list-records.mjs.map +0 -1
  220. package/tools/runs/create-runs.d.mts +0 -51
  221. package/tools/runs/create-runs.d.mts.map +0 -1
  222. package/tools/runs/create-runs.d.ts +0 -51
  223. package/tools/runs/create-runs.d.ts.map +0 -1
  224. package/tools/runs/create-runs.js +0 -67
  225. package/tools/runs/create-runs.js.map +0 -1
  226. package/tools/runs/create-runs.mjs +0 -60
  227. package/tools/runs/create-runs.mjs.map +0 -1
  228. package/tools/runs/get-runs.d.mts +0 -51
  229. package/tools/runs/get-runs.d.mts.map +0 -1
  230. package/tools/runs/get-runs.d.ts +0 -51
  231. package/tools/runs/get-runs.d.ts.map +0 -1
  232. package/tools/runs/get-runs.js +0 -54
  233. package/tools/runs/get-runs.js.map +0 -1
  234. package/tools/runs/get-runs.mjs +0 -47
  235. package/tools/runs/get-runs.mjs.map +0 -1
  236. package/tools/runs/list-runs.d.mts +0 -51
  237. package/tools/runs/list-runs.d.mts.map +0 -1
  238. package/tools/runs/list-runs.d.ts +0 -51
  239. package/tools/runs/list-runs.d.ts.map +0 -1
  240. package/tools/runs/list-runs.js +0 -63
  241. package/tools/runs/list-runs.js.map +0 -1
  242. package/tools/runs/list-runs.mjs +0 -56
  243. package/tools/runs/list-runs.mjs.map +0 -1
  244. package/tools/scores/upsert-scores.d.mts +0 -51
  245. package/tools/scores/upsert-scores.d.mts.map +0 -1
  246. package/tools/scores/upsert-scores.d.ts +0 -51
  247. package/tools/scores/upsert-scores.d.ts.map +0 -1
  248. package/tools/scores/upsert-scores.js +0 -62
  249. package/tools/scores/upsert-scores.js.map +0 -1
  250. package/tools/scores/upsert-scores.mjs +0 -55
  251. package/tools/scores/upsert-scores.mjs.map +0 -1
  252. package/tools/systems/delete-systems.d.mts +0 -51
  253. package/tools/systems/delete-systems.d.mts.map +0 -1
  254. package/tools/systems/delete-systems.d.ts +0 -51
  255. package/tools/systems/delete-systems.d.ts.map +0 -1
  256. package/tools/systems/delete-systems.js +0 -54
  257. package/tools/systems/delete-systems.js.map +0 -1
  258. package/tools/systems/delete-systems.mjs +0 -47
  259. package/tools/systems/delete-systems.mjs.map +0 -1
  260. package/tools/systems/get-systems.d.mts +0 -51
  261. package/tools/systems/get-systems.d.mts.map +0 -1
  262. package/tools/systems/get-systems.d.ts +0 -51
  263. package/tools/systems/get-systems.d.ts.map +0 -1
  264. package/tools/systems/get-systems.js +0 -54
  265. package/tools/systems/get-systems.js.map +0 -1
  266. package/tools/systems/get-systems.mjs +0 -47
  267. package/tools/systems/get-systems.mjs.map +0 -1
  268. package/tools/systems/list-systems.d.mts +0 -51
  269. package/tools/systems/list-systems.d.mts.map +0 -1
  270. package/tools/systems/list-systems.d.ts +0 -51
  271. package/tools/systems/list-systems.d.ts.map +0 -1
  272. package/tools/systems/list-systems.js +0 -63
  273. package/tools/systems/list-systems.js.map +0 -1
  274. package/tools/systems/list-systems.mjs +0 -56
  275. package/tools/systems/list-systems.mjs.map +0 -1
  276. package/tools/systems/update-systems.d.mts +0 -51
  277. package/tools/systems/update-systems.d.mts.map +0 -1
  278. package/tools/systems/update-systems.d.ts +0 -51
  279. package/tools/systems/update-systems.d.ts.map +0 -1
  280. package/tools/systems/update-systems.js +0 -64
  281. package/tools/systems/update-systems.js.map +0 -1
  282. package/tools/systems/update-systems.mjs +0 -57
  283. package/tools/systems/update-systems.mjs.map +0 -1
  284. package/tools/systems/upsert-systems.d.mts +0 -51
  285. package/tools/systems/upsert-systems.d.mts.map +0 -1
  286. package/tools/systems/upsert-systems.d.ts +0 -51
  287. package/tools/systems/upsert-systems.d.ts.map +0 -1
  288. package/tools/systems/upsert-systems.js +0 -65
  289. package/tools/systems/upsert-systems.js.map +0 -1
  290. package/tools/systems/upsert-systems.mjs +0 -58
  291. package/tools/systems/upsert-systems.mjs.map +0 -1
  292. package/tools/systems/versions/get-systems-versions.d.mts +0 -51
  293. package/tools/systems/versions/get-systems-versions.d.mts.map +0 -1
  294. package/tools/systems/versions/get-systems-versions.d.ts +0 -51
  295. package/tools/systems/versions/get-systems-versions.d.ts.map +0 -1
  296. package/tools/systems/versions/get-systems-versions.js +0 -54
  297. package/tools/systems/versions/get-systems-versions.js.map +0 -1
  298. package/tools/systems/versions/get-systems-versions.mjs +0 -47
  299. package/tools/systems/versions/get-systems-versions.mjs.map +0 -1
  300. package/tools/systems/versions/upsert-systems-versions.d.mts +0 -51
  301. package/tools/systems/versions/upsert-systems-versions.d.mts.map +0 -1
  302. package/tools/systems/versions/upsert-systems-versions.d.ts +0 -51
  303. package/tools/systems/versions/upsert-systems-versions.d.ts.map +0 -1
  304. package/tools/systems/versions/upsert-systems-versions.js +0 -61
  305. package/tools/systems/versions/upsert-systems-versions.js.map +0 -1
  306. package/tools/systems/versions/upsert-systems-versions.mjs +0 -54
  307. package/tools/systems/versions/upsert-systems-versions.mjs.map +0 -1
  308. package/tools/testcases/create-testcases.d.mts +0 -51
  309. package/tools/testcases/create-testcases.d.mts.map +0 -1
  310. package/tools/testcases/create-testcases.d.ts +0 -51
  311. package/tools/testcases/create-testcases.d.ts.map +0 -1
  312. package/tools/testcases/create-testcases.js +0 -67
  313. package/tools/testcases/create-testcases.js.map +0 -1
  314. package/tools/testcases/create-testcases.mjs +0 -60
  315. package/tools/testcases/create-testcases.mjs.map +0 -1
  316. package/tools/testcases/delete-testcases.d.mts +0 -51
  317. package/tools/testcases/delete-testcases.d.mts.map +0 -1
  318. package/tools/testcases/delete-testcases.d.ts +0 -51
  319. package/tools/testcases/delete-testcases.d.ts.map +0 -1
  320. package/tools/testcases/delete-testcases.js +0 -56
  321. package/tools/testcases/delete-testcases.js.map +0 -1
  322. package/tools/testcases/delete-testcases.mjs +0 -49
  323. package/tools/testcases/delete-testcases.mjs.map +0 -1
  324. package/tools/testcases/get-testcases.d.mts +0 -51
  325. package/tools/testcases/get-testcases.d.mts.map +0 -1
  326. package/tools/testcases/get-testcases.d.ts +0 -51
  327. package/tools/testcases/get-testcases.d.ts.map +0 -1
  328. package/tools/testcases/get-testcases.js +0 -54
  329. package/tools/testcases/get-testcases.js.map +0 -1
  330. package/tools/testcases/get-testcases.mjs +0 -47
  331. package/tools/testcases/get-testcases.mjs.map +0 -1
  332. package/tools/testcases/list-testcases.d.mts +0 -51
  333. package/tools/testcases/list-testcases.d.mts.map +0 -1
  334. package/tools/testcases/list-testcases.d.ts +0 -51
  335. package/tools/testcases/list-testcases.d.ts.map +0 -1
  336. package/tools/testcases/list-testcases.js +0 -63
  337. package/tools/testcases/list-testcases.js.map +0 -1
  338. package/tools/testcases/list-testcases.mjs +0 -56
  339. package/tools/testcases/list-testcases.mjs.map +0 -1
  340. package/tools/testcases/update-testcases.d.mts +0 -51
  341. package/tools/testcases/update-testcases.d.mts.map +0 -1
  342. package/tools/testcases/update-testcases.d.ts +0 -51
  343. package/tools/testcases/update-testcases.d.ts.map +0 -1
  344. package/tools/testcases/update-testcases.js +0 -59
  345. package/tools/testcases/update-testcases.js.map +0 -1
  346. package/tools/testcases/update-testcases.mjs +0 -52
  347. package/tools/testcases/update-testcases.mjs.map +0 -1
  348. package/tools/testsets/create-testsets.d.mts +0 -51
  349. package/tools/testsets/create-testsets.d.mts.map +0 -1
  350. package/tools/testsets/create-testsets.d.ts +0 -51
  351. package/tools/testsets/create-testsets.d.ts.map +0 -1
  352. package/tools/testsets/create-testsets.js +0 -93
  353. package/tools/testsets/create-testsets.js.map +0 -1
  354. package/tools/testsets/create-testsets.mjs +0 -86
  355. package/tools/testsets/create-testsets.mjs.map +0 -1
  356. package/tools/testsets/delete-testsets.d.mts +0 -51
  357. package/tools/testsets/delete-testsets.d.mts.map +0 -1
  358. package/tools/testsets/delete-testsets.d.ts +0 -51
  359. package/tools/testsets/delete-testsets.d.ts.map +0 -1
  360. package/tools/testsets/delete-testsets.js +0 -54
  361. package/tools/testsets/delete-testsets.js.map +0 -1
  362. package/tools/testsets/delete-testsets.mjs +0 -47
  363. package/tools/testsets/delete-testsets.mjs.map +0 -1
  364. package/tools/testsets/get-testsets.d.mts +0 -51
  365. package/tools/testsets/get-testsets.d.mts.map +0 -1
  366. package/tools/testsets/get-testsets.d.ts +0 -51
  367. package/tools/testsets/get-testsets.d.ts.map +0 -1
  368. package/tools/testsets/get-testsets.js +0 -54
  369. package/tools/testsets/get-testsets.js.map +0 -1
  370. package/tools/testsets/get-testsets.mjs +0 -47
  371. package/tools/testsets/get-testsets.mjs.map +0 -1
  372. package/tools/testsets/list-testsets.d.mts +0 -51
  373. package/tools/testsets/list-testsets.d.mts.map +0 -1
  374. package/tools/testsets/list-testsets.d.ts +0 -51
  375. package/tools/testsets/list-testsets.d.ts.map +0 -1
  376. package/tools/testsets/list-testsets.js +0 -63
  377. package/tools/testsets/list-testsets.js.map +0 -1
  378. package/tools/testsets/list-testsets.mjs +0 -56
  379. package/tools/testsets/list-testsets.mjs.map +0 -1
  380. package/tools/testsets/update-testsets.d.mts +0 -51
  381. package/tools/testsets/update-testsets.d.mts.map +0 -1
  382. package/tools/testsets/update-testsets.d.ts +0 -51
  383. package/tools/testsets/update-testsets.d.ts.map +0 -1
  384. package/tools/testsets/update-testsets.js +0 -93
  385. package/tools/testsets/update-testsets.js.map +0 -1
  386. package/tools/testsets/update-testsets.mjs +0 -86
  387. package/tools/testsets/update-testsets.mjs.map +0 -1
  388. package/tools/types.d.mts.map +0 -1
  389. package/tools/types.d.ts.map +0 -1
  390. package/tools/types.js.map +0 -1
  391. package/tools/types.mjs.map +0 -1
  392. package/tools.d.mts +0 -2
  393. package/tools.d.mts.map +0 -1
  394. package/tools.d.ts +0 -2
  395. package/tools.d.ts.map +0 -1
  396. package/tools.js +0 -18
  397. package/tools.js.map +0 -1
  398. package/tools.mjs +0 -2
  399. package/tools.mjs.map +0 -1
  400. /package/{tools/types.js → types.js} +0 -0
  401. /package/{tools/types.mjs → types.mjs} +0 -0
@@ -1,94 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
4
- import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
5
-
6
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
- import Scorecard from 'scorecard-ai';
8
-
9
- export const metadata: Metadata = {
10
- resource: 'testsets',
11
- operation: 'write',
12
- tags: [],
13
- httpMethod: 'post',
14
- httpPath: '/projects/{projectId}/testsets',
15
- operationId: 'createTestset',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'create_testsets',
20
- description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nCreate a new Testset for a Project. The Testset will be created in the Project specified in the path.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/testset',\n $defs: {\n testset: {\n type: 'object',\n description: 'A collection of Testcases that share the same schema.\\nEach Testset defines the structure of its Testcases through a JSON schema.\\nThe `fieldMapping` object maps top-level keys of the Testcase schema to their roles (input/expected output).\\nFields not mentioned in the `fieldMapping` during creation or update are treated as metadata.\\n\\n## JSON Schema validation constraints supported:\\n\\n- **Required fields** - Fields listed in the schema\\'s `required` array must be present in Testcases.\\n- **Type validation** - Values must match the specified type (string, number, boolean, null, integer, object, array).\\n- **Enum validation** - Values must be one of the options specified in the `enum` array.\\n- **Object property validation** - Properties of objects must conform to their defined schemas.\\n- **Array item validation** - Items in arrays must conform to the `items` schema.\\n- **Logical composition** - Values must conform to at least one schema in the `anyOf` array.\\n\\nTestcases that fail validation will still be stored, but will include `validationErrors` detailing the issues.\\nExtra fields in the Testcase data that are not in the schema will be stored but are ignored during validation.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Testset.'\n },\n description: {\n type: 'string',\n description: 'The description of the Testset.'\n },\n fieldMapping: {\n type: 'object',\n description: 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',\n properties: {\n expected: {\n type: 'array',\n description: 'Fields that represent expected outputs.',\n items: {\n type: 'string'\n }\n },\n inputs: {\n type: 'array',\n description: 'Fields that represent inputs to the AI system.',\n items: {\n type: 'string'\n }\n },\n metadata: {\n type: 'array',\n description: 'Fields that are not inputs or expected outputs.',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'expected',\n 'inputs',\n 'metadata'\n ]\n },\n jsonSchema: {\n type: 'object',\n description: 'The JSON schema for each Testcase in the Testset.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the Testset.'\n }\n },\n required: [ 'id',\n 'description',\n 'fieldMapping',\n 'jsonSchema',\n 'name'\n ]\n }\n }\n}\n```",
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- projectId: {
26
- type: 'string',
27
- },
28
- description: {
29
- type: 'string',
30
- description: 'The description of the Testset.',
31
- },
32
- fieldMapping: {
33
- type: 'object',
34
- description:
35
- 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',
36
- properties: {
37
- expected: {
38
- type: 'array',
39
- description: 'Fields that represent expected outputs.',
40
- items: {
41
- type: 'string',
42
- },
43
- },
44
- inputs: {
45
- type: 'array',
46
- description: 'Fields that represent inputs to the AI system.',
47
- items: {
48
- type: 'string',
49
- },
50
- },
51
- metadata: {
52
- type: 'array',
53
- description: 'Fields that are not inputs or expected outputs.',
54
- items: {
55
- type: 'string',
56
- },
57
- },
58
- },
59
- required: ['expected', 'inputs', 'metadata'],
60
- },
61
- jsonSchema: {
62
- type: 'object',
63
- description: 'The JSON schema for each Testcase in the Testset.',
64
- additionalProperties: true,
65
- },
66
- name: {
67
- type: 'string',
68
- description: 'The name of the Testset.',
69
- },
70
- jq_filter: {
71
- type: 'string',
72
- title: 'jq Filter',
73
- description:
74
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
75
- },
76
- },
77
- required: ['projectId', 'description', 'fieldMapping', 'jsonSchema', 'name'],
78
- },
79
- annotations: {},
80
- };
81
-
82
- export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
83
- const { projectId, jq_filter, ...body } = args as any;
84
- try {
85
- return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.create(projectId, body)));
86
- } catch (error) {
87
- if (error instanceof Scorecard.APIError || isJqError(error)) {
88
- return asErrorResult(error.message);
89
- }
90
- throw error;
91
- }
92
- };
93
-
94
- export default { metadata, tool, handler };
@@ -1,54 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
4
- import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
5
-
6
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
- import Scorecard from 'scorecard-ai';
8
-
9
- export const metadata: Metadata = {
10
- resource: 'testsets',
11
- operation: 'write',
12
- tags: [],
13
- httpMethod: 'delete',
14
- httpPath: '/testsets/{testsetId}',
15
- operationId: 'deleteTestset',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'delete_testsets',
20
- description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nDelete Testset\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/testset_delete_response',\n $defs: {\n testset_delete_response: {\n type: 'object',\n properties: {\n success: {\n type: 'boolean',\n description: 'Whether the deletion was successful.'\n }\n },\n required: [ 'success'\n ]\n }\n }\n}\n```",
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- testsetId: {
26
- type: 'string',
27
- },
28
- jq_filter: {
29
- type: 'string',
30
- title: 'jq Filter',
31
- description:
32
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
- },
34
- },
35
- required: ['testsetId'],
36
- },
37
- annotations: {
38
- idempotentHint: true,
39
- },
40
- };
41
-
42
- export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
43
- const { testsetId, jq_filter, ...body } = args as any;
44
- try {
45
- return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.delete(testsetId)));
46
- } catch (error) {
47
- if (error instanceof Scorecard.APIError || isJqError(error)) {
48
- return asErrorResult(error.message);
49
- }
50
- throw error;
51
- }
52
- };
53
-
54
- export default { metadata, tool, handler };
@@ -1,54 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
4
- import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
5
-
6
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
- import Scorecard from 'scorecard-ai';
8
-
9
- export const metadata: Metadata = {
10
- resource: 'testsets',
11
- operation: 'read',
12
- tags: [],
13
- httpMethod: 'get',
14
- httpPath: '/testsets/{testsetId}',
15
- operationId: 'getTestset',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'get_testsets',
20
- description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGet Testset\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/testset',\n $defs: {\n testset: {\n type: 'object',\n description: 'A collection of Testcases that share the same schema.\\nEach Testset defines the structure of its Testcases through a JSON schema.\\nThe `fieldMapping` object maps top-level keys of the Testcase schema to their roles (input/expected output).\\nFields not mentioned in the `fieldMapping` during creation or update are treated as metadata.\\n\\n## JSON Schema validation constraints supported:\\n\\n- **Required fields** - Fields listed in the schema\\'s `required` array must be present in Testcases.\\n- **Type validation** - Values must match the specified type (string, number, boolean, null, integer, object, array).\\n- **Enum validation** - Values must be one of the options specified in the `enum` array.\\n- **Object property validation** - Properties of objects must conform to their defined schemas.\\n- **Array item validation** - Items in arrays must conform to the `items` schema.\\n- **Logical composition** - Values must conform to at least one schema in the `anyOf` array.\\n\\nTestcases that fail validation will still be stored, but will include `validationErrors` detailing the issues.\\nExtra fields in the Testcase data that are not in the schema will be stored but are ignored during validation.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Testset.'\n },\n description: {\n type: 'string',\n description: 'The description of the Testset.'\n },\n fieldMapping: {\n type: 'object',\n description: 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',\n properties: {\n expected: {\n type: 'array',\n description: 'Fields that represent expected outputs.',\n items: {\n type: 'string'\n }\n },\n inputs: {\n type: 'array',\n description: 'Fields that represent inputs to the AI system.',\n items: {\n type: 'string'\n }\n },\n metadata: {\n type: 'array',\n description: 'Fields that are not inputs or expected outputs.',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'expected',\n 'inputs',\n 'metadata'\n ]\n },\n jsonSchema: {\n type: 'object',\n description: 'The JSON schema for each Testcase in the Testset.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the Testset.'\n }\n },\n required: [ 'id',\n 'description',\n 'fieldMapping',\n 'jsonSchema',\n 'name'\n ]\n }\n }\n}\n```",
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- testsetId: {
26
- type: 'string',
27
- },
28
- jq_filter: {
29
- type: 'string',
30
- title: 'jq Filter',
31
- description:
32
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
- },
34
- },
35
- required: ['testsetId'],
36
- },
37
- annotations: {
38
- readOnlyHint: true,
39
- },
40
- };
41
-
42
- export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
43
- const { testsetId, jq_filter, ...body } = args as any;
44
- try {
45
- return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.get(testsetId)));
46
- } catch (error) {
47
- if (error instanceof Scorecard.APIError || isJqError(error)) {
48
- return asErrorResult(error.message);
49
- }
50
- throw error;
51
- }
52
- };
53
-
54
- export default { metadata, tool, handler };
@@ -1,65 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
4
- import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
5
-
6
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
- import Scorecard from 'scorecard-ai';
8
-
9
- export const metadata: Metadata = {
10
- resource: 'testsets',
11
- operation: 'read',
12
- tags: [],
13
- httpMethod: 'get',
14
- httpPath: '/projects/{projectId}/testsets',
15
- operationId: 'listTestsets',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'list_testsets',
20
- description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve a paginated list of Testsets belonging to a Project.\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n $ref: '#/$defs/testset'\n }\n },\n hasMore: {\n type: 'boolean'\n },\n nextCursor: {\n type: 'string'\n },\n total: {\n type: 'integer'\n }\n },\n required: [ 'data',\n 'hasMore',\n 'nextCursor'\n ],\n $defs: {\n testset: {\n type: 'object',\n description: 'A collection of Testcases that share the same schema.\\nEach Testset defines the structure of its Testcases through a JSON schema.\\nThe `fieldMapping` object maps top-level keys of the Testcase schema to their roles (input/expected output).\\nFields not mentioned in the `fieldMapping` during creation or update are treated as metadata.\\n\\n## JSON Schema validation constraints supported:\\n\\n- **Required fields** - Fields listed in the schema\\'s `required` array must be present in Testcases.\\n- **Type validation** - Values must match the specified type (string, number, boolean, null, integer, object, array).\\n- **Enum validation** - Values must be one of the options specified in the `enum` array.\\n- **Object property validation** - Properties of objects must conform to their defined schemas.\\n- **Array item validation** - Items in arrays must conform to the `items` schema.\\n- **Logical composition** - Values must conform to at least one schema in the `anyOf` array.\\n\\nTestcases that fail validation will still be stored, but will include `validationErrors` detailing the issues.\\nExtra fields in the Testcase data that are not in the schema will be stored but are ignored during validation.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Testset.'\n },\n description: {\n type: 'string',\n description: 'The description of the Testset.'\n },\n fieldMapping: {\n type: 'object',\n description: 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',\n properties: {\n expected: {\n type: 'array',\n description: 'Fields that represent expected outputs.',\n items: {\n type: 'string'\n }\n },\n inputs: {\n type: 'array',\n description: 'Fields that represent inputs to the AI system.',\n items: {\n type: 'string'\n }\n },\n metadata: {\n type: 'array',\n description: 'Fields that are not inputs or expected outputs.',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'expected',\n 'inputs',\n 'metadata'\n ]\n },\n jsonSchema: {\n type: 'object',\n description: 'The JSON schema for each Testcase in the Testset.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the Testset.'\n }\n },\n required: [ 'id',\n 'description',\n 'fieldMapping',\n 'jsonSchema',\n 'name'\n ]\n }\n }\n}\n```",
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- projectId: {
26
- type: 'string',
27
- },
28
- cursor: {
29
- type: 'string',
30
- description:
31
- 'Cursor for pagination. Pass the `nextCursor` from the previous response to get the next page of results.',
32
- },
33
- limit: {
34
- type: 'integer',
35
- description:
36
- 'Maximum number of items to return (1-100). Use with `cursor` for pagination through large sets.',
37
- },
38
- jq_filter: {
39
- type: 'string',
40
- title: 'jq Filter',
41
- description:
42
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
43
- },
44
- },
45
- required: ['projectId'],
46
- },
47
- annotations: {
48
- readOnlyHint: true,
49
- },
50
- };
51
-
52
- export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
53
- const { projectId, jq_filter, ...body } = args as any;
54
- const response = await client.testsets.list(projectId, body).asResponse();
55
- try {
56
- return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
57
- } catch (error) {
58
- if (error instanceof Scorecard.APIError || isJqError(error)) {
59
- return asErrorResult(error.message);
60
- }
61
- throw error;
62
- }
63
- };
64
-
65
- export default { metadata, tool, handler };
@@ -1,94 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from 'scorecard-ai-mcp/filtering';
4
- import { Metadata, asErrorResult, asTextContentResult } from 'scorecard-ai-mcp/tools/types';
5
-
6
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
- import Scorecard from 'scorecard-ai';
8
-
9
- export const metadata: Metadata = {
10
- resource: 'testsets',
11
- operation: 'write',
12
- tags: [],
13
- httpMethod: 'patch',
14
- httpPath: '/testsets/{testsetId}',
15
- operationId: 'updateTestset',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'update_testsets',
20
- description:
21
- "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nUpdate a Testset. Only the fields provided in the request body will be updated.\nIf a field is provided, the new content will replace the existing content.\nIf a field is not provided, the existing content will remain unchanged.\n\nWhen updating the schema:\n- If field mappings are not provided and existing mappings reference fields that no longer exist, those mappings will be automatically removed\n- To preserve all existing mappings, ensure all referenced fields remain in the updated schema\n- For complete control, provide both schema and fieldMapping when updating the schema\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/testset',\n $defs: {\n testset: {\n type: 'object',\n description: 'A collection of Testcases that share the same schema.\\nEach Testset defines the structure of its Testcases through a JSON schema.\\nThe `fieldMapping` object maps top-level keys of the Testcase schema to their roles (input/expected output).\\nFields not mentioned in the `fieldMapping` during creation or update are treated as metadata.\\n\\n## JSON Schema validation constraints supported:\\n\\n- **Required fields** - Fields listed in the schema\\'s `required` array must be present in Testcases.\\n- **Type validation** - Values must match the specified type (string, number, boolean, null, integer, object, array).\\n- **Enum validation** - Values must be one of the options specified in the `enum` array.\\n- **Object property validation** - Properties of objects must conform to their defined schemas.\\n- **Array item validation** - Items in arrays must conform to the `items` schema.\\n- **Logical composition** - Values must conform to at least one schema in the `anyOf` array.\\n\\nTestcases that fail validation will still be stored, but will include `validationErrors` detailing the issues.\\nExtra fields in the Testcase data that are not in the schema will be stored but are ignored during validation.',\n properties: {\n id: {\n type: 'string',\n description: 'The ID of the Testset.'\n },\n description: {\n type: 'string',\n description: 'The description of the Testset.'\n },\n fieldMapping: {\n type: 'object',\n description: 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',\n properties: {\n expected: {\n type: 'array',\n description: 'Fields that represent expected outputs.',\n items: {\n type: 'string'\n }\n },\n inputs: {\n type: 'array',\n description: 'Fields that represent inputs to the AI system.',\n items: {\n type: 'string'\n }\n },\n metadata: {\n type: 'array',\n description: 'Fields that are not inputs or expected outputs.',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'expected',\n 'inputs',\n 'metadata'\n ]\n },\n jsonSchema: {\n type: 'object',\n description: 'The JSON schema for each Testcase in the Testset.',\n additionalProperties: true\n },\n name: {\n type: 'string',\n description: 'The name of the Testset.'\n }\n },\n required: [ 'id',\n 'description',\n 'fieldMapping',\n 'jsonSchema',\n 'name'\n ]\n }\n }\n}\n```",
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- testsetId: {
26
- type: 'string',
27
- },
28
- description: {
29
- type: 'string',
30
- description: 'The description of the Testset.',
31
- },
32
- fieldMapping: {
33
- type: 'object',
34
- description:
35
- 'Maps top-level keys of the Testcase schema to their roles (input/expected output). Unmapped fields are treated as metadata.',
36
- properties: {
37
- expected: {
38
- type: 'array',
39
- description: 'Fields that represent expected outputs.',
40
- items: {
41
- type: 'string',
42
- },
43
- },
44
- inputs: {
45
- type: 'array',
46
- description: 'Fields that represent inputs to the AI system.',
47
- items: {
48
- type: 'string',
49
- },
50
- },
51
- metadata: {
52
- type: 'array',
53
- description: 'Fields that are not inputs or expected outputs.',
54
- items: {
55
- type: 'string',
56
- },
57
- },
58
- },
59
- required: ['expected', 'inputs', 'metadata'],
60
- },
61
- jsonSchema: {
62
- type: 'object',
63
- description: 'The JSON schema for each Testcase in the Testset.',
64
- additionalProperties: true,
65
- },
66
- name: {
67
- type: 'string',
68
- description: 'The name of the Testset.',
69
- },
70
- jq_filter: {
71
- type: 'string',
72
- title: 'jq Filter',
73
- description:
74
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
75
- },
76
- },
77
- required: ['testsetId'],
78
- },
79
- annotations: {},
80
- };
81
-
82
- export const handler = async (client: Scorecard, args: Record<string, unknown> | undefined) => {
83
- const { testsetId, jq_filter, ...body } = args as any;
84
- try {
85
- return asTextContentResult(await maybeFilter(jq_filter, await client.testsets.update(testsetId, body)));
86
- } catch (error) {
87
- if (error instanceof Scorecard.APIError || isJqError(error)) {
88
- return asErrorResult(error.message);
89
- }
90
- throw error;
91
- }
92
- };
93
-
94
- export default { metadata, tool, handler };
package/src/tools.ts DELETED
@@ -1 +0,0 @@
1
- export * from './tools/index';
package/tools/index.d.mts DELETED
@@ -1,10 +0,0 @@
1
- import { Metadata, Endpoint, HandlerFunction } from "./types.mjs";
2
- export { Metadata, Endpoint, HandlerFunction };
3
- export declare const endpoints: Endpoint[];
4
- export type Filter = {
5
- type: 'resource' | 'operation' | 'tag' | 'tool';
6
- op: 'include' | 'exclude';
7
- value: string;
8
- };
9
- export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
10
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAkC/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAsCxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
package/tools/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { Metadata, Endpoint, HandlerFunction } from "./types.js";
2
- export { Metadata, Endpoint, HandlerFunction };
3
- export declare const endpoints: Endpoint[];
4
- export type Filter = {
5
- type: 'resource' | 'operation' | 'tag' | 'tool';
6
- op: 'include' | 'exclude';
7
- value: string;
8
- };
9
- export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAkC/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAsCxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
package/tools/index.js DELETED
@@ -1,115 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.endpoints = void 0;
8
- exports.query = query;
9
- const create_projects_1 = __importDefault(require("./projects/create-projects.js"));
10
- const list_projects_1 = __importDefault(require("./projects/list-projects.js"));
11
- const create_testsets_1 = __importDefault(require("./testsets/create-testsets.js"));
12
- const update_testsets_1 = __importDefault(require("./testsets/update-testsets.js"));
13
- const list_testsets_1 = __importDefault(require("./testsets/list-testsets.js"));
14
- const delete_testsets_1 = __importDefault(require("./testsets/delete-testsets.js"));
15
- const get_testsets_1 = __importDefault(require("./testsets/get-testsets.js"));
16
- const create_testcases_1 = __importDefault(require("./testcases/create-testcases.js"));
17
- const update_testcases_1 = __importDefault(require("./testcases/update-testcases.js"));
18
- const list_testcases_1 = __importDefault(require("./testcases/list-testcases.js"));
19
- const delete_testcases_1 = __importDefault(require("./testcases/delete-testcases.js"));
20
- const get_testcases_1 = __importDefault(require("./testcases/get-testcases.js"));
21
- const create_runs_1 = __importDefault(require("./runs/create-runs.js"));
22
- const list_runs_1 = __importDefault(require("./runs/list-runs.js"));
23
- const get_runs_1 = __importDefault(require("./runs/get-runs.js"));
24
- const create_metrics_1 = __importDefault(require("./metrics/create-metrics.js"));
25
- const update_metrics_1 = __importDefault(require("./metrics/update-metrics.js"));
26
- const list_metrics_1 = __importDefault(require("./metrics/list-metrics.js"));
27
- const delete_metrics_1 = __importDefault(require("./metrics/delete-metrics.js"));
28
- const get_metrics_1 = __importDefault(require("./metrics/get-metrics.js"));
29
- const create_records_1 = __importDefault(require("./records/create-records.js"));
30
- const list_records_1 = __importDefault(require("./records/list-records.js"));
31
- const delete_records_1 = __importDefault(require("./records/delete-records.js"));
32
- const upsert_scores_1 = __importDefault(require("./scores/upsert-scores.js"));
33
- const update_systems_1 = __importDefault(require("./systems/update-systems.js"));
34
- const list_systems_1 = __importDefault(require("./systems/list-systems.js"));
35
- const delete_systems_1 = __importDefault(require("./systems/delete-systems.js"));
36
- const get_systems_1 = __importDefault(require("./systems/get-systems.js"));
37
- const upsert_systems_1 = __importDefault(require("./systems/upsert-systems.js"));
38
- const get_systems_versions_1 = __importDefault(require("./systems/versions/get-systems-versions.js"));
39
- const upsert_systems_versions_1 = __importDefault(require("./systems/versions/upsert-systems-versions.js"));
40
- exports.endpoints = [];
41
- function addEndpoint(endpoint) {
42
- exports.endpoints.push(endpoint);
43
- }
44
- addEndpoint(create_projects_1.default);
45
- addEndpoint(list_projects_1.default);
46
- addEndpoint(create_testsets_1.default);
47
- addEndpoint(update_testsets_1.default);
48
- addEndpoint(list_testsets_1.default);
49
- addEndpoint(delete_testsets_1.default);
50
- addEndpoint(get_testsets_1.default);
51
- addEndpoint(create_testcases_1.default);
52
- addEndpoint(update_testcases_1.default);
53
- addEndpoint(list_testcases_1.default);
54
- addEndpoint(delete_testcases_1.default);
55
- addEndpoint(get_testcases_1.default);
56
- addEndpoint(create_runs_1.default);
57
- addEndpoint(list_runs_1.default);
58
- addEndpoint(get_runs_1.default);
59
- addEndpoint(create_metrics_1.default);
60
- addEndpoint(update_metrics_1.default);
61
- addEndpoint(list_metrics_1.default);
62
- addEndpoint(delete_metrics_1.default);
63
- addEndpoint(get_metrics_1.default);
64
- addEndpoint(create_records_1.default);
65
- addEndpoint(list_records_1.default);
66
- addEndpoint(delete_records_1.default);
67
- addEndpoint(upsert_scores_1.default);
68
- addEndpoint(update_systems_1.default);
69
- addEndpoint(list_systems_1.default);
70
- addEndpoint(delete_systems_1.default);
71
- addEndpoint(get_systems_1.default);
72
- addEndpoint(upsert_systems_1.default);
73
- addEndpoint(get_systems_versions_1.default);
74
- addEndpoint(upsert_systems_versions_1.default);
75
- function query(filters, endpoints) {
76
- const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
77
- const unmatchedFilters = new Set(filters);
78
- const filtered = endpoints.filter((endpoint) => {
79
- let included = false || allExcludes;
80
- for (const filter of filters) {
81
- if (match(filter, endpoint)) {
82
- unmatchedFilters.delete(filter);
83
- included = filter.op === 'include';
84
- }
85
- }
86
- return included;
87
- });
88
- // Check if any filters didn't match
89
- const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
90
- if (unmatched.length > 0) {
91
- throw new Error(`The following filters did not match any endpoints: ${unmatched
92
- .map((f) => `${f.type}=${f.value}`)
93
- .join(', ')}`);
94
- }
95
- return filtered;
96
- }
97
- function match({ type, value }, endpoint) {
98
- switch (type) {
99
- case 'resource': {
100
- const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
101
- const regex = new RegExp(regexStr);
102
- return regex.test(normalizeResource(endpoint.metadata.resource));
103
- }
104
- case 'operation':
105
- return endpoint.metadata.operation === value;
106
- case 'tag':
107
- return endpoint.metadata.tags.includes(value);
108
- case 'tool':
109
- return endpoint.tool.name === value;
110
- }
111
- }
112
- function normalizeResource(resource) {
113
- return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
114
- }
115
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"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"}
package/tools/index.mjs DELETED
@@ -1,108 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import create_projects from "./projects/create-projects.mjs";
3
- import list_projects from "./projects/list-projects.mjs";
4
- import create_testsets from "./testsets/create-testsets.mjs";
5
- import update_testsets from "./testsets/update-testsets.mjs";
6
- import list_testsets from "./testsets/list-testsets.mjs";
7
- import delete_testsets from "./testsets/delete-testsets.mjs";
8
- import get_testsets from "./testsets/get-testsets.mjs";
9
- import create_testcases from "./testcases/create-testcases.mjs";
10
- import update_testcases from "./testcases/update-testcases.mjs";
11
- import list_testcases from "./testcases/list-testcases.mjs";
12
- import delete_testcases from "./testcases/delete-testcases.mjs";
13
- import get_testcases from "./testcases/get-testcases.mjs";
14
- import create_runs from "./runs/create-runs.mjs";
15
- import list_runs from "./runs/list-runs.mjs";
16
- import get_runs from "./runs/get-runs.mjs";
17
- import create_metrics from "./metrics/create-metrics.mjs";
18
- import update_metrics from "./metrics/update-metrics.mjs";
19
- import list_metrics from "./metrics/list-metrics.mjs";
20
- import delete_metrics from "./metrics/delete-metrics.mjs";
21
- import get_metrics from "./metrics/get-metrics.mjs";
22
- import create_records from "./records/create-records.mjs";
23
- import list_records from "./records/list-records.mjs";
24
- import delete_records from "./records/delete-records.mjs";
25
- import upsert_scores from "./scores/upsert-scores.mjs";
26
- import update_systems from "./systems/update-systems.mjs";
27
- import list_systems from "./systems/list-systems.mjs";
28
- import delete_systems from "./systems/delete-systems.mjs";
29
- import get_systems from "./systems/get-systems.mjs";
30
- import upsert_systems from "./systems/upsert-systems.mjs";
31
- import get_systems_versions from "./systems/versions/get-systems-versions.mjs";
32
- import upsert_systems_versions from "./systems/versions/upsert-systems-versions.mjs";
33
- export const endpoints = [];
34
- function addEndpoint(endpoint) {
35
- endpoints.push(endpoint);
36
- }
37
- addEndpoint(create_projects);
38
- addEndpoint(list_projects);
39
- addEndpoint(create_testsets);
40
- addEndpoint(update_testsets);
41
- addEndpoint(list_testsets);
42
- addEndpoint(delete_testsets);
43
- addEndpoint(get_testsets);
44
- addEndpoint(create_testcases);
45
- addEndpoint(update_testcases);
46
- addEndpoint(list_testcases);
47
- addEndpoint(delete_testcases);
48
- addEndpoint(get_testcases);
49
- addEndpoint(create_runs);
50
- addEndpoint(list_runs);
51
- addEndpoint(get_runs);
52
- addEndpoint(create_metrics);
53
- addEndpoint(update_metrics);
54
- addEndpoint(list_metrics);
55
- addEndpoint(delete_metrics);
56
- addEndpoint(get_metrics);
57
- addEndpoint(create_records);
58
- addEndpoint(list_records);
59
- addEndpoint(delete_records);
60
- addEndpoint(upsert_scores);
61
- addEndpoint(update_systems);
62
- addEndpoint(list_systems);
63
- addEndpoint(delete_systems);
64
- addEndpoint(get_systems);
65
- addEndpoint(upsert_systems);
66
- addEndpoint(get_systems_versions);
67
- addEndpoint(upsert_systems_versions);
68
- export function query(filters, endpoints) {
69
- const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
70
- const unmatchedFilters = new Set(filters);
71
- const filtered = endpoints.filter((endpoint) => {
72
- let included = false || allExcludes;
73
- for (const filter of filters) {
74
- if (match(filter, endpoint)) {
75
- unmatchedFilters.delete(filter);
76
- included = filter.op === 'include';
77
- }
78
- }
79
- return included;
80
- });
81
- // Check if any filters didn't match
82
- const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
83
- if (unmatched.length > 0) {
84
- throw new Error(`The following filters did not match any endpoints: ${unmatched
85
- .map((f) => `${f.type}=${f.value}`)
86
- .join(', ')}`);
87
- }
88
- return filtered;
89
- }
90
- function match({ type, value }, endpoint) {
91
- switch (type) {
92
- case 'resource': {
93
- const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
94
- const regex = new RegExp(regexStr);
95
- return regex.test(normalizeResource(endpoint.metadata.resource));
96
- }
97
- case 'operation':
98
- return endpoint.metadata.operation === value;
99
- case 'tag':
100
- return endpoint.metadata.tags.includes(value);
101
- case 'tool':
102
- return endpoint.tool.name === value;
103
- }
104
- }
105
- function normalizeResource(resource) {
106
- return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
107
- }
108
- //# sourceMappingURL=index.mjs.map