@pikaa-ai/pikaa 0.2.5 → 0.3.1
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.
- package/LICENSE +21 -0
- package/README.md +153 -104
- package/assets/frames/blocks/frame_1.txt +17 -0
- package/assets/frames/blocks/frame_10.txt +17 -0
- package/assets/frames/blocks/frame_11.txt +17 -0
- package/assets/frames/blocks/frame_12.txt +17 -0
- package/assets/frames/blocks/frame_13.txt +17 -0
- package/assets/frames/blocks/frame_14.txt +17 -0
- package/assets/frames/blocks/frame_15.txt +17 -0
- package/assets/frames/blocks/frame_16.txt +17 -0
- package/assets/frames/blocks/frame_17.txt +17 -0
- package/assets/frames/blocks/frame_18.txt +17 -0
- package/assets/frames/blocks/frame_19.txt +17 -0
- package/assets/frames/blocks/frame_2.txt +17 -0
- package/assets/frames/blocks/frame_20.txt +17 -0
- package/assets/frames/blocks/frame_21.txt +17 -0
- package/assets/frames/blocks/frame_22.txt +17 -0
- package/assets/frames/blocks/frame_23.txt +17 -0
- package/assets/frames/blocks/frame_24.txt +17 -0
- package/assets/frames/blocks/frame_25.txt +17 -0
- package/assets/frames/blocks/frame_26.txt +17 -0
- package/assets/frames/blocks/frame_27.txt +17 -0
- package/assets/frames/blocks/frame_28.txt +17 -0
- package/assets/frames/blocks/frame_29.txt +17 -0
- package/assets/frames/blocks/frame_3.txt +17 -0
- package/assets/frames/blocks/frame_30.txt +17 -0
- package/assets/frames/blocks/frame_31.txt +17 -0
- package/assets/frames/blocks/frame_32.txt +17 -0
- package/assets/frames/blocks/frame_33.txt +17 -0
- package/assets/frames/blocks/frame_34.txt +17 -0
- package/assets/frames/blocks/frame_35.txt +17 -0
- package/assets/frames/blocks/frame_36.txt +17 -0
- package/assets/frames/blocks/frame_4.txt +17 -0
- package/assets/frames/blocks/frame_5.txt +17 -0
- package/assets/frames/blocks/frame_6.txt +17 -0
- package/assets/frames/blocks/frame_7.txt +17 -0
- package/assets/frames/blocks/frame_8.txt +17 -0
- package/assets/frames/blocks/frame_9.txt +17 -0
- package/assets/frames/default/frame_1.txt +17 -0
- package/assets/frames/default/frame_10.txt +17 -0
- package/assets/frames/default/frame_11.txt +17 -0
- package/assets/frames/default/frame_12.txt +17 -0
- package/assets/frames/default/frame_13.txt +17 -0
- package/assets/frames/default/frame_14.txt +17 -0
- package/assets/frames/default/frame_15.txt +17 -0
- package/assets/frames/default/frame_16.txt +17 -0
- package/assets/frames/default/frame_17.txt +17 -0
- package/assets/frames/default/frame_18.txt +17 -0
- package/assets/frames/default/frame_19.txt +17 -0
- package/assets/frames/default/frame_2.txt +17 -0
- package/assets/frames/default/frame_20.txt +17 -0
- package/assets/frames/default/frame_21.txt +17 -0
- package/assets/frames/default/frame_22.txt +17 -0
- package/assets/frames/default/frame_23.txt +17 -0
- package/assets/frames/default/frame_24.txt +17 -0
- package/assets/frames/default/frame_25.txt +17 -0
- package/assets/frames/default/frame_26.txt +17 -0
- package/assets/frames/default/frame_27.txt +17 -0
- package/assets/frames/default/frame_28.txt +17 -0
- package/assets/frames/default/frame_29.txt +17 -0
- package/assets/frames/default/frame_3.txt +17 -0
- package/assets/frames/default/frame_30.txt +17 -0
- package/assets/frames/default/frame_31.txt +17 -0
- package/assets/frames/default/frame_32.txt +17 -0
- package/assets/frames/default/frame_33.txt +17 -0
- package/assets/frames/default/frame_34.txt +17 -0
- package/assets/frames/default/frame_35.txt +17 -0
- package/assets/frames/default/frame_36.txt +17 -0
- package/assets/frames/default/frame_4.txt +17 -0
- package/assets/frames/default/frame_5.txt +17 -0
- package/assets/frames/default/frame_6.txt +17 -0
- package/assets/frames/default/frame_7.txt +17 -0
- package/assets/frames/default/frame_8.txt +17 -0
- package/assets/frames/default/frame_9.txt +17 -0
- package/assets/frames/dots/frame_1.txt +17 -0
- package/assets/frames/dots/frame_10.txt +17 -0
- package/assets/frames/dots/frame_11.txt +17 -0
- package/assets/frames/dots/frame_12.txt +17 -0
- package/assets/frames/dots/frame_13.txt +17 -0
- package/assets/frames/dots/frame_14.txt +17 -0
- package/assets/frames/dots/frame_15.txt +17 -0
- package/assets/frames/dots/frame_16.txt +17 -0
- package/assets/frames/dots/frame_17.txt +17 -0
- package/assets/frames/dots/frame_18.txt +17 -0
- package/assets/frames/dots/frame_19.txt +17 -0
- package/assets/frames/dots/frame_2.txt +17 -0
- package/assets/frames/dots/frame_20.txt +17 -0
- package/assets/frames/dots/frame_21.txt +17 -0
- package/assets/frames/dots/frame_22.txt +17 -0
- package/assets/frames/dots/frame_23.txt +17 -0
- package/assets/frames/dots/frame_24.txt +17 -0
- package/assets/frames/dots/frame_25.txt +17 -0
- package/assets/frames/dots/frame_26.txt +17 -0
- package/assets/frames/dots/frame_27.txt +17 -0
- package/assets/frames/dots/frame_28.txt +17 -0
- package/assets/frames/dots/frame_29.txt +17 -0
- package/assets/frames/dots/frame_3.txt +17 -0
- package/assets/frames/dots/frame_30.txt +17 -0
- package/assets/frames/dots/frame_31.txt +17 -0
- package/assets/frames/dots/frame_32.txt +17 -0
- package/assets/frames/dots/frame_33.txt +17 -0
- package/assets/frames/dots/frame_34.txt +17 -0
- package/assets/frames/dots/frame_35.txt +17 -0
- package/assets/frames/dots/frame_36.txt +17 -0
- package/assets/frames/dots/frame_4.txt +17 -0
- package/assets/frames/dots/frame_5.txt +17 -0
- package/assets/frames/dots/frame_6.txt +17 -0
- package/assets/frames/dots/frame_7.txt +17 -0
- package/assets/frames/dots/frame_8.txt +17 -0
- package/assets/frames/dots/frame_9.txt +17 -0
- package/assets/frames/groupy/frame_1.txt +17 -0
- package/assets/frames/groupy/frame_10.txt +17 -0
- package/assets/frames/groupy/frame_11.txt +17 -0
- package/assets/frames/groupy/frame_12.txt +17 -0
- package/assets/frames/groupy/frame_13.txt +17 -0
- package/assets/frames/groupy/frame_14.txt +17 -0
- package/assets/frames/groupy/frame_15.txt +17 -0
- package/assets/frames/groupy/frame_16.txt +17 -0
- package/assets/frames/groupy/frame_17.txt +17 -0
- package/assets/frames/groupy/frame_18.txt +17 -0
- package/assets/frames/groupy/frame_19.txt +17 -0
- package/assets/frames/groupy/frame_2.txt +17 -0
- package/assets/frames/groupy/frame_20.txt +17 -0
- package/assets/frames/groupy/frame_21.txt +17 -0
- package/assets/frames/groupy/frame_22.txt +17 -0
- package/assets/frames/groupy/frame_23.txt +17 -0
- package/assets/frames/groupy/frame_24.txt +17 -0
- package/assets/frames/groupy/frame_25.txt +17 -0
- package/assets/frames/groupy/frame_26.txt +17 -0
- package/assets/frames/groupy/frame_27.txt +17 -0
- package/assets/frames/groupy/frame_28.txt +17 -0
- package/assets/frames/groupy/frame_29.txt +17 -0
- package/assets/frames/groupy/frame_3.txt +17 -0
- package/assets/frames/groupy/frame_30.txt +17 -0
- package/assets/frames/groupy/frame_31.txt +17 -0
- package/assets/frames/groupy/frame_32.txt +17 -0
- package/assets/frames/groupy/frame_33.txt +17 -0
- package/assets/frames/groupy/frame_34.txt +17 -0
- package/assets/frames/groupy/frame_35.txt +17 -0
- package/assets/frames/groupy/frame_36.txt +17 -0
- package/assets/frames/groupy/frame_4.txt +17 -0
- package/assets/frames/groupy/frame_5.txt +17 -0
- package/assets/frames/groupy/frame_6.txt +17 -0
- package/assets/frames/groupy/frame_7.txt +17 -0
- package/assets/frames/groupy/frame_8.txt +17 -0
- package/assets/frames/groupy/frame_9.txt +17 -0
- package/assets/frames/hash/frame_1.txt +17 -0
- package/assets/frames/hash/frame_10.txt +17 -0
- package/assets/frames/hash/frame_11.txt +17 -0
- package/assets/frames/hash/frame_12.txt +17 -0
- package/assets/frames/hash/frame_13.txt +17 -0
- package/assets/frames/hash/frame_14.txt +17 -0
- package/assets/frames/hash/frame_15.txt +17 -0
- package/assets/frames/hash/frame_16.txt +17 -0
- package/assets/frames/hash/frame_17.txt +17 -0
- package/assets/frames/hash/frame_18.txt +17 -0
- package/assets/frames/hash/frame_19.txt +17 -0
- package/assets/frames/hash/frame_2.txt +17 -0
- package/assets/frames/hash/frame_20.txt +17 -0
- package/assets/frames/hash/frame_21.txt +17 -0
- package/assets/frames/hash/frame_22.txt +17 -0
- package/assets/frames/hash/frame_23.txt +17 -0
- package/assets/frames/hash/frame_24.txt +17 -0
- package/assets/frames/hash/frame_25.txt +17 -0
- package/assets/frames/hash/frame_26.txt +17 -0
- package/assets/frames/hash/frame_27.txt +17 -0
- package/assets/frames/hash/frame_28.txt +17 -0
- package/assets/frames/hash/frame_29.txt +17 -0
- package/assets/frames/hash/frame_3.txt +17 -0
- package/assets/frames/hash/frame_30.txt +17 -0
- package/assets/frames/hash/frame_31.txt +17 -0
- package/assets/frames/hash/frame_32.txt +17 -0
- package/assets/frames/hash/frame_33.txt +17 -0
- package/assets/frames/hash/frame_34.txt +17 -0
- package/assets/frames/hash/frame_35.txt +17 -0
- package/assets/frames/hash/frame_36.txt +17 -0
- package/assets/frames/hash/frame_4.txt +17 -0
- package/assets/frames/hash/frame_5.txt +17 -0
- package/assets/frames/hash/frame_6.txt +17 -0
- package/assets/frames/hash/frame_7.txt +17 -0
- package/assets/frames/hash/frame_8.txt +17 -0
- package/assets/frames/hash/frame_9.txt +17 -0
- package/assets/frames/hbars/frame_1.txt +17 -0
- package/assets/frames/hbars/frame_10.txt +17 -0
- package/assets/frames/hbars/frame_11.txt +17 -0
- package/assets/frames/hbars/frame_12.txt +17 -0
- package/assets/frames/hbars/frame_13.txt +17 -0
- package/assets/frames/hbars/frame_14.txt +17 -0
- package/assets/frames/hbars/frame_15.txt +17 -0
- package/assets/frames/hbars/frame_16.txt +17 -0
- package/assets/frames/hbars/frame_17.txt +17 -0
- package/assets/frames/hbars/frame_18.txt +17 -0
- package/assets/frames/hbars/frame_19.txt +17 -0
- package/assets/frames/hbars/frame_2.txt +17 -0
- package/assets/frames/hbars/frame_20.txt +17 -0
- package/assets/frames/hbars/frame_21.txt +17 -0
- package/assets/frames/hbars/frame_22.txt +17 -0
- package/assets/frames/hbars/frame_23.txt +17 -0
- package/assets/frames/hbars/frame_24.txt +17 -0
- package/assets/frames/hbars/frame_25.txt +17 -0
- package/assets/frames/hbars/frame_26.txt +17 -0
- package/assets/frames/hbars/frame_27.txt +17 -0
- package/assets/frames/hbars/frame_28.txt +17 -0
- package/assets/frames/hbars/frame_29.txt +17 -0
- package/assets/frames/hbars/frame_3.txt +17 -0
- package/assets/frames/hbars/frame_30.txt +17 -0
- package/assets/frames/hbars/frame_31.txt +17 -0
- package/assets/frames/hbars/frame_32.txt +17 -0
- package/assets/frames/hbars/frame_33.txt +17 -0
- package/assets/frames/hbars/frame_34.txt +17 -0
- package/assets/frames/hbars/frame_35.txt +17 -0
- package/assets/frames/hbars/frame_36.txt +17 -0
- package/assets/frames/hbars/frame_4.txt +17 -0
- package/assets/frames/hbars/frame_5.txt +17 -0
- package/assets/frames/hbars/frame_6.txt +17 -0
- package/assets/frames/hbars/frame_7.txt +17 -0
- package/assets/frames/hbars/frame_8.txt +17 -0
- package/assets/frames/hbars/frame_9.txt +17 -0
- package/assets/frames/mesosfer/frame_1.txt +17 -0
- package/assets/frames/mesosfer/frame_10.txt +17 -0
- package/assets/frames/mesosfer/frame_11.txt +17 -0
- package/assets/frames/mesosfer/frame_12.txt +17 -0
- package/assets/frames/mesosfer/frame_13.txt +17 -0
- package/assets/frames/mesosfer/frame_14.txt +17 -0
- package/assets/frames/mesosfer/frame_15.txt +17 -0
- package/assets/frames/mesosfer/frame_16.txt +17 -0
- package/assets/frames/mesosfer/frame_17.txt +17 -0
- package/assets/frames/mesosfer/frame_18.txt +17 -0
- package/assets/frames/mesosfer/frame_19.txt +17 -0
- package/assets/frames/mesosfer/frame_2.txt +17 -0
- package/assets/frames/mesosfer/frame_20.txt +17 -0
- package/assets/frames/mesosfer/frame_21.txt +17 -0
- package/assets/frames/mesosfer/frame_22.txt +17 -0
- package/assets/frames/mesosfer/frame_23.txt +17 -0
- package/assets/frames/mesosfer/frame_24.txt +17 -0
- package/assets/frames/mesosfer/frame_25.txt +17 -0
- package/assets/frames/mesosfer/frame_26.txt +17 -0
- package/assets/frames/mesosfer/frame_27.txt +17 -0
- package/assets/frames/mesosfer/frame_28.txt +17 -0
- package/assets/frames/mesosfer/frame_29.txt +17 -0
- package/assets/frames/mesosfer/frame_3.txt +17 -0
- package/assets/frames/mesosfer/frame_30.txt +17 -0
- package/assets/frames/mesosfer/frame_31.txt +17 -0
- package/assets/frames/mesosfer/frame_32.txt +17 -0
- package/assets/frames/mesosfer/frame_33.txt +17 -0
- package/assets/frames/mesosfer/frame_34.txt +17 -0
- package/assets/frames/mesosfer/frame_35.txt +17 -0
- package/assets/frames/mesosfer/frame_36.txt +17 -0
- package/assets/frames/mesosfer/frame_4.txt +17 -0
- package/assets/frames/mesosfer/frame_5.txt +17 -0
- package/assets/frames/mesosfer/frame_6.txt +17 -0
- package/assets/frames/mesosfer/frame_7.txt +17 -0
- package/assets/frames/mesosfer/frame_8.txt +17 -0
- package/assets/frames/mesosfer/frame_9.txt +17 -0
- package/assets/frames/shapes/frame_1.txt +17 -0
- package/assets/frames/shapes/frame_10.txt +17 -0
- package/assets/frames/shapes/frame_11.txt +17 -0
- package/assets/frames/shapes/frame_12.txt +17 -0
- package/assets/frames/shapes/frame_13.txt +17 -0
- package/assets/frames/shapes/frame_14.txt +17 -0
- package/assets/frames/shapes/frame_15.txt +17 -0
- package/assets/frames/shapes/frame_16.txt +17 -0
- package/assets/frames/shapes/frame_17.txt +17 -0
- package/assets/frames/shapes/frame_18.txt +17 -0
- package/assets/frames/shapes/frame_19.txt +17 -0
- package/assets/frames/shapes/frame_2.txt +17 -0
- package/assets/frames/shapes/frame_20.txt +17 -0
- package/assets/frames/shapes/frame_21.txt +17 -0
- package/assets/frames/shapes/frame_22.txt +17 -0
- package/assets/frames/shapes/frame_23.txt +17 -0
- package/assets/frames/shapes/frame_24.txt +17 -0
- package/assets/frames/shapes/frame_25.txt +17 -0
- package/assets/frames/shapes/frame_26.txt +17 -0
- package/assets/frames/shapes/frame_27.txt +17 -0
- package/assets/frames/shapes/frame_28.txt +17 -0
- package/assets/frames/shapes/frame_29.txt +17 -0
- package/assets/frames/shapes/frame_3.txt +17 -0
- package/assets/frames/shapes/frame_30.txt +17 -0
- package/assets/frames/shapes/frame_31.txt +17 -0
- package/assets/frames/shapes/frame_32.txt +17 -0
- package/assets/frames/shapes/frame_33.txt +17 -0
- package/assets/frames/shapes/frame_34.txt +17 -0
- package/assets/frames/shapes/frame_35.txt +17 -0
- package/assets/frames/shapes/frame_36.txt +17 -0
- package/assets/frames/shapes/frame_4.txt +17 -0
- package/assets/frames/shapes/frame_5.txt +17 -0
- package/assets/frames/shapes/frame_6.txt +17 -0
- package/assets/frames/shapes/frame_7.txt +17 -0
- package/assets/frames/shapes/frame_8.txt +17 -0
- package/assets/frames/shapes/frame_9.txt +17 -0
- package/assets/frames/slug/frame_1.txt +17 -0
- package/assets/frames/slug/frame_10.txt +17 -0
- package/assets/frames/slug/frame_11.txt +17 -0
- package/assets/frames/slug/frame_12.txt +17 -0
- package/assets/frames/slug/frame_13.txt +17 -0
- package/assets/frames/slug/frame_14.txt +17 -0
- package/assets/frames/slug/frame_15.txt +17 -0
- package/assets/frames/slug/frame_16.txt +17 -0
- package/assets/frames/slug/frame_17.txt +17 -0
- package/assets/frames/slug/frame_18.txt +17 -0
- package/assets/frames/slug/frame_19.txt +17 -0
- package/assets/frames/slug/frame_2.txt +17 -0
- package/assets/frames/slug/frame_20.txt +17 -0
- package/assets/frames/slug/frame_21.txt +17 -0
- package/assets/frames/slug/frame_22.txt +17 -0
- package/assets/frames/slug/frame_23.txt +17 -0
- package/assets/frames/slug/frame_24.txt +17 -0
- package/assets/frames/slug/frame_25.txt +17 -0
- package/assets/frames/slug/frame_26.txt +17 -0
- package/assets/frames/slug/frame_27.txt +17 -0
- package/assets/frames/slug/frame_28.txt +17 -0
- package/assets/frames/slug/frame_29.txt +17 -0
- package/assets/frames/slug/frame_3.txt +17 -0
- package/assets/frames/slug/frame_30.txt +17 -0
- package/assets/frames/slug/frame_31.txt +17 -0
- package/assets/frames/slug/frame_32.txt +17 -0
- package/assets/frames/slug/frame_33.txt +17 -0
- package/assets/frames/slug/frame_34.txt +17 -0
- package/assets/frames/slug/frame_35.txt +17 -0
- package/assets/frames/slug/frame_36.txt +17 -0
- package/assets/frames/slug/frame_4.txt +17 -0
- package/assets/frames/slug/frame_5.txt +17 -0
- package/assets/frames/slug/frame_6.txt +17 -0
- package/assets/frames/slug/frame_7.txt +17 -0
- package/assets/frames/slug/frame_8.txt +17 -0
- package/assets/frames/slug/frame_9.txt +17 -0
- package/assets/frames/vbars/frame_1.txt +17 -0
- package/assets/frames/vbars/frame_10.txt +17 -0
- package/assets/frames/vbars/frame_11.txt +17 -0
- package/assets/frames/vbars/frame_12.txt +17 -0
- package/assets/frames/vbars/frame_13.txt +17 -0
- package/assets/frames/vbars/frame_14.txt +17 -0
- package/assets/frames/vbars/frame_15.txt +17 -0
- package/assets/frames/vbars/frame_16.txt +17 -0
- package/assets/frames/vbars/frame_17.txt +17 -0
- package/assets/frames/vbars/frame_18.txt +17 -0
- package/assets/frames/vbars/frame_19.txt +17 -0
- package/assets/frames/vbars/frame_2.txt +17 -0
- package/assets/frames/vbars/frame_20.txt +17 -0
- package/assets/frames/vbars/frame_21.txt +17 -0
- package/assets/frames/vbars/frame_22.txt +17 -0
- package/assets/frames/vbars/frame_23.txt +17 -0
- package/assets/frames/vbars/frame_24.txt +17 -0
- package/assets/frames/vbars/frame_25.txt +17 -0
- package/assets/frames/vbars/frame_26.txt +17 -0
- package/assets/frames/vbars/frame_27.txt +17 -0
- package/assets/frames/vbars/frame_28.txt +17 -0
- package/assets/frames/vbars/frame_29.txt +17 -0
- package/assets/frames/vbars/frame_3.txt +17 -0
- package/assets/frames/vbars/frame_30.txt +17 -0
- package/assets/frames/vbars/frame_31.txt +17 -0
- package/assets/frames/vbars/frame_32.txt +17 -0
- package/assets/frames/vbars/frame_33.txt +17 -0
- package/assets/frames/vbars/frame_34.txt +17 -0
- package/assets/frames/vbars/frame_35.txt +17 -0
- package/assets/frames/vbars/frame_36.txt +17 -0
- package/assets/frames/vbars/frame_4.txt +17 -0
- package/assets/frames/vbars/frame_5.txt +17 -0
- package/assets/frames/vbars/frame_6.txt +17 -0
- package/assets/frames/vbars/frame_7.txt +17 -0
- package/assets/frames/vbars/frame_8.txt +17 -0
- package/assets/frames/vbars/frame_9.txt +17 -0
- package/bin/pikaa.js +1 -0
- package/dist/cli.js +3484 -879
- package/dist/index.js +6835 -437
- package/package.json +6 -1
- package/skills/adaptyv/SKILL.md +240 -0
- package/skills/adaptyv/references/api-endpoints.md +690 -0
- package/skills/aeon/SKILL.md +402 -0
- package/skills/aeon/references/anomaly_detection.md +154 -0
- package/skills/aeon/references/classification.md +144 -0
- package/skills/aeon/references/clustering.md +123 -0
- package/skills/aeon/references/datasets_benchmarking.md +392 -0
- package/skills/aeon/references/distances.md +256 -0
- package/skills/aeon/references/forecasting.md +109 -0
- package/skills/aeon/references/networks.md +289 -0
- package/skills/aeon/references/regression.md +118 -0
- package/skills/aeon/references/segmentation.md +163 -0
- package/skills/aeon/references/similarity_search.md +187 -0
- package/skills/aeon/references/transformations.md +246 -0
- package/skills/analytical-method-validation/SKILL.md +299 -0
- package/skills/analytical-method-validation/assets/validation-protocol-template.md +106 -0
- package/skills/analytical-method-validation/assets/validation-report-template.md +116 -0
- package/skills/analytical-method-validation/references/compendial-and-clsi.md +96 -0
- package/skills/analytical-method-validation/references/framework-selection.md +87 -0
- package/skills/analytical-method-validation/references/ich-m10-bioanalytical.md +123 -0
- package/skills/analytical-method-validation/references/ich-q2r2.md +229 -0
- package/skills/analytical-method-validation/references/source-ledger.md +125 -0
- package/skills/analytical-method-validation/references/statistics.md +209 -0
- package/skills/analytical-method-validation/scripts/_catalog.py +499 -0
- package/skills/analytical-method-validation/scripts/_common.py +955 -0
- package/skills/analytical-method-validation/scripts/check_accuracy_precision.py +328 -0
- package/skills/analytical-method-validation/scripts/check_bioanalytical_run.py +293 -0
- package/skills/analytical-method-validation/scripts/check_detection_limits.py +310 -0
- package/skills/analytical-method-validation/scripts/check_response.py +243 -0
- package/skills/analytical-method-validation/scripts/compare_methods.py +215 -0
- package/skills/analytical-method-validation/scripts/plan_validation.py +381 -0
- package/skills/anndata/SKILL.md +431 -0
- package/skills/anndata/references/best_practices.md +532 -0
- package/skills/anndata/references/concatenation.md +399 -0
- package/skills/anndata/references/data_structure.md +314 -0
- package/skills/anndata/references/io_operations.md +466 -0
- package/skills/anndata/references/manipulation.md +516 -0
- package/skills/arbor/SKILL.md +152 -0
- package/skills/arbor/references/arbor-upstream.md +91 -0
- package/skills/arbor/references/executor-brief.md +68 -0
- package/skills/arbor/references/htr-methodology.md +177 -0
- package/skills/arbor/references/report-template.md +39 -0
- package/skills/arbor/scripts/tree.py +564 -0
- package/skills/arboreto/SKILL.md +267 -0
- package/skills/arboreto/references/algorithms.md +152 -0
- package/skills/arboreto/references/basic_inference.md +181 -0
- package/skills/arboreto/references/distributed_computing.md +242 -0
- package/skills/arboreto/scripts/basic_grn_inference.py +107 -0
- package/skills/astropy/SKILL.md +353 -0
- package/skills/astropy/references/coordinates.md +280 -0
- package/skills/astropy/references/cosmology.md +309 -0
- package/skills/astropy/references/fits.md +398 -0
- package/skills/astropy/references/tables.md +495 -0
- package/skills/astropy/references/time.md +412 -0
- package/skills/astropy/references/units.md +178 -0
- package/skills/astropy/references/wcs_and_other_modules.md +377 -0
- package/skills/autoskill/SKILL.md +233 -0
- package/skills/autoskill/config.yaml +53 -0
- package/skills/autoskill/references/https-proxy.md +62 -0
- package/skills/autoskill/references/screenpipe-config.yaml +61 -0
- package/skills/autoskill/scripts/autoskill.py +35 -0
- package/skills/autoskill/scripts/backends.py +116 -0
- package/skills/autoskill/scripts/cluster.py +54 -0
- package/skills/autoskill/scripts/doctor.py +108 -0
- package/skills/autoskill/scripts/fetch_window.py +33 -0
- package/skills/autoskill/scripts/match_skills.py +46 -0
- package/skills/autoskill/scripts/promote.py +58 -0
- package/skills/autoskill/scripts/redact.py +40 -0
- package/skills/autoskill/scripts/run.py +194 -0
- package/skills/autoskill/scripts/synthesize.py +72 -0
- package/skills/benchling-integration/SKILL.md +229 -0
- package/skills/benchling-integration/references/api_endpoints.md +883 -0
- package/skills/benchling-integration/references/authentication.md +390 -0
- package/skills/benchling-integration/references/core_capabilities.md +355 -0
- package/skills/benchling-integration/references/eventbridge.md +255 -0
- package/skills/benchling-integration/references/sdk_reference.md +772 -0
- package/skills/bgpt-paper-search/SKILL.md +75 -0
- package/skills/bids/SKILL.md +237 -0
- package/skills/bids/references/beps.yml +637 -0
- package/skills/bids/references/bids_schema.json +21015 -0
- package/skills/bids/references/bids_specification.md +165 -0
- package/skills/bids/references/conversion_tools.md +475 -0
- package/skills/bids/references/core_workflows.md +552 -0
- package/skills/bids/references/metadata_fields.md +365 -0
- package/skills/bids/scripts/update_schema.py +89 -0
- package/skills/biopython/SKILL.md +472 -0
- package/skills/biopython/references/advanced.md +580 -0
- package/skills/biopython/references/alignment.md +377 -0
- package/skills/biopython/references/blast.md +463 -0
- package/skills/biopython/references/databases.md +492 -0
- package/skills/biopython/references/phylogenetics.md +566 -0
- package/skills/biopython/references/sequence_io.md +289 -0
- package/skills/biopython/references/structure.md +564 -0
- package/skills/bioservices/SKILL.md +399 -0
- package/skills/bioservices/references/identifier_mapping.md +685 -0
- package/skills/bioservices/references/services_reference.md +638 -0
- package/skills/bioservices/references/workflow_patterns.md +813 -0
- package/skills/bioservices/scripts/batch_id_converter.py +347 -0
- package/skills/bioservices/scripts/compound_cross_reference.py +387 -0
- package/skills/bioservices/scripts/pathway_analysis.py +309 -0
- package/skills/bioservices/scripts/protein_analysis_workflow.py +441 -0
- package/skills/bulk-rnaseq/SKILL.md +198 -0
- package/skills/bulk-rnaseq/references/counts-and-handoff.md +91 -0
- package/skills/bulk-rnaseq/references/design-and-qc.md +68 -0
- package/skills/bulk-rnaseq/references/upstream-manual.md +128 -0
- package/skills/bulk-rnaseq/references/upstream-nfcore.md +108 -0
- package/skills/bulk-rnaseq/scripts/build_counts_matrix.py +203 -0
- package/skills/bulk-rnaseq/scripts/validate_samplesheet.py +206 -0
- package/skills/cellxgene-census/SKILL.md +283 -0
- package/skills/cellxgene-census/references/census_schema.md +218 -0
- package/skills/cellxgene-census/references/common_patterns.md +368 -0
- package/skills/cellxgene-census/references/core_workflow_patterns.md +297 -0
- package/skills/cirq/SKILL.md +370 -0
- package/skills/cirq/references/building.md +307 -0
- package/skills/cirq/references/experiments.md +572 -0
- package/skills/cirq/references/hardware.md +527 -0
- package/skills/cirq/references/noise.md +514 -0
- package/skills/cirq/references/simulation.md +353 -0
- package/skills/cirq/references/transformation.md +416 -0
- package/skills/citation-management/SKILL.md +329 -0
- package/skills/citation-management/assets/bibtex_template.bib +264 -0
- package/skills/citation-management/assets/citation_checklist.md +386 -0
- package/skills/citation-management/references/best_practices.md +91 -0
- package/skills/citation-management/references/bibtex_formatting.md +908 -0
- package/skills/citation-management/references/citation_validation.md +835 -0
- package/skills/citation-management/references/core_workflow.md +569 -0
- package/skills/citation-management/references/example_workflows.md +126 -0
- package/skills/citation-management/references/google_scholar_search.md +732 -0
- package/skills/citation-management/references/metadata_extraction.md +870 -0
- package/skills/citation-management/references/pubmed_search.md +839 -0
- package/skills/citation-management/references/script_reference.md +250 -0
- package/skills/citation-management/references/search_strategies.md +110 -0
- package/skills/citation-management/scripts/_common.py +331 -0
- package/skills/citation-management/scripts/doi_to_bibtex.py +204 -0
- package/skills/citation-management/scripts/extract_metadata.py +690 -0
- package/skills/citation-management/scripts/format_bibtex.py +356 -0
- package/skills/citation-management/scripts/search_google_scholar.py +268 -0
- package/skills/citation-management/scripts/search_openalex.py +297 -0
- package/skills/citation-management/scripts/search_pubmed.py +419 -0
- package/skills/citation-management/scripts/validate_citations.py +688 -0
- package/skills/clinical-decision-support/SKILL.md +238 -0
- package/skills/clinical-decision-support/assets/aggregate_cohort_table_template.json +114 -0
- package/skills/clinical-decision-support/assets/aggregate_model_evaluation_template.json +115 -0
- package/skills/clinical-decision-support/assets/artifact_intended_use_template.json +81 -0
- package/skills/clinical-decision-support/assets/decision_logic_traceability_template.json +108 -0
- package/skills/clinical-decision-support/assets/deidentification_checklist_template.json +176 -0
- package/skills/clinical-decision-support/assets/evidence_profile_template.json +139 -0
- package/skills/clinical-decision-support/assets/survival_analysis_plan_template.json +134 -0
- package/skills/clinical-decision-support/references/README.md +62 -0
- package/skills/clinical-decision-support/references/cohort_evaluation.md +142 -0
- package/skills/clinical-decision-support/references/decision_logic_traceability.md +146 -0
- package/skills/clinical-decision-support/references/evidence_profiles.md +153 -0
- package/skills/clinical-decision-support/references/model_biomarker_evaluation.md +152 -0
- package/skills/clinical-decision-support/references/privacy_and_disclosure.md +144 -0
- package/skills/clinical-decision-support/references/regulatory_and_governance.md +104 -0
- package/skills/clinical-decision-support/references/safety_and_scope.md +103 -0
- package/skills/clinical-decision-support/references/security_validation.md +60 -0
- package/skills/clinical-decision-support/references/sources.md +119 -0
- package/skills/clinical-decision-support/references/study_reporting.md +134 -0
- package/skills/clinical-decision-support/references/survival_analysis.md +156 -0
- package/skills/clinical-decision-support/scripts/_common.py +223 -0
- package/skills/clinical-decision-support/scripts/cohort_table_generator.py +288 -0
- package/skills/clinical-decision-support/scripts/decision_logic_traceability.py +313 -0
- package/skills/clinical-decision-support/scripts/deidentification_checklist.py +260 -0
- package/skills/clinical-decision-support/scripts/evidence_profile_check.py +259 -0
- package/skills/clinical-decision-support/scripts/model_biomarker_evaluation.py +345 -0
- package/skills/clinical-decision-support/scripts/survival_plan_validator.py +294 -0
- package/skills/clinical-decision-support/scripts/validate_cds_artifact.py +269 -0
- package/skills/clinical-reports/SKILL.md +248 -0
- package/skills/clinical-reports/assets/adverse_event_aggregate_input_template.csv +1 -0
- package/skills/clinical-reports/assets/case_report_template.json +43 -0
- package/skills/clinical-reports/assets/clinical_trial_csr_template.json +51 -0
- package/skills/clinical-reports/assets/clinical_trial_results_template.json +66 -0
- package/skills/clinical-reports/assets/clinical_trial_safety_aggregate_template.json +49 -0
- package/skills/clinical-reports/assets/consistency_manifest_template.json +15 -0
- package/skills/clinical-reports/assets/deidentification_process_checklist.json +56 -0
- package/skills/clinical-reports/assets/lab_report_template.json +36 -0
- package/skills/clinical-reports/assets/pathology_report_template.json +36 -0
- package/skills/clinical-reports/assets/provenance_manifest_template.json +17 -0
- package/skills/clinical-reports/assets/quality_review_checklist.json +34 -0
- package/skills/clinical-reports/assets/radiology_report_template.json +34 -0
- package/skills/clinical-reports/assets/research_summary_template.json +36 -0
- package/skills/clinical-reports/assets/terminology_manifest_template.json +11 -0
- package/skills/clinical-reports/assets/trial_protocol_reporting_checklist.json +70 -0
- package/skills/clinical-reports/references/README.md +34 -0
- package/skills/clinical-reports/references/case_report_guidelines.md +72 -0
- package/skills/clinical-reports/references/clinical_trial_reporting.md +97 -0
- package/skills/clinical-reports/references/data_presentation.md +92 -0
- package/skills/clinical-reports/references/diagnostic_reports_standards.md +76 -0
- package/skills/clinical-reports/references/medical_terminology.md +84 -0
- package/skills/clinical-reports/references/privacy_and_deidentification.md +84 -0
- package/skills/clinical-reports/references/professional_review.md +78 -0
- package/skills/clinical-reports/references/report_type_routing.md +57 -0
- package/skills/clinical-reports/references/safety_reporting.md +109 -0
- package/skills/clinical-reports/references/sources.md +75 -0
- package/skills/clinical-reports/scripts/_common.py +263 -0
- package/skills/clinical-reports/scripts/check_deidentification.py +298 -0
- package/skills/clinical-reports/scripts/consistency_checker.py +390 -0
- package/skills/clinical-reports/scripts/format_adverse_events.py +455 -0
- package/skills/clinical-reports/scripts/generate_report_template.py +115 -0
- package/skills/clinical-reports/scripts/provenance_validator.py +263 -0
- package/skills/clinical-reports/scripts/terminology_validator.py +277 -0
- package/skills/clinical-reports/scripts/validate_case_report.py +278 -0
- package/skills/clinical-reports/scripts/validate_trial_report.py +534 -0
- package/skills/cobrapy/SKILL.md +496 -0
- package/skills/cobrapy/references/api_quick_reference.md +665 -0
- package/skills/cobrapy/references/workflows.md +600 -0
- package/skills/consciousness-council/SKILL.md +151 -0
- package/skills/consciousness-council/references/advanced-configurations.md +96 -0
- package/skills/dask/SKILL.md +482 -0
- package/skills/dask/references/arrays.md +495 -0
- package/skills/dask/references/bags.md +468 -0
- package/skills/dask/references/best-practices.md +277 -0
- package/skills/dask/references/dataframes.md +370 -0
- package/skills/dask/references/futures.md +541 -0
- package/skills/dask/references/schedulers.md +517 -0
- package/skills/database-lookup/SKILL.md +386 -0
- package/skills/database-lookup/references/addgene.md +38 -0
- package/skills/database-lookup/references/alphafold.md +52 -0
- package/skills/database-lookup/references/alphavantage.md +261 -0
- package/skills/database-lookup/references/bea.md +409 -0
- package/skills/database-lookup/references/bindingdb.md +85 -0
- package/skills/database-lookup/references/biogrid.md +110 -0
- package/skills/database-lookup/references/bls.md +235 -0
- package/skills/database-lookup/references/brenda.md +71 -0
- package/skills/database-lookup/references/cbioportal.md +206 -0
- package/skills/database-lookup/references/census.md +251 -0
- package/skills/database-lookup/references/chebi.md +103 -0
- package/skills/database-lookup/references/chembl.md +80 -0
- package/skills/database-lookup/references/clinicaltrials.md +86 -0
- package/skills/database-lookup/references/clinpgx.md +64 -0
- package/skills/database-lookup/references/clinvar.md +91 -0
- package/skills/database-lookup/references/cod.md +121 -0
- package/skills/database-lookup/references/cosmic.md +59 -0
- package/skills/database-lookup/references/dailymed.md +65 -0
- package/skills/database-lookup/references/database_selection_guide.md +166 -0
- package/skills/database-lookup/references/datacommons.md +237 -0
- package/skills/database-lookup/references/dbsnp.md +143 -0
- package/skills/database-lookup/references/disgenet.md +52 -0
- package/skills/database-lookup/references/drugbank.md +54 -0
- package/skills/database-lookup/references/ecb.md +191 -0
- package/skills/database-lookup/references/emdb.md +37 -0
- package/skills/database-lookup/references/ena.md +372 -0
- package/skills/database-lookup/references/encode.md +47 -0
- package/skills/database-lookup/references/ensembl.md +539 -0
- package/skills/database-lookup/references/epa.md +232 -0
- package/skills/database-lookup/references/eurostat.md +237 -0
- package/skills/database-lookup/references/fda.md +64 -0
- package/skills/database-lookup/references/federal-reserve.md +216 -0
- package/skills/database-lookup/references/fred.md +297 -0
- package/skills/database-lookup/references/gene-ontology.md +147 -0
- package/skills/database-lookup/references/geo.md +130 -0
- package/skills/database-lookup/references/gnomad.md +93 -0
- package/skills/database-lookup/references/gtex.md +136 -0
- package/skills/database-lookup/references/gwas-catalog.md +46 -0
- package/skills/database-lookup/references/hca.md +35 -0
- package/skills/database-lookup/references/hpo.md +48 -0
- package/skills/database-lookup/references/human-protein-atlas.md +57 -0
- package/skills/database-lookup/references/interpro.md +120 -0
- package/skills/database-lookup/references/jaspar.md +50 -0
- package/skills/database-lookup/references/kegg.md +78 -0
- package/skills/database-lookup/references/lincs-l1000.md +68 -0
- package/skills/database-lookup/references/materials-project.md +123 -0
- package/skills/database-lookup/references/metabolomics-workbench.md +98 -0
- package/skills/database-lookup/references/monarch.md +46 -0
- package/skills/database-lookup/references/mousemine.md +40 -0
- package/skills/database-lookup/references/nasa-exoplanet-archive.md +112 -0
- package/skills/database-lookup/references/nasa.md +121 -0
- package/skills/database-lookup/references/ncbi-gene.md +64 -0
- package/skills/database-lookup/references/ncbi-protein.md +104 -0
- package/skills/database-lookup/references/ncbi-taxonomy.md +121 -0
- package/skills/database-lookup/references/nist.md +105 -0
- package/skills/database-lookup/references/noaa.md +199 -0
- package/skills/database-lookup/references/omim.md +114 -0
- package/skills/database-lookup/references/opentargets.md +459 -0
- package/skills/database-lookup/references/openweathermap.md +255 -0
- package/skills/database-lookup/references/pdb.md +121 -0
- package/skills/database-lookup/references/pride.md +74 -0
- package/skills/database-lookup/references/pubchem.md +145 -0
- package/skills/database-lookup/references/quickgo.md +45 -0
- package/skills/database-lookup/references/reactome.md +140 -0
- package/skills/database-lookup/references/retrieval-contract.md +123 -0
- package/skills/database-lookup/references/rummageo.md +32 -0
- package/skills/database-lookup/references/sdss.md +130 -0
- package/skills/database-lookup/references/sec-edgar.md +315 -0
- package/skills/database-lookup/references/simbad.md +405 -0
- package/skills/database-lookup/references/sra.md +149 -0
- package/skills/database-lookup/references/string.md +283 -0
- package/skills/database-lookup/references/tcga-gdc.md +58 -0
- package/skills/database-lookup/references/treasury.md +215 -0
- package/skills/database-lookup/references/ucsc-genome.md +135 -0
- package/skills/database-lookup/references/uniprot.md +283 -0
- package/skills/database-lookup/references/usgs.md +260 -0
- package/skills/database-lookup/references/uspto.md +130 -0
- package/skills/database-lookup/references/who.md +283 -0
- package/skills/database-lookup/references/worldbank.md +239 -0
- package/skills/database-lookup/references/zinc.md +202 -0
- package/skills/datamol/SKILL.md +200 -0
- package/skills/datamol/references/conformers_module.md +131 -0
- package/skills/datamol/references/core_api.md +136 -0
- package/skills/datamol/references/core_workflows.md +451 -0
- package/skills/datamol/references/descriptors_viz.md +195 -0
- package/skills/datamol/references/fragments_scaffolds.md +174 -0
- package/skills/datamol/references/io_module.md +112 -0
- package/skills/datamol/references/reactions_data.md +218 -0
- package/skills/datamol/references/workflow_patterns.md +104 -0
- package/skills/deepchem/SKILL.md +244 -0
- package/skills/deepchem/references/api_reference.md +305 -0
- package/skills/deepchem/references/core_capabilities.md +276 -0
- package/skills/deepchem/references/typical_workflows.md +109 -0
- package/skills/deepchem/references/workflows.md +491 -0
- package/skills/deepchem/scripts/graph_neural_network.py +350 -0
- package/skills/deepchem/scripts/predict_solubility.py +223 -0
- package/skills/deepchem/scripts/transfer_learning.py +443 -0
- package/skills/deepspot-m/SKILL.md +175 -0
- package/skills/deepspot-m/references/api.md +186 -0
- package/skills/deepspot-m/references/whole_slide.md +174 -0
- package/skills/deeptools/SKILL.md +412 -0
- package/skills/deeptools/assets/quick_reference.md +65 -0
- package/skills/deeptools/references/core_workflows.md +134 -0
- package/skills/deeptools/references/effective_genome_sizes.md +118 -0
- package/skills/deeptools/references/normalization_methods.md +424 -0
- package/skills/deeptools/references/tools_reference.md +569 -0
- package/skills/deeptools/references/workflows.md +476 -0
- package/skills/deeptools/scripts/validate_files.py +195 -0
- package/skills/deeptools/scripts/workflow_generator.py +520 -0
- package/skills/depmap/SKILL.md +301 -0
- package/skills/depmap/references/dependency_analysis.md +178 -0
- package/skills/dhdna-profiler/SKILL.md +184 -0
- package/skills/dhdna-profiler/references/advanced-profiling.md +72 -0
- package/skills/diffdock/SKILL.md +488 -0
- package/skills/diffdock/assets/batch_template.csv +4 -0
- package/skills/diffdock/assets/custom_inference_config.yaml +94 -0
- package/skills/diffdock/references/confidence_and_limitations.md +182 -0
- package/skills/diffdock/references/parameters_reference.md +173 -0
- package/skills/diffdock/references/workflows_examples.md +401 -0
- package/skills/diffdock/scripts/analyze_results.py +346 -0
- package/skills/diffdock/scripts/prepare_batch_csv.py +257 -0
- package/skills/diffdock/scripts/setup_check.py +283 -0
- package/skills/dnanexus-integration/SKILL.md +325 -0
- package/skills/dnanexus-integration/references/app-development.md +371 -0
- package/skills/dnanexus-integration/references/authentication.md +226 -0
- package/skills/dnanexus-integration/references/configuration.md +444 -0
- package/skills/dnanexus-integration/references/data-operations.md +474 -0
- package/skills/dnanexus-integration/references/job-execution.md +482 -0
- package/skills/dnanexus-integration/references/operations-and-troubleshooting.md +506 -0
- package/skills/dnanexus-integration/references/python-sdk.md +548 -0
- package/skills/dnanexus-integration/references/sources.md +168 -0
- package/skills/dnanexus-integration/references/workflow-languages.md +292 -0
- package/skills/dnanexus-integration/scripts/inspect_dxpy.py +366 -0
- package/skills/dnanexus-integration/scripts/validate_dxapp.py +796 -0
- package/skills/docx/LICENSE.txt +30 -0
- package/skills/docx/SKILL.md +99 -0
- package/skills/docx/scripts/__init__.py +1 -0
- package/skills/docx/scripts/accept_changes.py +135 -0
- package/skills/docx/scripts/comment.py +368 -0
- package/skills/docx/scripts/merge_runs.py +310 -0
- package/skills/docx/scripts/office/helpers/__init__.py +111 -0
- package/skills/docx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/docx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/docx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/docx/scripts/office/soffice.py +232 -0
- package/skills/docx/scripts/office/validate.py +173 -0
- package/skills/docx/scripts/office/validators/__init__.py +15 -0
- package/skills/docx/scripts/office/validators/base.py +875 -0
- package/skills/docx/scripts/office/validators/docx.py +466 -0
- package/skills/docx/scripts/office/validators/pptx.py +441 -0
- package/skills/docx/scripts/office/validators/redlining.py +299 -0
- package/skills/docx/scripts/templates/comments.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/skills/docx/scripts/templates/people.xml +3 -0
- package/skills/esm/SKILL.md +334 -0
- package/skills/esm/references/biohub-platform.md +111 -0
- package/skills/esm/references/esm-c-api.md +609 -0
- package/skills/esm/references/esm3-api.md +462 -0
- package/skills/esm/references/forge-api.md +675 -0
- package/skills/esm/references/workflows.md +685 -0
- package/skills/etetoolkit/SKILL.md +327 -0
- package/skills/etetoolkit/references/api_reference.md +546 -0
- package/skills/etetoolkit/references/migration-ete3-to-ete4.md +579 -0
- package/skills/etetoolkit/references/taxonomy.md +362 -0
- package/skills/etetoolkit/references/visualization.md +516 -0
- package/skills/etetoolkit/references/workflows.md +537 -0
- package/skills/etetoolkit/scripts/quick_visualize.py +455 -0
- package/skills/etetoolkit/scripts/tree_operations.py +446 -0
- package/skills/exa-search/SKILL.md +102 -0
- package/skills/exa-search/references/web-extract.md +53 -0
- package/skills/exa-search/references/web-search.md +119 -0
- package/skills/exa-search/scripts/exa_extract.py +117 -0
- package/skills/exa-search/scripts/exa_search.py +179 -0
- package/skills/executing-plans/SKILL.md +14 -0
- package/skills/experimental-design/SKILL.md +234 -0
- package/skills/experimental-design/references/design_types.md +129 -0
- package/skills/experimental-design/references/factorial_and_doe.md +130 -0
- package/skills/experimental-design/references/randomization_and_blocking.md +116 -0
- package/skills/experimental-design/references/sequential_and_adaptive.md +97 -0
- package/skills/experimental-design/scripts/doe_designs.py +183 -0
- package/skills/experimental-design/scripts/randomization.py +171 -0
- package/skills/exploratory-data-analysis/SKILL.md +280 -0
- package/skills/exploratory-data-analysis/assets/report_template.md +202 -0
- package/skills/exploratory-data-analysis/references/bioinformatics_genomics_formats.md +192 -0
- package/skills/exploratory-data-analysis/references/chemistry_molecular_formats.md +183 -0
- package/skills/exploratory-data-analysis/references/general_scientific_formats.md +259 -0
- package/skills/exploratory-data-analysis/references/microscopy_imaging_formats.md +189 -0
- package/skills/exploratory-data-analysis/references/proteomics_metabolomics_formats.md +217 -0
- package/skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md +191 -0
- package/skills/exploratory-data-analysis/scripts/__init__.py +1 -0
- package/skills/exploratory-data-analysis/scripts/_capabilities.py +576 -0
- package/skills/exploratory-data-analysis/scripts/_common.py +460 -0
- package/skills/exploratory-data-analysis/scripts/_structured.py +391 -0
- package/skills/exploratory-data-analysis/scripts/_tabular.py +905 -0
- package/skills/exploratory-data-analysis/scripts/capability_manifest.py +184 -0
- package/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py +117 -0
- package/skills/exploratory-data-analysis/scripts/eda_analyzer.py +345 -0
- package/skills/exploratory-data-analysis/scripts/image_inspector.py +214 -0
- package/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py +130 -0
- package/skills/exploratory-data-analysis/scripts/report_scaffold.py +143 -0
- package/skills/exploratory-data-analysis/scripts/sequence_inspector.py +255 -0
- package/skills/exploratory-data-analysis/scripts/tabular_profile.py +109 -0
- package/skills/flowio/SKILL.md +310 -0
- package/skills/flowio/references/api_reference.md +355 -0
- package/skills/flowio/references/fcs_semantics.md +315 -0
- package/skills/flowio/references/sources.md +89 -0
- package/skills/flowio/references/troubleshooting.md +399 -0
- package/skills/flowio/references/workflows.md +368 -0
- package/skills/flowio/scripts/inspect_fcs.py +439 -0
- package/skills/fluidsim/SKILL.md +279 -0
- package/skills/fluidsim/references/advanced_features.md +347 -0
- package/skills/fluidsim/references/installation.md +263 -0
- package/skills/fluidsim/references/output_analysis.md +314 -0
- package/skills/fluidsim/references/parameters.md +322 -0
- package/skills/fluidsim/references/simulation_workflow.md +329 -0
- package/skills/fluidsim/references/solvers.md +191 -0
- package/skills/fluidsim/scripts/__init__.py +1 -0
- package/skills/fluidsim/scripts/_common.py +491 -0
- package/skills/fluidsim/scripts/_schema.py +872 -0
- package/skills/fluidsim/scripts/budget_summary.py +396 -0
- package/skills/fluidsim/scripts/grid_resource_estimator.py +286 -0
- package/skills/fluidsim/scripts/output_inventory.py +353 -0
- package/skills/fluidsim/scripts/restart_compatibility.py +424 -0
- package/skills/fluidsim/scripts/simulation_dry_run.py +246 -0
- package/skills/fluidsim/scripts/solver_config_validator.py +70 -0
- package/skills/frontend-design/SKILL.md +99 -0
- package/skills/generate-image/SKILL.md +304 -0
- package/skills/generate-image/references/models.md +173 -0
- package/skills/generate-image/scripts/generate_image.py +752 -0
- package/skills/geniml/SKILL.md +310 -0
- package/skills/geniml/references/bedspace.md +267 -0
- package/skills/geniml/references/consensus_peaks.md +334 -0
- package/skills/geniml/references/region2vec.md +289 -0
- package/skills/geniml/references/scembed.md +307 -0
- package/skills/geniml/references/utilities.md +385 -0
- package/skills/geniml/scripts/__init__.py +1 -0
- package/skills/geniml/scripts/_common.py +399 -0
- package/skills/geniml/scripts/bed_validator.py +363 -0
- package/skills/geniml/scripts/consensus_plan.py +416 -0
- package/skills/geniml/scripts/corpus_auditor.py +304 -0
- package/skills/geniml/scripts/embedding_plan.py +476 -0
- package/skills/geniml/scripts/model_artifact_inspector.py +358 -0
- package/skills/geniml/scripts/tokenizer_compatibility.py +321 -0
- package/skills/genomic-coordinates/SKILL.md +189 -0
- package/skills/genomic-coordinates/references/format-conventions.md +205 -0
- package/skills/genomic-coordinates/references/reference-builds.md +154 -0
- package/skills/genomic-coordinates/references/transcript-coordinates.md +141 -0
- package/skills/genomic-coordinates/references/variant-representation.md +155 -0
- package/skills/genomic-coordinates/scripts/_common.py +335 -0
- package/skills/genomic-coordinates/scripts/audit_intervals.py +511 -0
- package/skills/genomic-coordinates/scripts/check_contigs.py +382 -0
- package/skills/genomic-coordinates/scripts/convert_coords.py +180 -0
- package/skills/genomic-coordinates/scripts/normalize_variant.py +290 -0
- package/skills/genomic-intelligence/SKILL.md +243 -0
- package/skills/genomic-intelligence/references/api-and-auth.md +45 -0
- package/skills/genomic-intelligence/references/mcp.md +94 -0
- package/skills/genomic-intelligence/references/sequence-acquisition.md +52 -0
- package/skills/genomic-intelligence/references/tasks.md +75 -0
- package/skills/geomaster/README.md +105 -0
- package/skills/geomaster/SKILL.md +366 -0
- package/skills/geomaster/references/advanced-gis.md +376 -0
- package/skills/geomaster/references/big-data.md +363 -0
- package/skills/geomaster/references/code-examples.md +531 -0
- package/skills/geomaster/references/coordinate-systems.md +364 -0
- package/skills/geomaster/references/core-libraries.md +273 -0
- package/skills/geomaster/references/data-sources.md +330 -0
- package/skills/geomaster/references/gis-software.md +369 -0
- package/skills/geomaster/references/industry-applications.md +420 -0
- package/skills/geomaster/references/machine-learning.md +462 -0
- package/skills/geomaster/references/programming-languages.md +456 -0
- package/skills/geomaster/references/remote-sensing.md +370 -0
- package/skills/geomaster/references/scientific-domains.md +416 -0
- package/skills/geomaster/references/specialized-topics.md +428 -0
- package/skills/geomaster/references/troubleshooting.md +439 -0
- package/skills/geopandas/SKILL.md +250 -0
- package/skills/geopandas/references/crs-management.md +231 -0
- package/skills/geopandas/references/data-io.md +323 -0
- package/skills/geopandas/references/data-structures.md +207 -0
- package/skills/geopandas/references/geometric-operations.md +262 -0
- package/skills/geopandas/references/spatial-analysis.md +294 -0
- package/skills/geopandas/references/visualization.md +230 -0
- package/skills/geopandas/scripts/_common.py +605 -0
- package/skills/geopandas/scripts/crs_reprojection_plan.py +210 -0
- package/skills/geopandas/scripts/export_plan.py +305 -0
- package/skills/geopandas/scripts/geometry_validity_report.py +227 -0
- package/skills/geopandas/scripts/sensitive_coordinates_checklist.py +230 -0
- package/skills/geopandas/scripts/spatial_join_audit.py +368 -0
- package/skills/geopandas/scripts/vector_inventory.py +140 -0
- package/skills/get-available-resources/SKILL.md +260 -0
- package/skills/get-available-resources/references/resource_semantics.md +206 -0
- package/skills/get-available-resources/references/snapshot_schema.md +172 -0
- package/skills/get-available-resources/references/sources.md +124 -0
- package/skills/get-available-resources/scripts/_common.py +190 -0
- package/skills/get-available-resources/scripts/accelerator_diagnostics.py +151 -0
- package/skills/get-available-resources/scripts/detect_resources.py +1767 -0
- package/skills/get-available-resources/scripts/plan_workload.py +311 -0
- package/skills/get-available-resources/scripts/snapshot_tools.py +486 -0
- package/skills/gget/SKILL.md +153 -0
- package/skills/gget/references/common_workflows.md +120 -0
- package/skills/gget/references/database_info.md +336 -0
- package/skills/gget/references/module_catalog.md +733 -0
- package/skills/gget/references/module_reference.md +526 -0
- package/skills/gget/references/workflows.md +815 -0
- package/skills/gget/scripts/batch_sequence_analysis.py +192 -0
- package/skills/gget/scripts/enrichment_pipeline.py +235 -0
- package/skills/gget/scripts/gene_analysis.py +175 -0
- package/skills/ginkgo-cloud-lab/SKILL.md +106 -0
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-hibit.md +53 -0
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-optimization.md +85 -0
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-validation.md +71 -0
- package/skills/ginkgo-cloud-lab/references/cfps-expression-purification-quantification.md +60 -0
- package/skills/ginkgo-cloud-lab/references/cfps-strep-purification-thermal-shift.md +63 -0
- package/skills/ginkgo-cloud-lab/references/cfps-strep-tag-purification-a280.md +55 -0
- package/skills/ginkgo-cloud-lab/references/echo-ms-cfps-detection.md +49 -0
- package/skills/ginkgo-cloud-lab/references/echo-ms-method-onboarding.md +56 -0
- package/skills/ginkgo-cloud-lab/references/ecoli-expression-purification-quantification.md +49 -0
- package/skills/ginkgo-cloud-lab/references/ecoli-minibinder-expression-histag-a280.md +62 -0
- package/skills/ginkgo-cloud-lab/references/ecoli-protein-expression-hibit.md +44 -0
- package/skills/ginkgo-cloud-lab/references/ecoli-protein-expression-histag-a280.md +47 -0
- package/skills/ginkgo-cloud-lab/references/fluorescent-pixel-art-generation.md +73 -0
- package/skills/ginkgo-cloud-lab/references/ivt-rna-synthesis-qpcr.md +67 -0
- package/skills/ginkgo-cloud-lab/references/minibinder-strep-tag-a280.md +58 -0
- package/skills/ginkgo-cloud-lab/references/pichia-protein-expression-labchip.md +43 -0
- package/skills/ginkgo-cloud-lab/references/spr-target-onboarding.md +58 -0
- package/skills/glycoengineering/SKILL.md +339 -0
- package/skills/glycoengineering/references/glycan_databases.md +165 -0
- package/skills/gtars/SKILL.md +282 -0
- package/skills/gtars/references/cli.md +334 -0
- package/skills/gtars/references/coverage.md +224 -0
- package/skills/gtars/references/overlap.md +220 -0
- package/skills/gtars/references/python-api.md +280 -0
- package/skills/gtars/references/refget.md +318 -0
- package/skills/gtars/references/tokenizers.md +256 -0
- package/skills/gtars/scripts/__init__.py +1 -0
- package/skills/gtars/scripts/_common.py +461 -0
- package/skills/gtars/scripts/artifact_inspector.py +328 -0
- package/skills/gtars/scripts/bed_validator.py +183 -0
- package/skills/gtars/scripts/coverage_preflight.py +256 -0
- package/skills/gtars/scripts/execution_plan.py +365 -0
- package/skills/gtars/scripts/refget_digest_plan.py +311 -0
- package/skills/gtars/scripts/tokenizer_manifest.py +238 -0
- package/skills/histolab/SKILL.md +243 -0
- package/skills/histolab/references/core_capabilities.md +305 -0
- package/skills/histolab/references/filters_preprocessing.md +537 -0
- package/skills/histolab/references/slide_management.md +184 -0
- package/skills/histolab/references/tile_extraction.md +421 -0
- package/skills/histolab/references/tissue_masks.md +251 -0
- package/skills/histolab/references/typical_workflows.md +196 -0
- package/skills/histolab/references/visualization.md +548 -0
- package/skills/hugging-science/SKILL.md +132 -0
- package/skills/hugging-science/references/flagship-resources.md +81 -0
- package/skills/hugging-science/references/topics-and-slugs.md +82 -0
- package/skills/hugging-science/references/using-datasets.md +107 -0
- package/skills/hugging-science/references/using-models.md +122 -0
- package/skills/hugging-science/references/using-spaces.md +119 -0
- package/skills/hugging-science/scripts/fetch_catalog.py +358 -0
- package/skills/hypogenic/SKILL.md +290 -0
- package/skills/hypogenic/assets/dataset_manifest.example.json +30 -0
- package/skills/hypogenic/assets/result.example.json +18 -0
- package/skills/hypogenic/assets/run_config.example.json +46 -0
- package/skills/hypogenic/assets/task_config.example.yaml +38 -0
- package/skills/hypogenic/references/configuration.md +136 -0
- package/skills/hypogenic/references/datasets.md +146 -0
- package/skills/hypogenic/references/evaluation.md +155 -0
- package/skills/hypogenic/references/security.md +167 -0
- package/skills/hypogenic/references/sources.md +113 -0
- package/skills/hypogenic/references/upstream.md +188 -0
- package/skills/hypogenic/scripts/__init__.py +1 -0
- package/skills/hypogenic/scripts/_common.py +1312 -0
- package/skills/hypogenic/scripts/audit_dataset.py +410 -0
- package/skills/hypogenic/scripts/evaluate_local.py +250 -0
- package/skills/hypogenic/scripts/inspect_outputs.py +166 -0
- package/skills/hypogenic/scripts/plan_run.py +247 -0
- package/skills/hypogenic/scripts/validate_config.py +192 -0
- package/skills/hypothesis-generation/SKILL.md +264 -0
- package/skills/hypothesis-generation/assets/evidence_ledger_template.csv +2 -0
- package/skills/hypothesis-generation/assets/falsification_controls_template.json +116 -0
- package/skills/hypothesis-generation/assets/hypothesis_record_template.json +331 -0
- package/skills/hypothesis-generation/assets/operationalization_template.json +56 -0
- package/skills/hypothesis-generation/assets/prediction_rival_matrix_template.csv +3 -0
- package/skills/hypothesis-generation/assets/preregistration_scaffold_template.md +137 -0
- package/skills/hypothesis-generation/assets/search_boundary_template.json +23 -0
- package/skills/hypothesis-generation/assets/source_ledger.csv +37 -0
- package/skills/hypothesis-generation/references/causal_inference_and_claims.md +190 -0
- package/skills/hypothesis-generation/references/concepts_and_workflow.md +173 -0
- package/skills/hypothesis-generation/references/ethics_safety_and_ai.md +216 -0
- package/skills/hypothesis-generation/references/experimental_design_patterns.md +301 -0
- package/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +203 -0
- package/skills/hypothesis-generation/references/literature_search_strategies.md +208 -0
- package/skills/hypothesis-generation/references/preregistration_and_open_science.md +205 -0
- package/skills/hypothesis-generation/references/security_validation.md +74 -0
- package/skills/hypothesis-generation/references/source_ledger.md +116 -0
- package/skills/hypothesis-generation/references/tool_reference.md +246 -0
- package/skills/hypothesis-generation/scripts/_common.py +412 -0
- package/skills/hypothesis-generation/scripts/audit_evidence_ledger.py +337 -0
- package/skills/hypothesis-generation/scripts/check_falsification_controls.py +455 -0
- package/skills/hypothesis-generation/scripts/check_operationalization.py +237 -0
- package/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py +384 -0
- package/skills/hypothesis-generation/scripts/lint_causal_claims.py +189 -0
- package/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py +1078 -0
- package/skills/hypothesis-generation/scripts/validate_prediction_matrix.py +286 -0
- package/skills/imaging-data-commons/SKILL.md +496 -0
- package/skills/imaging-data-commons/references/bigquery_guide.md +858 -0
- package/skills/imaging-data-commons/references/cli_guide.md +287 -0
- package/skills/imaging-data-commons/references/clinical_data_guide.md +328 -0
- package/skills/imaging-data-commons/references/cloud_storage_guide.md +333 -0
- package/skills/imaging-data-commons/references/dicomweb_guide.md +399 -0
- package/skills/imaging-data-commons/references/digital_pathology_guide.md +403 -0
- package/skills/imaging-data-commons/references/index_tables_guide.md +203 -0
- package/skills/imaging-data-commons/references/licensing_and_citation.md +230 -0
- package/skills/imaging-data-commons/references/mcp_guide.md +181 -0
- package/skills/imaging-data-commons/references/parquet_access_guide.md +200 -0
- package/skills/imaging-data-commons/references/rest_api_guide.md +612 -0
- package/skills/imaging-data-commons/references/sql_patterns.md +462 -0
- package/skills/imaging-data-commons/references/use_cases.md +277 -0
- package/skills/imaging-data-commons/scripts/check_version.py +132 -0
- package/skills/infographics/SKILL.md +315 -0
- package/skills/infographics/references/color_palettes.md +496 -0
- package/skills/infographics/references/design_principles.md +636 -0
- package/skills/infographics/references/infographic_type_catalog.md +158 -0
- package/skills/infographics/references/infographic_types.md +907 -0
- package/skills/infographics/references/iterative_refinement.md +119 -0
- package/skills/infographics/scripts/generate_infographic.py +291 -0
- package/skills/infographics/scripts/generate_infographic_ai.py +1446 -0
- package/skills/iso-standards-readiness/SKILL.md +352 -0
- package/skills/iso-standards-readiness/assets/templates/capa-record-template.json +99 -0
- package/skills/iso-standards-readiness/assets/templates/document-register-template.json +75 -0
- package/skills/iso-standards-readiness/assets/templates/evidence-manifest-template.json +65 -0
- package/skills/iso-standards-readiness/assets/templates/laboratory-scope-intake-template.json +111 -0
- package/skills/iso-standards-readiness/assets/templates/medical-laboratory-scope-intake-template.json +111 -0
- package/skills/iso-standards-readiness/assets/templates/procedures/CAPA-procedure-template.md +148 -0
- package/skills/iso-standards-readiness/assets/templates/procedures/document-control-procedure-template.md +132 -0
- package/skills/iso-standards-readiness/assets/templates/qmsr-transition-template.json +181 -0
- package/skills/iso-standards-readiness/assets/templates/quality-manual-template.md +182 -0
- package/skills/iso-standards-readiness/assets/templates/scope-intake-template.json +109 -0
- package/skills/iso-standards-readiness/assets/templates/supplier-controls-template.json +119 -0
- package/skills/iso-standards-readiness/assets/templates/traceability-matrix-template.json +154 -0
- package/skills/iso-standards-readiness/references/assurance-lanes.md +116 -0
- package/skills/iso-standards-readiness/references/evidence-architecture.md +282 -0
- package/skills/iso-standards-readiness/references/gap-analysis-checklist.md +346 -0
- package/skills/iso-standards-readiness/references/iso-13485.md +236 -0
- package/skills/iso-standards-readiness/references/iso-14971.md +172 -0
- package/skills/iso-standards-readiness/references/iso-15189.md +219 -0
- package/skills/iso-standards-readiness/references/iso-17025.md +208 -0
- package/skills/iso-standards-readiness/references/quality-manual-guide.md +282 -0
- package/skills/iso-standards-readiness/references/source-ledger.md +357 -0
- package/skills/iso-standards-readiness/scripts/_catalog.py +248 -0
- package/skills/iso-standards-readiness/scripts/_common.py +558 -0
- package/skills/iso-standards-readiness/scripts/audit_document_records.py +148 -0
- package/skills/iso-standards-readiness/scripts/check_capa.py +240 -0
- package/skills/iso-standards-readiness/scripts/check_qmsr_transition.py +164 -0
- package/skills/iso-standards-readiness/scripts/check_supplier_controls.py +166 -0
- package/skills/iso-standards-readiness/scripts/check_traceability.py +171 -0
- package/skills/iso-standards-readiness/scripts/gap_analyzer.py +167 -0
- package/skills/iso-standards-readiness/scripts/validate_evidence_manifest.py +246 -0
- package/skills/iso-standards-readiness/scripts/validate_scope_intake.py +209 -0
- package/skills/lab-hardware-cad/SKILL.md +372 -0
- package/skills/lab-hardware-cad/assets/standards.json +198 -0
- package/skills/lab-hardware-cad/references/behavior-rigs.md +136 -0
- package/skills/lab-hardware-cad/references/build123d-patterns.md +363 -0
- package/skills/lab-hardware-cad/references/fabrication-limits.md +156 -0
- package/skills/lab-hardware-cad/references/labware-adapters.md +190 -0
- package/skills/lab-hardware-cad/references/microfluidics.md +157 -0
- package/skills/lab-hardware-cad/references/optomechanics.md +148 -0
- package/skills/lab-hardware-cad/references/validation.md +132 -0
- package/skills/lab-hardware-cad/scripts/_common.py +650 -0
- package/skills/lab-hardware-cad/scripts/check.py +645 -0
- package/skills/lab-hardware-cad/scripts/gen.py +264 -0
- package/skills/lab-hardware-cad/scripts/snapshot.py +278 -0
- package/skills/labarchive-integration/SKILL.md +216 -0
- package/skills/labarchive-integration/references/api_reference.md +250 -0
- package/skills/labarchive-integration/references/authentication_guide.md +191 -0
- package/skills/labarchive-integration/references/integrations.md +162 -0
- package/skills/labarchive-integration/references/sources.md +213 -0
- package/skills/labarchive-integration/scripts/entry_operations.py +381 -0
- package/skills/labarchive-integration/scripts/notebook_operations.py +451 -0
- package/skills/labarchive-integration/scripts/setup_config.py +258 -0
- package/skills/lamindb/SKILL.md +408 -0
- package/skills/lamindb/references/annotation-validation.md +510 -0
- package/skills/lamindb/references/core-concepts.md +383 -0
- package/skills/lamindb/references/data-management.md +432 -0
- package/skills/lamindb/references/integrations.md +663 -0
- package/skills/lamindb/references/ontologies.md +498 -0
- package/skills/lamindb/references/setup-deployment.md +755 -0
- package/skills/latchbio-integration/SKILL.md +227 -0
- package/skills/latchbio-integration/references/data-management.md +257 -0
- package/skills/latchbio-integration/references/latch-mcp.md +158 -0
- package/skills/latchbio-integration/references/nextflow-snakemake.md +258 -0
- package/skills/latchbio-integration/references/operations-and-debugging.md +320 -0
- package/skills/latchbio-integration/references/registry.md +275 -0
- package/skills/latchbio-integration/references/resource-configuration.md +274 -0
- package/skills/latchbio-integration/references/ui-and-automation.md +355 -0
- package/skills/latchbio-integration/references/verified-workflows.md +226 -0
- package/skills/latchbio-integration/references/workflow-creation.md +275 -0
- package/skills/latchbio-integration/scripts/inspect_latch_sdk.py +290 -0
- package/skills/latex-posters/SKILL.md +369 -0
- package/skills/latex-posters/assets/baposter_template.tex +257 -0
- package/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- package/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- package/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- package/skills/latex-posters/references/README.md +439 -0
- package/skills/latex-posters/references/ai_graphics_for_posters.md +524 -0
- package/skills/latex-posters/references/compilation_and_quality_control.md +467 -0
- package/skills/latex-posters/references/latex_poster_packages.md +745 -0
- package/skills/latex-posters/references/latex_poster_reference.md +241 -0
- package/skills/latex-posters/references/poster_content_guide.md +748 -0
- package/skills/latex-posters/references/poster_design_principles.md +806 -0
- package/skills/latex-posters/references/poster_layout_design.md +900 -0
- package/skills/latex-posters/references/poster_patterns_and_presentation.md +81 -0
- package/skills/latex-posters/scripts/generate_schematic.py +198 -0
- package/skills/latex-posters/scripts/generate_schematic_ai.py +950 -0
- package/skills/latex-posters/scripts/review_poster.sh +214 -0
- package/skills/liteparse/SKILL.md +295 -0
- package/skills/liteparse/references/api_reference.md +169 -0
- package/skills/liteparse/references/choosing_a_parser.md +70 -0
- package/skills/liteparse/references/cli_reference.md +118 -0
- package/skills/liteparse/references/ocr_and_formats.md +143 -0
- package/skills/liteparse/references/output_formats.md +146 -0
- package/skills/liteparse/scripts/batch_parse_dir.py +163 -0
- package/skills/literature-review/SKILL.md +263 -0
- package/skills/literature-review/assets/review_template.md +412 -0
- package/skills/literature-review/references/citation_styles.md +166 -0
- package/skills/literature-review/references/core_workflow.md +260 -0
- package/skills/literature-review/references/database_strategies.md +455 -0
- package/skills/literature-review/references/example_workflow.md +68 -0
- package/skills/literature-review/references/search_and_citation.md +157 -0
- package/skills/literature-review/scripts/generate_pdf.py +176 -0
- package/skills/literature-review/scripts/generate_schematic.py +198 -0
- package/skills/literature-review/scripts/generate_schematic_ai.py +950 -0
- package/skills/literature-review/scripts/search_databases.py +303 -0
- package/skills/literature-review/scripts/verify_citations.py +222 -0
- package/skills/markdown-mermaid-writing/SKILL.md +322 -0
- package/skills/markdown-mermaid-writing/assets/examples/example-research-report.md +221 -0
- package/skills/markdown-mermaid-writing/references/diagrams/architecture.md +108 -0
- package/skills/markdown-mermaid-writing/references/diagrams/block.md +177 -0
- package/skills/markdown-mermaid-writing/references/diagrams/c4.md +136 -0
- package/skills/markdown-mermaid-writing/references/diagrams/class.md +246 -0
- package/skills/markdown-mermaid-writing/references/diagrams/complex_examples.md +384 -0
- package/skills/markdown-mermaid-writing/references/diagrams/er.md +222 -0
- package/skills/markdown-mermaid-writing/references/diagrams/flowchart.md +177 -0
- package/skills/markdown-mermaid-writing/references/diagrams/gantt.md +138 -0
- package/skills/markdown-mermaid-writing/references/diagrams/git_graph.md +74 -0
- package/skills/markdown-mermaid-writing/references/diagrams/kanban.md +107 -0
- package/skills/markdown-mermaid-writing/references/diagrams/mindmap.md +74 -0
- package/skills/markdown-mermaid-writing/references/diagrams/packet.md +55 -0
- package/skills/markdown-mermaid-writing/references/diagrams/pie.md +52 -0
- package/skills/markdown-mermaid-writing/references/diagrams/quadrant.md +66 -0
- package/skills/markdown-mermaid-writing/references/diagrams/radar.md +59 -0
- package/skills/markdown-mermaid-writing/references/diagrams/requirement.md +88 -0
- package/skills/markdown-mermaid-writing/references/diagrams/sankey.md +71 -0
- package/skills/markdown-mermaid-writing/references/diagrams/sequence.md +174 -0
- package/skills/markdown-mermaid-writing/references/diagrams/state.md +150 -0
- package/skills/markdown-mermaid-writing/references/diagrams/timeline.md +96 -0
- package/skills/markdown-mermaid-writing/references/diagrams/treemap.md +66 -0
- package/skills/markdown-mermaid-writing/references/diagrams/user_journey.md +108 -0
- package/skills/markdown-mermaid-writing/references/diagrams/xy_chart.md +53 -0
- package/skills/markdown-mermaid-writing/references/diagrams/zenuml.md +71 -0
- package/skills/markdown-mermaid-writing/references/markdown_style_guide.md +733 -0
- package/skills/markdown-mermaid-writing/references/mermaid_style_guide.md +458 -0
- package/skills/markdown-mermaid-writing/templates/decision_record.md +211 -0
- package/skills/markdown-mermaid-writing/templates/how_to_guide.md +275 -0
- package/skills/markdown-mermaid-writing/templates/issue.md +303 -0
- package/skills/markdown-mermaid-writing/templates/kanban.md +223 -0
- package/skills/markdown-mermaid-writing/templates/presentation.md +312 -0
- package/skills/markdown-mermaid-writing/templates/project_documentation.md +412 -0
- package/skills/markdown-mermaid-writing/templates/pull_request.md +319 -0
- package/skills/markdown-mermaid-writing/templates/research_paper.md +304 -0
- package/skills/markdown-mermaid-writing/templates/status_report.md +185 -0
- package/skills/market-research-reports/SKILL.md +337 -0
- package/skills/market-research-reports/assets/FORMATTING_GUIDE.md +149 -0
- package/skills/market-research-reports/assets/claims_ledger_template.csv +4 -0
- package/skills/market-research-reports/assets/competitor_feature_matrix_template.csv +5 -0
- package/skills/market-research-reports/assets/consistency_check_template.csv +3 -0
- package/skills/market-research-reports/assets/forecast_sensitivity_template.json +90 -0
- package/skills/market-research-reports/assets/market_report_template.tex +279 -0
- package/skills/market-research-reports/assets/market_research.sty +241 -0
- package/skills/market-research-reports/assets/market_sizing_scenarios_template.json +129 -0
- package/skills/market-research-reports/assets/report_manifest_template.json +27 -0
- package/skills/market-research-reports/assets/source_ledger_template.csv +4 -0
- package/skills/market-research-reports/references/data_analysis_patterns.md +290 -0
- package/skills/market-research-reports/references/evidence_model.md +148 -0
- package/skills/market-research-reports/references/methods_and_ethics.md +162 -0
- package/skills/market-research-reports/references/official_data_sources.md +196 -0
- package/skills/market-research-reports/references/report_structure_guide.md +283 -0
- package/skills/market-research-reports/references/sources.md +73 -0
- package/skills/market-research-reports/references/visual_generation_guide.md +158 -0
- package/skills/market-research-reports/scripts/_common.py +312 -0
- package/skills/market-research-reports/scripts/audit_claim_citations.py +326 -0
- package/skills/market-research-reports/scripts/calculate_market_sizing.py +389 -0
- package/skills/market-research-reports/scripts/check_unit_consistency.py +217 -0
- package/skills/market-research-reports/scripts/forecast_sensitivity.py +326 -0
- package/skills/market-research-reports/scripts/generate_report_scaffold.py +444 -0
- package/skills/market-research-reports/scripts/validate_competitor_matrix.py +223 -0
- package/skills/market-research-reports/scripts/validate_evidence_ledger.py +291 -0
- package/skills/markitdown/SKILL.md +264 -0
- package/skills/markitdown/references/api_reference.md +418 -0
- package/skills/markitdown/references/cloud_and_ocr.md +320 -0
- package/skills/markitdown/references/file_formats.md +281 -0
- package/skills/markitdown/references/mcp_and_plugins.md +243 -0
- package/skills/markitdown/references/migration.md +356 -0
- package/skills/markitdown/references/security.md +246 -0
- package/skills/markitdown/references/workflows.md +309 -0
- package/skills/markitdown/scripts/batch_convert.py +354 -0
- package/skills/markitdown/scripts/convert_literature.py +405 -0
- package/skills/markitdown/scripts/inspect_installation.py +162 -0
- package/skills/matchms/SKILL.md +276 -0
- package/skills/matchms/references/filtering.md +299 -0
- package/skills/matchms/references/importing_exporting.md +323 -0
- package/skills/matchms/references/migration.md +387 -0
- package/skills/matchms/references/similarity.md +413 -0
- package/skills/matchms/references/sources.md +113 -0
- package/skills/matchms/references/workflows.md +451 -0
- package/skills/matchms/scripts/library_search.py +593 -0
- package/skills/matlab/SKILL.md +274 -0
- package/skills/matlab/assets/project_manifest_template.json +33 -0
- package/skills/matlab/assets/python_compatibility_r2026a.json +27 -0
- package/skills/matlab/assets/reproducibility_manifest_template.json +32 -0
- package/skills/matlab/references/data-import-export.md +221 -0
- package/skills/matlab/references/executing-scripts.md +213 -0
- package/skills/matlab/references/graphics-visualization.md +181 -0
- package/skills/matlab/references/mathematics.md +208 -0
- package/skills/matlab/references/matrices-arrays.md +228 -0
- package/skills/matlab/references/octave-compatibility.md +212 -0
- package/skills/matlab/references/programming.md +225 -0
- package/skills/matlab/references/python-integration.md +248 -0
- package/skills/matlab/scripts/_common.py +263 -0
- package/skills/matlab/scripts/generate_function_scaffold.py +165 -0
- package/skills/matlab/scripts/inventory_mat_file.py +351 -0
- package/skills/matlab/scripts/plan_batch_command.py +257 -0
- package/skills/matlab/scripts/plan_python_compatibility.py +176 -0
- package/skills/matlab/scripts/reproducibility_report.py +233 -0
- package/skills/matlab/scripts/scan_m_code.py +433 -0
- package/skills/matlab/scripts/validate_project_manifest.py +348 -0
- package/skills/matplotlib/SKILL.md +378 -0
- package/skills/matplotlib/references/api_reference.md +409 -0
- package/skills/matplotlib/references/common_issues.md +562 -0
- package/skills/matplotlib/references/plot_types.md +469 -0
- package/skills/matplotlib/references/styling_guide.md +600 -0
- package/skills/matplotlib/scripts/plot_template.py +406 -0
- package/skills/matplotlib/scripts/style_configurator.py +412 -0
- package/skills/medchem/SKILL.md +321 -0
- package/skills/medchem/references/api_guide.md +331 -0
- package/skills/medchem/references/rules_catalog.md +328 -0
- package/skills/medchem/scripts/filter_molecules.py +302 -0
- package/skills/modal/SKILL.md +468 -0
- package/skills/modal/references/api_reference.md +225 -0
- package/skills/modal/references/examples.md +276 -0
- package/skills/modal/references/functions.md +260 -0
- package/skills/modal/references/getting-started.md +171 -0
- package/skills/modal/references/gpu.md +177 -0
- package/skills/modal/references/images.md +266 -0
- package/skills/modal/references/resources.md +117 -0
- package/skills/modal/references/scaling.md +173 -0
- package/skills/modal/references/scheduled-jobs.md +147 -0
- package/skills/modal/references/secrets.md +119 -0
- package/skills/modal/references/volumes.md +247 -0
- package/skills/modal/references/web-endpoints.md +259 -0
- package/skills/molecular-dynamics/SKILL.md +458 -0
- package/skills/molecular-dynamics/references/mdanalysis_analysis.md +208 -0
- package/skills/molfeat/SKILL.md +348 -0
- package/skills/molfeat/references/api_reference.md +429 -0
- package/skills/molfeat/references/available_featurizers.md +335 -0
- package/skills/molfeat/references/choosing_a_featurizer.md +192 -0
- package/skills/molfeat/references/examples.md +720 -0
- package/skills/ncats-arax/SKILL.md +178 -0
- package/skills/ncats-arax/references/output-schema.md +186 -0
- package/skills/ncats-arax/references/query-contract.md +140 -0
- package/skills/ncats-arax/scripts/arax_client.py +2087 -0
- package/skills/networkx/SKILL.md +440 -0
- package/skills/networkx/references/algorithms.md +384 -0
- package/skills/networkx/references/generators.md +385 -0
- package/skills/networkx/references/graph-basics.md +284 -0
- package/skills/networkx/references/io.md +457 -0
- package/skills/networkx/references/visualization.md +531 -0
- package/skills/neurokit2/SKILL.md +323 -0
- package/skills/neurokit2/references/bio_module.md +244 -0
- package/skills/neurokit2/references/complexity.md +212 -0
- package/skills/neurokit2/references/ecg_cardiac.md +193 -0
- package/skills/neurokit2/references/eda.md +185 -0
- package/skills/neurokit2/references/eeg.md +204 -0
- package/skills/neurokit2/references/emg.md +157 -0
- package/skills/neurokit2/references/eog.md +154 -0
- package/skills/neurokit2/references/epochs_events.md +199 -0
- package/skills/neurokit2/references/hrv.md +205 -0
- package/skills/neurokit2/references/ppg.md +191 -0
- package/skills/neurokit2/references/rsp.md +212 -0
- package/skills/neurokit2/references/signal_processing.md +160 -0
- package/skills/neurokit2/scripts/_common.py +567 -0
- package/skills/neurokit2/scripts/ecg_hrv_pipeline.py +303 -0
- package/skills/neurokit2/scripts/eda_pipeline.py +288 -0
- package/skills/neurokit2/scripts/generate_synthetic.py +221 -0
- package/skills/neurokit2/scripts/inspect_signal.py +362 -0
- package/skills/neurokit2/scripts/plan_epochs.py +281 -0
- package/skills/neurokit2/scripts/validate_multimodal.py +350 -0
- package/skills/neuropixels-analysis/SKILL.md +412 -0
- package/skills/neuropixels-analysis/assets/analysis_template.py +271 -0
- package/skills/neuropixels-analysis/references/AI_CURATION.md +164 -0
- package/skills/neuropixels-analysis/references/ANALYSIS.md +392 -0
- package/skills/neuropixels-analysis/references/AUTOMATED_CURATION.md +435 -0
- package/skills/neuropixels-analysis/references/MOTION_CORRECTION.md +323 -0
- package/skills/neuropixels-analysis/references/PREPROCESSING.md +273 -0
- package/skills/neuropixels-analysis/references/QUALITY_METRICS.md +359 -0
- package/skills/neuropixels-analysis/references/SPIKE_SORTING.md +339 -0
- package/skills/neuropixels-analysis/references/api_reference.md +229 -0
- package/skills/neuropixels-analysis/references/plotting_guide.md +454 -0
- package/skills/neuropixels-analysis/references/standard_workflow.md +305 -0
- package/skills/neuropixels-analysis/scripts/compute_metrics.py +182 -0
- package/skills/neuropixels-analysis/scripts/explore_recording.py +168 -0
- package/skills/neuropixels-analysis/scripts/export_to_phy.py +79 -0
- package/skills/neuropixels-analysis/scripts/neuropixels_pipeline.py +442 -0
- package/skills/neuropixels-analysis/scripts/preprocess_recording.py +122 -0
- package/skills/neuropixels-analysis/scripts/run_sorting.py +98 -0
- package/skills/nextflow/SKILL.md +195 -0
- package/skills/nextflow/references/configuration.md +276 -0
- package/skills/nextflow/references/containers.md +92 -0
- package/skills/nextflow/references/developing.md +301 -0
- package/skills/nextflow/references/language.md +327 -0
- package/skills/nextflow/references/nf-core-tools.md +130 -0
- package/skills/nextflow/references/running-pipelines.md +131 -0
- package/skills/nextflow/references/testing.md +189 -0
- package/skills/omero-integration/SKILL.md +222 -0
- package/skills/omero-integration/references/advanced.md +273 -0
- package/skills/omero-integration/references/connection.md +293 -0
- package/skills/omero-integration/references/data_access.md +359 -0
- package/skills/omero-integration/references/image_processing.md +286 -0
- package/skills/omero-integration/references/metadata.md +313 -0
- package/skills/omero-integration/references/rois.md +291 -0
- package/skills/omero-integration/references/scripts.md +304 -0
- package/skills/omero-integration/references/sources.md +194 -0
- package/skills/omero-integration/references/tables.md +269 -0
- package/skills/omero-integration/scripts/export_image_metadata.py +560 -0
- package/skills/omero-integration/scripts/inventory.py +302 -0
- package/skills/omero-integration/scripts/omero_common.py +490 -0
- package/skills/omero-integration/scripts/plan_transfer.py +393 -0
- package/skills/omero-integration/scripts/validate_config.py +140 -0
- package/skills/onekgpd/SKILL.md +371 -0
- package/skills/onekgpd/assets/kgpe.json +48032 -0
- package/skills/onekgpd/references/annotation_vocabularies.md +187 -0
- package/skills/onekgpd/references/onekgpd_commands.md +296 -0
- package/skills/onekgpd/scripts/onekgpd_api.py +794 -0
- package/skills/onekgpd/scripts/onekgpd_meta.py +485 -0
- package/skills/ontology-term-resolution/SKILL.md +147 -0
- package/skills/ontology-term-resolution/references/curation-rules.md +110 -0
- package/skills/ontology-term-resolution/references/ols4-api.md +135 -0
- package/skills/ontology-term-resolution/references/ontology-registry.md +110 -0
- package/skills/ontology-term-resolution/scripts/ols_client.py +341 -0
- package/skills/ontology-term-resolution/scripts/resolve_terms.py +255 -0
- package/skills/ontology-term-resolution/scripts/validate_terms.py +297 -0
- package/skills/open-notebook/SKILL.md +297 -0
- package/skills/open-notebook/references/api_reference.md +715 -0
- package/skills/open-notebook/references/architecture.md +163 -0
- package/skills/open-notebook/references/configuration.md +226 -0
- package/skills/open-notebook/references/examples.md +290 -0
- package/skills/open-notebook/scripts/chat_interaction.py +190 -0
- package/skills/open-notebook/scripts/notebook_management.py +142 -0
- package/skills/open-notebook/scripts/source_ingestion.py +160 -0
- package/skills/openpiv/SKILL.md +469 -0
- package/skills/openpiv/references/advanced_algorithms.md +233 -0
- package/skills/openpiv/scripts/__init__.py +1 -0
- package/skills/openpiv/scripts/analyze.py +143 -0
- package/skills/openpiv/scripts/run_example.py +78 -0
- package/skills/openpiv/scripts/runner.py +214 -0
- package/skills/opentrons-integration/SKILL.md +322 -0
- package/skills/opentrons-integration/references/api_reference.md +382 -0
- package/skills/opentrons-integration/references/liquid_handling.md +387 -0
- package/skills/opentrons-integration/references/migration-api-2-19-to-2-29.md +328 -0
- package/skills/opentrons-integration/references/modules_and_deck.md +409 -0
- package/skills/opentrons-integration/references/protocol_authoring.md +352 -0
- package/skills/opentrons-integration/references/sources.md +151 -0
- package/skills/opentrons-integration/references/validation_and_operations.md +314 -0
- package/skills/opentrons-integration/requirements-flex.txt +1 -0
- package/skills/opentrons-integration/requirements-ot2.txt +1 -0
- package/skills/opentrons-integration/scripts/absorbance_reader_template.py +82 -0
- package/skills/opentrons-integration/scripts/basic_protocol_template.py +68 -0
- package/skills/opentrons-integration/scripts/ot2_basic_protocol_template.py +63 -0
- package/skills/opentrons-integration/scripts/pcr_setup_template.py +146 -0
- package/skills/opentrons-integration/scripts/runtime_parameters_template.py +110 -0
- package/skills/opentrons-integration/scripts/serial_dilution_template.py +113 -0
- package/skills/optimize-for-gpu/SKILL.md +176 -0
- package/skills/optimize-for-gpu/references/code_transformation_patterns.md +301 -0
- package/skills/optimize-for-gpu/references/cucim.md +679 -0
- package/skills/optimize-for-gpu/references/cudf.md +762 -0
- package/skills/optimize-for-gpu/references/cugraph.md +733 -0
- package/skills/optimize-for-gpu/references/cuml.md +710 -0
- package/skills/optimize-for-gpu/references/cupy.md +668 -0
- package/skills/optimize-for-gpu/references/cuspatial.md +420 -0
- package/skills/optimize-for-gpu/references/cuvs.md +671 -0
- package/skills/optimize-for-gpu/references/cuxfilter.md +600 -0
- package/skills/optimize-for-gpu/references/decision_framework.md +234 -0
- package/skills/optimize-for-gpu/references/installation.md +121 -0
- package/skills/optimize-for-gpu/references/kvikio.md +612 -0
- package/skills/optimize-for-gpu/references/numba.md +808 -0
- package/skills/optimize-for-gpu/references/raft.md +312 -0
- package/skills/optimize-for-gpu/references/warp.md +623 -0
- package/skills/owasp-top10/SKILL.md +48 -0
- package/skills/pacsomatic/LICENSE +21 -0
- package/skills/pacsomatic/SKILL.md +150 -0
- package/skills/pacsomatic/config.yaml +42 -0
- package/skills/pacsomatic/references/agent-playbook.md +73 -0
- package/skills/pacsomatic/references/config-and-output.md +100 -0
- package/skills/pacsomatic/references/pacsomatic_guide.md +254 -0
- package/skills/pacsomatic/scripts/run_pacsomatic.py +794 -0
- package/skills/paper-lookup/SKILL.md +263 -0
- package/skills/paper-lookup/references/arxiv.md +275 -0
- package/skills/paper-lookup/references/biorxiv.md +163 -0
- package/skills/paper-lookup/references/core.md +150 -0
- package/skills/paper-lookup/references/crossref.md +181 -0
- package/skills/paper-lookup/references/europepmc.md +226 -0
- package/skills/paper-lookup/references/medrxiv.md +126 -0
- package/skills/paper-lookup/references/openalex.md +174 -0
- package/skills/paper-lookup/references/pmc.md +228 -0
- package/skills/paper-lookup/references/pubmed.md +124 -0
- package/skills/paper-lookup/references/semantic-scholar.md +203 -0
- package/skills/paper-lookup/references/unpaywall.md +127 -0
- package/skills/paper-lookup/scripts/_common.py +227 -0
- package/skills/paper-lookup/scripts/arxiv_atom.py +200 -0
- package/skills/paper-lookup/scripts/jats_to_text.py +324 -0
- package/skills/paper-lookup/scripts/openalex_abstract.py +163 -0
- package/skills/paper-lookup/scripts/paginate.py +490 -0
- package/skills/paperclip/SKILL.md +413 -0
- package/skills/paperclip/references/cli-reference.md +389 -0
- package/skills/paperclip/references/installation.md +341 -0
- package/skills/paperclip/references/map-reduce.md +252 -0
- package/skills/paperclip/references/python-sdk.md +323 -0
- package/skills/paperclip/references/repos-and-workspace.md +271 -0
- package/skills/paperclip/references/search-and-retrieval.md +281 -0
- package/skills/paperzilla/SKILL.md +159 -0
- package/skills/parallel-web/SKILL.md +128 -0
- package/skills/parallel-web/references/data-enrichment.md +104 -0
- package/skills/parallel-web/references/deep-research.md +91 -0
- package/skills/parallel-web/references/findall.md +81 -0
- package/skills/parallel-web/references/monitor.md +83 -0
- package/skills/parallel-web/references/web-extract.md +59 -0
- package/skills/parallel-web/references/web-search.md +100 -0
- package/skills/pathml/SKILL.md +222 -0
- package/skills/pathml/references/data_management.md +357 -0
- package/skills/pathml/references/graphs.md +335 -0
- package/skills/pathml/references/image_loading.md +301 -0
- package/skills/pathml/references/machine_learning.md +408 -0
- package/skills/pathml/references/multiparametric.md +352 -0
- package/skills/pathml/references/preprocessing.md +371 -0
- package/skills/pathml/scripts/_common.py +385 -0
- package/skills/pathml/scripts/image_qc.py +325 -0
- package/skills/pathml/scripts/plan_inference.py +282 -0
- package/skills/pathml/scripts/plan_pipeline.py +239 -0
- package/skills/pathml/scripts/slide_manifest.py +405 -0
- package/skills/pathml/scripts/validate_spatial_schema.py +420 -0
- package/skills/pathogen-variant-surveillance/SKILL.md +208 -0
- package/skills/pathogen-variant-surveillance/references/lapis-api.md +209 -0
- package/skills/pathogen-variant-surveillance/references/lineage-nomenclature.md +126 -0
- package/skills/pathogen-variant-surveillance/references/surveillance-caveats.md +149 -0
- package/skills/pathogen-variant-surveillance/scripts/lapis_client.py +776 -0
- package/skills/pathogen-variant-surveillance/scripts/lineage_prevalence.py +310 -0
- package/skills/pathogen-variant-surveillance/scripts/mutation_profile.py +215 -0
- package/skills/pathogen-variant-surveillance/scripts/reporting_lag.py +217 -0
- package/skills/pathogen-variant-surveillance/scripts/resolve_lineage.py +198 -0
- package/skills/pathway-enrichment/SKILL.md +194 -0
- package/skills/pathway-enrichment/references/databases-and-gene-sets.md +140 -0
- package/skills/pathway-enrichment/references/gseapy.md +189 -0
- package/skills/pathway-enrichment/references/interpretation.md +118 -0
- package/skills/pathway-enrichment/scripts/run_enrichment.py +231 -0
- package/skills/pdf/LICENSE.txt +30 -0
- package/skills/pdf/SKILL.md +322 -0
- package/skills/pdf/forms.md +294 -0
- package/skills/pdf/reference.md +612 -0
- package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/skills/pdf/scripts/create_validation_image.py +37 -0
- package/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/skills/peer-review/SKILL.md +288 -0
- package/skills/peer-review/assets/citation_references_template.csv +2 -0
- package/skills/peer-review/assets/claim_evidence_matrix_template.csv +4 -0
- package/skills/peer-review/assets/reporting_checklist_template.csv +31 -0
- package/skills/peer-review/assets/reporting_guidelines.json +466 -0
- package/skills/peer-review/assets/review_intake_template.json +52 -0
- package/skills/peer-review/assets/review_scaffold_template.md +68 -0
- package/skills/peer-review/assets/source_ledger.csv +32 -0
- package/skills/peer-review/assets/statistical_reproducibility_template.json +210 -0
- package/skills/peer-review/assets/study_profile_template.json +12 -0
- package/skills/peer-review/references/common_issues.md +257 -0
- package/skills/peer-review/references/ethical_review_practice.md +233 -0
- package/skills/peer-review/references/reporting_standards.md +249 -0
- package/skills/peer-review/references/security_validation.md +75 -0
- package/skills/peer-review/references/statistical_reproducibility.md +329 -0
- package/skills/peer-review/references/tool_reference.md +253 -0
- package/skills/peer-review/scripts/_common.py +398 -0
- package/skills/peer-review/scripts/audit_citations.py +207 -0
- package/skills/peer-review/scripts/audit_statistics_reproducibility.py +305 -0
- package/skills/peer-review/scripts/generate_review_scaffold.py +81 -0
- package/skills/peer-review/scripts/lint_review.py +254 -0
- package/skills/peer-review/scripts/select_reporting_guidelines.py +383 -0
- package/skills/peer-review/scripts/validate_claim_evidence.py +221 -0
- package/skills/peer-review/scripts/validate_review_intake.py +452 -0
- package/skills/penetration-testing/SKILL.md +31 -0
- package/skills/pennylane/SKILL.md +240 -0
- package/skills/pennylane/references/advanced_features.md +667 -0
- package/skills/pennylane/references/devices_backends.md +562 -0
- package/skills/pennylane/references/getting_started.md +232 -0
- package/skills/pennylane/references/optimization.md +670 -0
- package/skills/pennylane/references/quantum_chemistry.md +576 -0
- package/skills/pennylane/references/quantum_circuits.md +443 -0
- package/skills/pennylane/references/quantum_ml.md +555 -0
- package/skills/phylogenetics/SKILL.md +409 -0
- package/skills/phylogenetics/references/iqtree_inference.md +181 -0
- package/skills/phylogenetics/scripts/phylogenetic_analysis.py +272 -0
- package/skills/pi-agent/SKILL.md +83 -0
- package/skills/pi-agent/references/compaction.md +76 -0
- package/skills/pi-agent/references/containerization.md +80 -0
- package/skills/pi-agent/references/custom-provider.md +131 -0
- package/skills/pi-agent/references/development.md +61 -0
- package/skills/pi-agent/references/environment-variables.md +57 -0
- package/skills/pi-agent/references/extensions.md +185 -0
- package/skills/pi-agent/references/json.md +69 -0
- package/skills/pi-agent/references/keybindings.md +58 -0
- package/skills/pi-agent/references/llama-cpp.md +69 -0
- package/skills/pi-agent/references/models.md +114 -0
- package/skills/pi-agent/references/overview.md +37 -0
- package/skills/pi-agent/references/packages.md +103 -0
- package/skills/pi-agent/references/pi-interview.md +123 -0
- package/skills/pi-agent/references/pi-mcp-adapter.md +191 -0
- package/skills/pi-agent/references/pi-subagents.md +371 -0
- package/skills/pi-agent/references/pi-web-access.md +243 -0
- package/skills/pi-agent/references/prompt-templates.md +48 -0
- package/skills/pi-agent/references/providers.md +122 -0
- package/skills/pi-agent/references/quickstart.md +73 -0
- package/skills/pi-agent/references/rpc.md +95 -0
- package/skills/pi-agent/references/sdk.md +151 -0
- package/skills/pi-agent/references/security.md +52 -0
- package/skills/pi-agent/references/session-format.md +90 -0
- package/skills/pi-agent/references/sessions.md +56 -0
- package/skills/pi-agent/references/settings.md +102 -0
- package/skills/pi-agent/references/shell-aliases.md +15 -0
- package/skills/pi-agent/references/skills.md +83 -0
- package/skills/pi-agent/references/terminal-setup.md +87 -0
- package/skills/pi-agent/references/termux.md +31 -0
- package/skills/pi-agent/references/themes.md +69 -0
- package/skills/pi-agent/references/tmux.md +44 -0
- package/skills/pi-agent/references/tui.md +97 -0
- package/skills/pi-agent/references/usage.md +129 -0
- package/skills/pi-agent/references/windows.md +23 -0
- package/skills/pkpd-modeling/SKILL.md +381 -0
- package/skills/pkpd-modeling/assets/nca-reporting-checklist.md +72 -0
- package/skills/pkpd-modeling/assets/popk-analysis-plan.md +136 -0
- package/skills/pkpd-modeling/references/antimicrobial-and-tdm.md +110 -0
- package/skills/pkpd-modeling/references/bioequivalence.md +132 -0
- package/skills/pkpd-modeling/references/dataset-standards.md +103 -0
- package/skills/pkpd-modeling/references/ddi-and-qt.md +132 -0
- package/skills/pkpd-modeling/references/nca-conventions.md +128 -0
- package/skills/pkpd-modeling/references/pbpk.md +103 -0
- package/skills/pkpd-modeling/references/pd-and-exposure-response.md +149 -0
- package/skills/pkpd-modeling/references/population-pk.md +133 -0
- package/skills/pkpd-modeling/references/regulatory-guidance.md +82 -0
- package/skills/pkpd-modeling/references/software-ecosystem.md +123 -0
- package/skills/pkpd-modeling/references/source-ledger.md +89 -0
- package/skills/pkpd-modeling/references/special-populations.md +126 -0
- package/skills/pkpd-modeling/references/structural-models.md +140 -0
- package/skills/pkpd-modeling/references/tmdd-and-biologics.md +115 -0
- package/skills/pkpd-modeling/scripts/_common.py +327 -0
- package/skills/pkpd-modeling/scripts/_models.py +673 -0
- package/skills/pkpd-modeling/scripts/allometry_and_fih.py +346 -0
- package/skills/pkpd-modeling/scripts/bioequivalence.py +480 -0
- package/skills/pkpd-modeling/scripts/check_popk_dataset.py +400 -0
- package/skills/pkpd-modeling/scripts/ddi_static.py +346 -0
- package/skills/pkpd-modeling/scripts/exposure_response.py +328 -0
- package/skills/pkpd-modeling/scripts/fit_compartmental.py +558 -0
- package/skills/pkpd-modeling/scripts/nca.py +587 -0
- package/skills/pkpd-modeling/scripts/simulate_regimen.py +323 -0
- package/skills/pkpd-modeling/scripts/tdm_bayes.py +312 -0
- package/skills/polars/SKILL.md +393 -0
- package/skills/polars/references/best_practices.md +651 -0
- package/skills/polars/references/core_concepts.md +380 -0
- package/skills/polars/references/io_guide.md +564 -0
- package/skills/polars/references/operations.md +602 -0
- package/skills/polars/references/pandas_migration.md +417 -0
- package/skills/polars/references/transformations.md +549 -0
- package/skills/polars-bio/SKILL.md +379 -0
- package/skills/polars-bio/references/bioframe_migration.md +250 -0
- package/skills/polars-bio/references/configuration.md +187 -0
- package/skills/polars-bio/references/file_io.md +469 -0
- package/skills/polars-bio/references/interval_operations.md +370 -0
- package/skills/polars-bio/references/pileup_operations.md +176 -0
- package/skills/polars-bio/references/sql_processing.md +224 -0
- package/skills/ponytail/SKILL.md +31 -0
- package/skills/ponytail-audit/SKILL.md +18 -0
- package/skills/pptx/LICENSE.txt +30 -0
- package/skills/pptx/SKILL.md +246 -0
- package/skills/pptx/scripts/__init__.py +0 -0
- package/skills/pptx/scripts/add_slide.py +367 -0
- package/skills/pptx/scripts/clean.py +309 -0
- package/skills/pptx/scripts/office/helpers/__init__.py +111 -0
- package/skills/pptx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/pptx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/pptx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/pptx/scripts/office/soffice.py +232 -0
- package/skills/pptx/scripts/office/validate.py +173 -0
- package/skills/pptx/scripts/office/validators/__init__.py +15 -0
- package/skills/pptx/scripts/office/validators/base.py +875 -0
- package/skills/pptx/scripts/office/validators/docx.py +466 -0
- package/skills/pptx/scripts/office/validators/pptx.py +441 -0
- package/skills/pptx/scripts/office/validators/redlining.py +299 -0
- package/skills/pptx/scripts/thumbnail.py +311 -0
- package/skills/pptx-posters/SKILL.md +258 -0
- package/skills/pptx-posters/assets/generation_dependencies.json +5 -0
- package/skills/pptx-posters/assets/poster_manifest_template.json +154 -0
- package/skills/pptx-posters/assets/poster_quality_checklist.md +192 -0
- package/skills/pptx-posters/references/manifest_spec.md +297 -0
- package/skills/pptx-posters/references/poster_content_guide.md +176 -0
- package/skills/pptx-posters/references/poster_design_principles.md +226 -0
- package/skills/pptx-posters/references/poster_layout_design.md +189 -0
- package/skills/pptx-posters/references/pptx_security.md +202 -0
- package/skills/pptx-posters/references/security_validation.md +90 -0
- package/skills/pptx-posters/references/source_ledger.md +256 -0
- package/skills/pptx-posters/scripts/_common.py +396 -0
- package/skills/pptx-posters/scripts/_manifest.py +1318 -0
- package/skills/pptx-posters/scripts/_pptx.py +1484 -0
- package/skills/pptx-posters/scripts/check_layout.py +179 -0
- package/skills/pptx-posters/scripts/check_palette.py +142 -0
- package/skills/pptx-posters/scripts/generate_poster.py +427 -0
- package/skills/pptx-posters/scripts/inspect_pptx.py +40 -0
- package/skills/pptx-posters/scripts/inventory_images.py +252 -0
- package/skills/pptx-posters/scripts/plan_export.py +201 -0
- package/skills/pptx-posters/scripts/validate_manifest.py +55 -0
- package/skills/primekg/SKILL.md +99 -0
- package/skills/primekg/scripts/query_primekg.py +128 -0
- package/skills/protocolsio-integration/SKILL.md +236 -0
- package/skills/protocolsio-integration/assets/protocol-snapshot.schema.json +179 -0
- package/skills/protocolsio-integration/references/additional_features.md +202 -0
- package/skills/protocolsio-integration/references/authentication.md +135 -0
- package/skills/protocolsio-integration/references/discussions.md +192 -0
- package/skills/protocolsio-integration/references/file_manager.md +256 -0
- package/skills/protocolsio-integration/references/protocols_api.md +256 -0
- package/skills/protocolsio-integration/references/workspaces.md +192 -0
- package/skills/protocolsio-integration/scripts/__init__.py +1 -0
- package/skills/protocolsio-integration/scripts/_common.py +613 -0
- package/skills/protocolsio-integration/scripts/pagination_helper.py +248 -0
- package/skills/protocolsio-integration/scripts/plan_write_request.py +657 -0
- package/skills/protocolsio-integration/scripts/protocols_read.py +493 -0
- package/skills/protocolsio-integration/scripts/validate_auth_config.py +128 -0
- package/skills/protocolsio-integration/scripts/validate_protocol_json.py +358 -0
- package/skills/pufferlib/SKILL.md +328 -0
- package/skills/pufferlib/references/environments.md +260 -0
- package/skills/pufferlib/references/integration.md +192 -0
- package/skills/pufferlib/references/policies.md +181 -0
- package/skills/pufferlib/references/training.md +287 -0
- package/skills/pufferlib/references/vectorization.md +210 -0
- package/skills/pufferlib/scripts/__init__.py +1 -0
- package/skills/pufferlib/scripts/_common.py +199 -0
- package/skills/pufferlib/scripts/benchmark_vectorization.py +244 -0
- package/skills/pufferlib/scripts/env_contract_validator.py +198 -0
- package/skills/pufferlib/scripts/env_template.py +210 -0
- package/skills/pufferlib/scripts/inspect_checkpoint.py +225 -0
- package/skills/pufferlib/scripts/repro_plan.py +177 -0
- package/skills/pufferlib/scripts/train_template.py +282 -0
- package/skills/pufferlib/scripts/validate_plan.py +570 -0
- package/skills/pydeseq2/SKILL.md +369 -0
- package/skills/pydeseq2/references/analysis_patterns.md +70 -0
- package/skills/pydeseq2/references/api_reference.md +256 -0
- package/skills/pydeseq2/references/core_workflow_steps.md +162 -0
- package/skills/pydeseq2/references/workflow_guide.md +603 -0
- package/skills/pydeseq2/scripts/run_deseq2_analysis.py +388 -0
- package/skills/pydicom/SKILL.md +381 -0
- package/skills/pydicom/references/common_tags.md +277 -0
- package/skills/pydicom/references/transfer_syntaxes.md +348 -0
- package/skills/pydicom/scripts/__init__.py +1 -0
- package/skills/pydicom/scripts/_common.py +916 -0
- package/skills/pydicom/scripts/anonymize_dicom.py +713 -0
- package/skills/pydicom/scripts/deidentification_audit.py +380 -0
- package/skills/pydicom/scripts/dicom_inventory.py +402 -0
- package/skills/pydicom/scripts/dicom_to_image.py +459 -0
- package/skills/pydicom/scripts/extract_metadata.py +330 -0
- package/skills/pydicom/scripts/pixel_frame_planner.py +303 -0
- package/skills/pydicom/scripts/transfer_syntax_inspector.py +245 -0
- package/skills/pydicom/scripts/uid_mapping_validator.py +240 -0
- package/skills/pyhealth/SKILL.md +124 -0
- package/skills/pyhealth/assets/starter_pipeline.py +58 -0
- package/skills/pyhealth/references/datasets.md +126 -0
- package/skills/pyhealth/references/examples.md +237 -0
- package/skills/pyhealth/references/installation.md +112 -0
- package/skills/pyhealth/references/medcode.md +94 -0
- package/skills/pyhealth/references/models.md +114 -0
- package/skills/pyhealth/references/tasks.md +143 -0
- package/skills/pylabrobot/SKILL.md +216 -0
- package/skills/pylabrobot/assets/protocol-manifest.schema.json +367 -0
- package/skills/pylabrobot/references/analytical-equipment.md +200 -0
- package/skills/pylabrobot/references/hardware-backends.md +215 -0
- package/skills/pylabrobot/references/liquid-handling.md +223 -0
- package/skills/pylabrobot/references/material-handling.md +229 -0
- package/skills/pylabrobot/references/resources.md +238 -0
- package/skills/pylabrobot/references/visualization.md +187 -0
- package/skills/pylabrobot/scripts/__init__.py +1 -0
- package/skills/pylabrobot/scripts/_common.py +718 -0
- package/skills/pylabrobot/scripts/check_deck_geometry.py +52 -0
- package/skills/pylabrobot/scripts/generate_simulation_plan.py +140 -0
- package/skills/pylabrobot/scripts/inspect_backends.py +216 -0
- package/skills/pylabrobot/scripts/plan_transfers.py +59 -0
- package/skills/pylabrobot/scripts/validate_manifest.py +47 -0
- package/skills/pymatgen/SKILL.md +404 -0
- package/skills/pymatgen/references/analysis_modules.md +352 -0
- package/skills/pymatgen/references/core_classes.md +290 -0
- package/skills/pymatgen/references/io_formats.md +323 -0
- package/skills/pymatgen/references/materials_project_api.md +406 -0
- package/skills/pymatgen/references/transformations_workflows.md +385 -0
- package/skills/pymatgen/scripts/_common.py +316 -0
- package/skills/pymatgen/scripts/artifact_manifest.py +172 -0
- package/skills/pymatgen/scripts/composition_structure_validator.py +300 -0
- package/skills/pymatgen/scripts/io_conversion_plan.py +204 -0
- package/skills/pymatgen/scripts/mp_query.py +416 -0
- package/skills/pymatgen/scripts/phase_diagram_generator.py +415 -0
- package/skills/pymatgen/scripts/structure_analyzer.py +293 -0
- package/skills/pymatgen/scripts/structure_converter.py +219 -0
- package/skills/pymatgen/scripts/symmetry_sensitivity_report.py +212 -0
- package/skills/pymc/SKILL.md +310 -0
- package/skills/pymc/assets/hierarchical_model_template.py +332 -0
- package/skills/pymc/assets/linear_regression_template.py +244 -0
- package/skills/pymc/references/distributions.md +345 -0
- package/skills/pymc/references/model_patterns.md +130 -0
- package/skills/pymc/references/sampling_inference.md +432 -0
- package/skills/pymc/references/standard_workflow.md +176 -0
- package/skills/pymc/references/workflows.md +530 -0
- package/skills/pymc/scripts/model_comparison.py +409 -0
- package/skills/pymc/scripts/model_diagnostics.py +328 -0
- package/skills/pymoo/SKILL.md +276 -0
- package/skills/pymoo/references/algorithms.md +232 -0
- package/skills/pymoo/references/constraints_mcdm.md +417 -0
- package/skills/pymoo/references/operators.md +345 -0
- package/skills/pymoo/references/parallelization.md +80 -0
- package/skills/pymoo/references/problems.md +265 -0
- package/skills/pymoo/references/quick_start_workflows.md +404 -0
- package/skills/pymoo/references/visualization.md +353 -0
- package/skills/pymoo/scripts/custom_problem_example.py +181 -0
- package/skills/pymoo/scripts/decision_making_example.py +161 -0
- package/skills/pymoo/scripts/many_objective_example.py +74 -0
- package/skills/pymoo/scripts/multi_objective_example.py +63 -0
- package/skills/pymoo/scripts/single_objective_example.py +59 -0
- package/skills/pyopenms/SKILL.md +179 -0
- package/skills/pyopenms/references/data_structures.md +498 -0
- package/skills/pyopenms/references/feature_detection.md +495 -0
- package/skills/pyopenms/references/file_io.md +359 -0
- package/skills/pyopenms/references/identification.md +431 -0
- package/skills/pyopenms/references/metabolomics.md +548 -0
- package/skills/pyopenms/references/signal_processing.md +444 -0
- package/skills/pyopenms/scripts/accurate_mass_search.py +111 -0
- package/skills/pyopenms/scripts/align_link_quantify.py +140 -0
- package/skills/pyopenms/scripts/consensus_to_matrix.py +70 -0
- package/skills/pyopenms/scripts/convert_format.py +95 -0
- package/skills/pyopenms/scripts/detect_adducts.py +90 -0
- package/skills/pyopenms/scripts/detect_features_centroided.py +80 -0
- package/skills/pyopenms/scripts/detect_features_metabo.py +110 -0
- package/skills/pyopenms/scripts/digest_protein.py +102 -0
- package/skills/pyopenms/scripts/export_gnps_sirius.py +90 -0
- package/skills/pyopenms/scripts/extract_chromatograms.py +105 -0
- package/skills/pyopenms/scripts/inspect_ms_data.py +167 -0
- package/skills/pyopenms/scripts/mass_calculator.py +92 -0
- package/skills/pyopenms/scripts/plot_ms_data.py +129 -0
- package/skills/pyopenms/scripts/process_identifications.py +111 -0
- package/skills/pyopenms/scripts/process_spectra.py +124 -0
- package/skills/pyopenms/scripts/theoretical_spectrum.py +75 -0
- package/skills/pysam/SKILL.md +330 -0
- package/skills/pysam/references/alignment_files.md +374 -0
- package/skills/pysam/references/api_reference.md +421 -0
- package/skills/pysam/references/common_workflows.md +442 -0
- package/skills/pysam/references/coordinates_and_indexing.md +318 -0
- package/skills/pysam/references/cram_and_performance.md +314 -0
- package/skills/pysam/references/migration_to_0_24.md +177 -0
- package/skills/pysam/references/sequence_files.md +316 -0
- package/skills/pysam/references/sources.md +132 -0
- package/skills/pysam/references/variant_files.md +396 -0
- package/skills/pysam/scripts/alignment_qc.py +326 -0
- package/skills/pysam/scripts/filter_alignments.py +359 -0
- package/skills/pysam/scripts/inspect_hts.py +485 -0
- package/skills/pysam/scripts/variant_summary.py +362 -0
- package/skills/pytdc/SKILL.md +297 -0
- package/skills/pytdc/references/datasets.md +242 -0
- package/skills/pytdc/references/oracles.md +273 -0
- package/skills/pytdc/references/sources.md +165 -0
- package/skills/pytdc/references/utilities.md +364 -0
- package/skills/pytdc/scripts/_common.py +205 -0
- package/skills/pytdc/scripts/benchmark_evaluation.py +367 -0
- package/skills/pytdc/scripts/cache_audit.py +146 -0
- package/skills/pytdc/scripts/discover_metadata.py +174 -0
- package/skills/pytdc/scripts/load_and_split_data.py +374 -0
- package/skills/pytdc/scripts/molecular_generation.py +417 -0
- package/skills/pytorch-lightning/SKILL.md +191 -0
- package/skills/pytorch-lightning/references/best_practices.md +724 -0
- package/skills/pytorch-lightning/references/callbacks.md +564 -0
- package/skills/pytorch-lightning/references/data_module.md +565 -0
- package/skills/pytorch-lightning/references/distributed_training.md +644 -0
- package/skills/pytorch-lightning/references/lightning_module.md +487 -0
- package/skills/pytorch-lightning/references/logging.md +636 -0
- package/skills/pytorch-lightning/references/trainer.md +641 -0
- package/skills/pytorch-lightning/scripts/quick_trainer_setup.py +473 -0
- package/skills/pytorch-lightning/scripts/template_datamodule.py +328 -0
- package/skills/pytorch-lightning/scripts/template_lightning_module.py +220 -0
- package/skills/pyzotero/SKILL.md +137 -0
- package/skills/pyzotero/references/authentication.md +105 -0
- package/skills/pyzotero/references/cli.md +102 -0
- package/skills/pyzotero/references/collections.md +113 -0
- package/skills/pyzotero/references/error-handling.md +108 -0
- package/skills/pyzotero/references/exports.md +102 -0
- package/skills/pyzotero/references/files-attachments.md +97 -0
- package/skills/pyzotero/references/full-text.md +68 -0
- package/skills/pyzotero/references/mcp.md +90 -0
- package/skills/pyzotero/references/pagination.md +79 -0
- package/skills/pyzotero/references/read-api.md +137 -0
- package/skills/pyzotero/references/saved-searches.md +77 -0
- package/skills/pyzotero/references/search-params.md +90 -0
- package/skills/pyzotero/references/tags.md +87 -0
- package/skills/pyzotero/references/write-api.md +123 -0
- package/skills/qiskit/SKILL.md +259 -0
- package/skills/qiskit/references/algorithms.md +311 -0
- package/skills/qiskit/references/backends.md +382 -0
- package/skills/qiskit/references/circuits.md +319 -0
- package/skills/qiskit/references/migration.md +338 -0
- package/skills/qiskit/references/patterns.md +386 -0
- package/skills/qiskit/references/primitives.md +400 -0
- package/skills/qiskit/references/setup.md +253 -0
- package/skills/qiskit/references/sources.md +156 -0
- package/skills/qiskit/references/testing.md +428 -0
- package/skills/qiskit/references/transpilation.md +333 -0
- package/skills/qiskit/references/visualization.md +361 -0
- package/skills/qiskit/scripts/check_environment.py +260 -0
- package/skills/qiskit/scripts/inspect_runtime.py +224 -0
- package/skills/qiskit/scripts/run_local_primitives.py +200 -0
- package/skills/qutip/SKILL.md +317 -0
- package/skills/qutip/references/advanced.md +413 -0
- package/skills/qutip/references/analysis.md +319 -0
- package/skills/qutip/references/core_concepts.md +300 -0
- package/skills/qutip/references/time_evolution.md +373 -0
- package/skills/qutip/references/visualization.md +334 -0
- package/skills/qutip/scripts/_common.py +370 -0
- package/skills/qutip/scripts/convergence_sweep.py +358 -0
- package/skills/qutip/scripts/qobj_model_validator.py +327 -0
- package/skills/qutip/scripts/result_audit.py +395 -0
- package/skills/qutip/scripts/solver_config_planner.py +297 -0
- package/skills/qutip/scripts/steady_state_spectrum_planner.py +245 -0
- package/skills/qutip/scripts/two_level_simulation.py +394 -0
- package/skills/rdkit/SKILL.md +94 -0
- package/skills/rdkit/references/api_reference.md +443 -0
- package/skills/rdkit/references/core_capabilities.md +604 -0
- package/skills/rdkit/references/descriptors_reference.md +595 -0
- package/skills/rdkit/references/smarts_patterns.md +668 -0
- package/skills/rdkit/references/workflows_and_best_practices.md +169 -0
- package/skills/rdkit/scripts/molecular_properties.py +243 -0
- package/skills/rdkit/scripts/similarity_search.py +297 -0
- package/skills/rdkit/scripts/substructure_filter.py +386 -0
- package/skills/relsa-severity-assessment/SKILL.md +354 -0
- package/skills/relsa-severity-assessment/assets/example_cohort.csv +55 -0
- package/skills/relsa-severity-assessment/references/forecasting.md +155 -0
- package/skills/relsa-severity-assessment/references/relsa-method.md +175 -0
- package/skills/relsa-severity-assessment/references/thresholds-and-zones.md +154 -0
- package/skills/relsa-severity-assessment/scripts/_common.py +287 -0
- package/skills/relsa-severity-assessment/scripts/forecast_relsa.py +757 -0
- package/skills/relsa-severity-assessment/scripts/kde_thresholds.py +369 -0
- package/skills/relsa-severity-assessment/scripts/relsa_score.py +488 -0
- package/skills/research-grants/SKILL.md +296 -0
- package/skills/research-grants/assets/budget_justification_template.md +453 -0
- package/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/skills/research-grants/references/README.md +287 -0
- package/skills/research-grants/references/broader_impacts.md +392 -0
- package/skills/research-grants/references/core_components.md +397 -0
- package/skills/research-grants/references/darpa_guidelines.md +636 -0
- package/skills/research-grants/references/doe_guidelines.md +586 -0
- package/skills/research-grants/references/nih_guidelines.md +853 -0
- package/skills/research-grants/references/nsf_guidelines.md +570 -0
- package/skills/research-grants/references/nstc_guidelines.md +733 -0
- package/skills/research-grants/references/proposal_types_and_resubmission.md +81 -0
- package/skills/research-grants/references/review_criteria.md +93 -0
- package/skills/research-grants/references/specific_aims_guide.md +458 -0
- package/skills/research-grants/references/writing_principles.md +94 -0
- package/skills/research-lookup/README.md +106 -0
- package/skills/research-lookup/SKILL.md +338 -0
- package/skills/research-lookup/scripts/manuscript_packet.py +754 -0
- package/skills/research-lookup/scripts/research_lookup.py +1204 -0
- package/skills/rowan/SKILL.md +398 -0
- package/skills/rowan/references/access_and_pricing.md +37 -0
- package/skills/rowan/references/batch_and_webhooks.md +255 -0
- package/skills/rowan/references/end_to_end_example.md +119 -0
- package/skills/rowan/references/troubleshooting.md +106 -0
- package/skills/rowan/references/workflow_catalog.md +308 -0
- package/skills/scanpy/SKILL.md +303 -0
- package/skills/scanpy/assets/analysis_template.py +301 -0
- package/skills/scanpy/assets/celltype_mapping.json +10 -0
- package/skills/scanpy/assets/gene_signatures.json +9 -0
- package/skills/scanpy/assets/pipeline_config.json +19 -0
- package/skills/scanpy/references/analysis_workflow.md +236 -0
- package/skills/scanpy/references/api_reference.md +267 -0
- package/skills/scanpy/references/plotting_guide.md +365 -0
- package/skills/scanpy/references/r_interop.md +292 -0
- package/skills/scanpy/references/standard_workflow.md +223 -0
- package/skills/scanpy/scripts/_common.py +127 -0
- package/skills/scanpy/scripts/annotate.py +84 -0
- package/skills/scanpy/scripts/batch_correct.py +65 -0
- package/skills/scanpy/scripts/cluster.py +63 -0
- package/skills/scanpy/scripts/convert.py +43 -0
- package/skills/scanpy/scripts/find_markers.py +75 -0
- package/skills/scanpy/scripts/inspect_data.py +81 -0
- package/skills/scanpy/scripts/plot.py +78 -0
- package/skills/scanpy/scripts/preprocess.py +88 -0
- package/skills/scanpy/scripts/pseudobulk.py +74 -0
- package/skills/scanpy/scripts/qc_analysis.py +104 -0
- package/skills/scanpy/scripts/reduce_dimensions.py +64 -0
- package/skills/scanpy/scripts/run_pipeline.py +182 -0
- package/skills/scanpy/scripts/score_genes.py +82 -0
- package/skills/scanpy/scripts/subset.py +64 -0
- package/skills/scholar-evaluation/SKILL.md +296 -0
- package/skills/scholar-evaluation/assets/evaluation_template.json +50 -0
- package/skills/scholar-evaluation/assets/evidence_manifest_template.json +63 -0
- package/skills/scholar-evaluation/assets/process_checklist_template.json +70 -0
- package/skills/scholar-evaluation/assets/ratings_template.csv +21 -0
- package/skills/scholar-evaluation/assets/rubric_template.json +301 -0
- package/skills/scholar-evaluation/references/evaluation_framework.md +264 -0
- package/skills/scholar-evaluation/references/local_tooling.md +232 -0
- package/skills/scholar-evaluation/references/responsible_assessment.md +196 -0
- package/skills/scholar-evaluation/references/security_validation.md +95 -0
- package/skills/scholar-evaluation/references/source_ledger.md +222 -0
- package/skills/scholar-evaluation/scripts/_common.py +986 -0
- package/skills/scholar-evaluation/scripts/calculate_scores.py +57 -0
- package/skills/scholar-evaluation/scripts/check_process.py +231 -0
- package/skills/scholar-evaluation/scripts/check_traceability.py +233 -0
- package/skills/scholar-evaluation/scripts/generate_report_scaffold.py +231 -0
- package/skills/scholar-evaluation/scripts/summarize_agreement.py +235 -0
- package/skills/scholar-evaluation/scripts/validate_rubric.py +54 -0
- package/skills/scholar-evaluation/scripts/weight_sensitivity.py +251 -0
- package/skills/scientific-brainstorming/SKILL.md +282 -0
- package/skills/scientific-brainstorming/references/brainstorming_methods.md +292 -0
- package/skills/scientific-brainstorming/references/facilitation_workflows.md +284 -0
- package/skills/scientific-brainstorming/references/idea_evaluation.md +268 -0
- package/skills/scientific-brainstorming/references/responsible_ai.md +220 -0
- package/skills/scientific-brainstorming/references/sources.md +364 -0
- package/skills/scientific-brainstorming/scripts/_common.py +307 -0
- package/skills/scientific-brainstorming/scripts/evaluate_matrix.py +518 -0
- package/skills/scientific-brainstorming/scripts/session_scaffold.py +248 -0
- package/skills/scientific-brainstorming/scripts/validate_register.py +654 -0
- package/skills/scientific-critical-thinking/SKILL.md +180 -0
- package/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- package/skills/scientific-critical-thinking/references/core_capabilities.md +407 -0
- package/skills/scientific-critical-thinking/references/evidence_hierarchy.md +485 -0
- package/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/skills/scientific-schematics/SKILL.md +370 -0
- package/skills/scientific-schematics/references/best_practices.md +574 -0
- package/skills/scientific-schematics/references/iterative_refinement.md +315 -0
- package/skills/scientific-schematics/scripts/example_usage.sh +92 -0
- package/skills/scientific-schematics/scripts/generate_schematic.py +198 -0
- package/skills/scientific-schematics/scripts/generate_schematic_ai.py +950 -0
- package/skills/scientific-slides/SKILL.md +379 -0
- package/skills/scientific-slides/assets/beamer_template_conference.tex +407 -0
- package/skills/scientific-slides/assets/beamer_template_defense.tex +906 -0
- package/skills/scientific-slides/assets/beamer_template_seminar.tex +870 -0
- package/skills/scientific-slides/assets/powerpoint_design_guide.md +662 -0
- package/skills/scientific-slides/assets/timing_guidelines.md +597 -0
- package/skills/scientific-slides/references/beamer_guide.md +1019 -0
- package/skills/scientific-slides/references/common_pitfalls.md +85 -0
- package/skills/scientific-slides/references/data_visualization_slides.md +708 -0
- package/skills/scientific-slides/references/presentation_structure.md +642 -0
- package/skills/scientific-slides/references/presentation_workflow.md +196 -0
- package/skills/scientific-slides/references/prompt_writing.md +42 -0
- package/skills/scientific-slides/references/script_reference.md +143 -0
- package/skills/scientific-slides/references/slide_capabilities.md +360 -0
- package/skills/scientific-slides/references/slide_design_principles.md +849 -0
- package/skills/scientific-slides/references/talk_types_guide.md +687 -0
- package/skills/scientific-slides/references/visual_review_workflow.md +775 -0
- package/skills/scientific-slides/scripts/generate_schematic.py +198 -0
- package/skills/scientific-slides/scripts/generate_schematic_ai.py +950 -0
- package/skills/scientific-slides/scripts/generate_slide_image.py +197 -0
- package/skills/scientific-slides/scripts/generate_slide_image_ai.py +877 -0
- package/skills/scientific-slides/scripts/pdf_to_images.py +221 -0
- package/skills/scientific-slides/scripts/slides_to_pdf.py +235 -0
- package/skills/scientific-slides/scripts/validate_presentation.py +408 -0
- package/skills/scientific-visualization/SKILL.md +285 -0
- package/skills/scientific-visualization/assets/color_palettes.py +263 -0
- package/skills/scientific-visualization/assets/nature.mplstyle +68 -0
- package/skills/scientific-visualization/assets/presentation.mplstyle +68 -0
- package/skills/scientific-visualization/assets/publication.mplstyle +77 -0
- package/skills/scientific-visualization/assets/publisher_profiles.json +269 -0
- package/skills/scientific-visualization/references/color_palettes.md +227 -0
- package/skills/scientific-visualization/references/journal_requirements.md +169 -0
- package/skills/scientific-visualization/references/matplotlib_examples.md +336 -0
- package/skills/scientific-visualization/references/publication_guidelines.md +196 -0
- package/skills/scientific-visualization/references/sources.md +76 -0
- package/skills/scientific-visualization/scripts/_common.py +136 -0
- package/skills/scientific-visualization/scripts/export_plan.py +493 -0
- package/skills/scientific-visualization/scripts/figure_export.py +642 -0
- package/skills/scientific-visualization/scripts/image_metadata.py +731 -0
- package/skills/scientific-visualization/scripts/palette_audit.py +327 -0
- package/skills/scientific-visualization/scripts/style_presets.py +501 -0
- package/skills/scientific-visualization/scripts/style_preview.py +232 -0
- package/skills/scientific-writing/SKILL.md +356 -0
- package/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +60 -0
- package/skills/scientific-writing/assets/authorship_template.json +56 -0
- package/skills/scientific-writing/assets/claim_evidence_template.csv +2 -0
- package/skills/scientific-writing/assets/consistency_manifest_template.json +43 -0
- package/skills/scientific-writing/assets/manuscript_manifest_template.json +37 -0
- package/skills/scientific-writing/assets/manuscript_scaffold.md +65 -0
- package/skills/scientific-writing/assets/reporting_coverage_template.json +6 -0
- package/skills/scientific-writing/assets/reporting_guidelines.json +529 -0
- package/skills/scientific-writing/assets/source_manifest_template.json +27 -0
- package/skills/scientific-writing/references/authorship_ai_confidentiality.md +111 -0
- package/skills/scientific-writing/references/citation_styles.md +92 -0
- package/skills/scientific-writing/references/cli_reference.md +113 -0
- package/skills/scientific-writing/references/evidence_workflow.md +94 -0
- package/skills/scientific-writing/references/figures_tables.md +94 -0
- package/skills/scientific-writing/references/imrad_structure.md +114 -0
- package/skills/scientific-writing/references/journal_policies.md +56 -0
- package/skills/scientific-writing/references/professional_report_formatting.md +82 -0
- package/skills/scientific-writing/references/reporting_guidelines.md +107 -0
- package/skills/scientific-writing/references/research_integrity_open_science.md +97 -0
- package/skills/scientific-writing/references/source_ledger.md +268 -0
- package/skills/scientific-writing/references/writing_principles.md +97 -0
- package/skills/scientific-writing/scripts/_common.py +240 -0
- package/skills/scientific-writing/scripts/audit_claims.py +241 -0
- package/skills/scientific-writing/scripts/check_consistency.py +408 -0
- package/skills/scientific-writing/scripts/check_references.py +219 -0
- package/skills/scientific-writing/scripts/lint_manuscript.py +171 -0
- package/skills/scientific-writing/scripts/scaffold_manuscript.py +143 -0
- package/skills/scientific-writing/scripts/select_reporting_guidelines.py +214 -0
- package/skills/scientific-writing/scripts/validate_authorship.py +322 -0
- package/skills/scientific-writing/scripts/validate_manifest.py +460 -0
- package/skills/scikit-bio/SKILL.md +470 -0
- package/skills/scikit-bio/references/api_reference.md +766 -0
- package/skills/scikit-learn/SKILL.md +324 -0
- package/skills/scikit-learn/references/common_workflows.md +107 -0
- package/skills/scikit-learn/references/core_capabilities.md +133 -0
- package/skills/scikit-learn/references/model_evaluation.md +592 -0
- package/skills/scikit-learn/references/pipelines_and_composition.md +612 -0
- package/skills/scikit-learn/references/preprocessing.md +606 -0
- package/skills/scikit-learn/references/quick_reference.md +436 -0
- package/skills/scikit-learn/references/supervised_learning.md +379 -0
- package/skills/scikit-learn/references/unsupervised_learning.md +517 -0
- package/skills/scikit-learn/scripts/classification_pipeline.py +257 -0
- package/skills/scikit-learn/scripts/clustering_analysis.py +386 -0
- package/skills/scikit-survival/SKILL.md +313 -0
- package/skills/scikit-survival/references/competing-risks.md +302 -0
- package/skills/scikit-survival/references/cox-models.md +252 -0
- package/skills/scikit-survival/references/data-handling.md +278 -0
- package/skills/scikit-survival/references/ensemble-models.md +287 -0
- package/skills/scikit-survival/references/evaluation-metrics.md +391 -0
- package/skills/scikit-survival/references/svm-models.md +277 -0
- package/skills/scikit-survival/scripts/_common.py +456 -0
- package/skills/scikit-survival/scripts/competing_risk_cif.py +286 -0
- package/skills/scikit-survival/scripts/evaluate_survival_metrics.py +296 -0
- package/skills/scikit-survival/scripts/model_report.py +297 -0
- package/skills/scikit-survival/scripts/train_survival_model.py +583 -0
- package/skills/scikit-survival/scripts/validate_survival_csv.py +172 -0
- package/skills/scvelo/SKILL.md +328 -0
- package/skills/scvelo/references/velocity_models.md +168 -0
- package/skills/scvelo/scripts/rna_velocity_workflow.py +240 -0
- package/skills/scvi-tools/SKILL.md +201 -0
- package/skills/scvi-tools/references/differential-expression.md +597 -0
- package/skills/scvi-tools/references/models-atac-seq.md +329 -0
- package/skills/scvi-tools/references/models-multimodal.md +400 -0
- package/skills/scvi-tools/references/models-scrna-seq.md +333 -0
- package/skills/scvi-tools/references/models-spatial.md +432 -0
- package/skills/scvi-tools/references/models-specialized.md +376 -0
- package/skills/scvi-tools/references/theoretical-foundations.md +438 -0
- package/skills/scvi-tools/references/workflows.md +559 -0
- package/skills/seaborn/SKILL.md +254 -0
- package/skills/seaborn/references/examples.md +824 -0
- package/skills/seaborn/references/function_reference.md +772 -0
- package/skills/seaborn/references/grids_and_levels.md +85 -0
- package/skills/seaborn/references/objects_interface.md +963 -0
- package/skills/seaborn/references/palettes_and_theming.md +110 -0
- package/skills/seaborn/references/patterns_and_troubleshooting.md +114 -0
- package/skills/seaborn/references/plotting_functions.md +178 -0
- package/skills/security-auditor/SKILL.md +37 -0
- package/skills/shap/SKILL.md +282 -0
- package/skills/shap/references/data-maskers.md +287 -0
- package/skills/shap/references/explainers.md +376 -0
- package/skills/shap/references/migration.md +415 -0
- package/skills/shap/references/modalities.md +353 -0
- package/skills/shap/references/plots.md +406 -0
- package/skills/shap/references/theory.md +352 -0
- package/skills/shap/references/troubleshooting.md +442 -0
- package/skills/shap/references/workflows.md +565 -0
- package/skills/shap/scripts/tabular_report.py +326 -0
- package/skills/simpy/SKILL.md +283 -0
- package/skills/simpy/references/cli-guide.md +266 -0
- package/skills/simpy/references/events.md +225 -0
- package/skills/simpy/references/monitoring.md +260 -0
- package/skills/simpy/references/process-interaction.md +269 -0
- package/skills/simpy/references/real-time.md +174 -0
- package/skills/simpy/references/resources.md +274 -0
- package/skills/simpy/references/simulation-methodology.md +293 -0
- package/skills/simpy/references/sources.md +167 -0
- package/skills/simpy/scripts/_common.py +473 -0
- package/skills/simpy/scripts/basic_simulation_template.py +415 -0
- package/skills/simpy/scripts/bounded_queue_scenario.py +126 -0
- package/skills/simpy/scripts/event_trace_summary.py +296 -0
- package/skills/simpy/scripts/replication_runner.py +194 -0
- package/skills/simpy/scripts/resource_monitor.py +474 -0
- package/skills/simpy/scripts/validate_simulation_config.py +111 -0
- package/skills/stable-baselines3/SKILL.md +325 -0
- package/skills/stable-baselines3/references/algorithms.md +348 -0
- package/skills/stable-baselines3/references/callbacks.md +571 -0
- package/skills/stable-baselines3/references/custom_environments.md +528 -0
- package/skills/stable-baselines3/references/vectorized_envs.md +580 -0
- package/skills/stable-baselines3/scripts/custom_env_template.py +314 -0
- package/skills/stable-baselines3/scripts/evaluate_agent.py +245 -0
- package/skills/stable-baselines3/scripts/train_rl_agent.py +165 -0
- package/skills/statistical-analysis/SKILL.md +446 -0
- package/skills/statistical-analysis/references/assumptions_and_diagnostics.md +379 -0
- package/skills/statistical-analysis/references/bayesian_statistics.md +686 -0
- package/skills/statistical-analysis/references/effect_sizes_and_power.md +649 -0
- package/skills/statistical-analysis/references/reporting_standards.md +482 -0
- package/skills/statistical-analysis/references/test_selection_guide.md +129 -0
- package/skills/statistical-analysis/scripts/assumption_checks.py +652 -0
- package/skills/statistical-power/SKILL.md +200 -0
- package/skills/statistical-power/references/closed_form_recipes.md +174 -0
- package/skills/statistical-power/references/effect_sizes.md +121 -0
- package/skills/statistical-power/references/simulation_based_power.md +101 -0
- package/skills/statistical-power/scripts/power.py +320 -0
- package/skills/statistical-power/scripts/simulate_power.py +217 -0
- package/skills/statsmodels/SKILL.md +238 -0
- package/skills/statsmodels/references/discrete_choice.md +669 -0
- package/skills/statsmodels/references/glm.md +619 -0
- package/skills/statsmodels/references/linear_models.md +447 -0
- package/skills/statsmodels/references/model_selection.md +99 -0
- package/skills/statsmodels/references/modeling_capabilities.md +168 -0
- package/skills/statsmodels/references/quick_start_guide.md +154 -0
- package/skills/statsmodels/references/stats_diagnostics.md +859 -0
- package/skills/statsmodels/references/time_series.md +723 -0
- package/skills/sympy/SKILL.md +354 -0
- package/skills/sympy/references/advanced-topics.md +635 -0
- package/skills/sympy/references/code-generation-printing.md +628 -0
- package/skills/sympy/references/core-capabilities.md +348 -0
- package/skills/sympy/references/core_capabilities.md +190 -0
- package/skills/sympy/references/matrices-linear-algebra.md +526 -0
- package/skills/sympy/references/physics-mechanics.md +592 -0
- package/skills/systematic-debugging/SKILL.md +35 -0
- package/skills/tamarind/SKILL.md +285 -0
- package/skills/tamarind/references/api_reference.md +165 -0
- package/skills/tamarind/references/examples.md +132 -0
- package/skills/tamarind/references/tool_catalog.md +66 -0
- package/skills/tamarind/references/workflows.md +263 -0
- package/skills/tdd/SKILL.md +26 -0
- package/skills/tiledbvcf/SKILL.md +456 -0
- package/skills/timesfm-forecasting/SKILL.md +408 -0
- package/skills/timesfm-forecasting/examples/anomaly-detection/detect_anomalies.py +524 -0
- package/skills/timesfm-forecasting/examples/anomaly-detection/output/anomaly_detection.json +448 -0
- package/skills/timesfm-forecasting/examples/anomaly-detection/output/anomaly_detection.png +0 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/demo_covariates.py +568 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/covariates_data.png +0 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/covariates_metadata.json +59 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/sales_with_covariates.csv +109 -0
- package/skills/timesfm-forecasting/examples/global-temperature/README.md +178 -0
- package/skills/timesfm-forecasting/examples/global-temperature/generate_animation_data.py +147 -0
- package/skills/timesfm-forecasting/examples/global-temperature/generate_gif.py +248 -0
- package/skills/timesfm-forecasting/examples/global-temperature/generate_html.py +544 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/animation_data.json +5441 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_animation.gif +0 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_output.csv +13 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_output.json +188 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_visualization.png +0 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/interactive_forecast.html +5939 -0
- package/skills/timesfm-forecasting/examples/global-temperature/run_example.sh +53 -0
- package/skills/timesfm-forecasting/examples/global-temperature/run_forecast.py +167 -0
- package/skills/timesfm-forecasting/examples/global-temperature/temperature_anomaly.csv +37 -0
- package/skills/timesfm-forecasting/examples/global-temperature/visualize_forecast.py +123 -0
- package/skills/timesfm-forecasting/references/api_reference.md +231 -0
- package/skills/timesfm-forecasting/references/data_preparation.md +272 -0
- package/skills/timesfm-forecasting/references/examples_and_validation.md +103 -0
- package/skills/timesfm-forecasting/references/output_and_config.md +93 -0
- package/skills/timesfm-forecasting/references/performance_tuning.md +80 -0
- package/skills/timesfm-forecasting/references/system_requirements.md +201 -0
- package/skills/timesfm-forecasting/references/workflows.md +126 -0
- package/skills/timesfm-forecasting/scripts/check_system.py +521 -0
- package/skills/timesfm-forecasting/scripts/forecast_csv.py +269 -0
- package/skills/torch-geometric/SKILL.md +458 -0
- package/skills/torch-geometric/references/custom_datasets.md +239 -0
- package/skills/torch-geometric/references/explainability.md +208 -0
- package/skills/torch-geometric/references/heterogeneous.md +241 -0
- package/skills/torch-geometric/references/link_prediction.md +226 -0
- package/skills/torch-geometric/references/message_passing.md +121 -0
- package/skills/torch-geometric/references/scaling.md +269 -0
- package/skills/torchdrug/SKILL.md +241 -0
- package/skills/torchdrug/references/core_concepts.md +241 -0
- package/skills/torchdrug/references/datasets.md +179 -0
- package/skills/torchdrug/references/knowledge_graphs.md +226 -0
- package/skills/torchdrug/references/models_architectures.md +223 -0
- package/skills/torchdrug/references/molecular_generation.md +246 -0
- package/skills/torchdrug/references/molecular_property_prediction.md +239 -0
- package/skills/torchdrug/references/protein_modeling.md +221 -0
- package/skills/torchdrug/references/retrosynthesis.md +247 -0
- package/skills/transformers/SKILL.md +195 -0
- package/skills/transformers/references/generation.md +473 -0
- package/skills/transformers/references/models.md +371 -0
- package/skills/transformers/references/pipelines.md +334 -0
- package/skills/transformers/references/tokenizers.md +449 -0
- package/skills/transformers/references/training.md +504 -0
- package/skills/treatment-plans/SKILL.md +174 -0
- package/skills/treatment-plans/assets/clinician_authored_intervention_template.json +11 -0
- package/skills/treatment-plans/assets/goals_monitoring_checkpoint_template.json +13 -0
- package/skills/treatment-plans/assets/informed_preference_shared_decision_template.json +11 -0
- package/skills/treatment-plans/assets/intended_use_handoff_template.json +83 -0
- package/skills/treatment-plans/assets/source_fact_manifest_template.json +11 -0
- package/skills/treatment-plans/assets/transition_reconciliation_template.json +27 -0
- package/skills/treatment-plans/references/README.md +19 -0
- package/skills/treatment-plans/references/documentation_workflow.md +165 -0
- package/skills/treatment-plans/references/privacy_governance.md +119 -0
- package/skills/treatment-plans/references/safety_scope.md +101 -0
- package/skills/treatment-plans/references/security_validation.md +68 -0
- package/skills/treatment-plans/references/shared_decision_handoff.md +138 -0
- package/skills/treatment-plans/references/source_boundaries.md +127 -0
- package/skills/treatment-plans/references/source_ledger.md +131 -0
- package/skills/treatment-plans/scripts/_common.py +1160 -0
- package/skills/treatment-plans/scripts/check_completeness.py +572 -0
- package/skills/treatment-plans/scripts/check_consistency.py +386 -0
- package/skills/treatment-plans/scripts/generate_template.py +133 -0
- package/skills/treatment-plans/scripts/privacy_process_check.py +213 -0
- package/skills/treatment-plans/scripts/timeline_generator.py +260 -0
- package/skills/treatment-plans/scripts/validate_traceability.py +147 -0
- package/skills/treatment-plans/scripts/validate_treatment_plan.py +95 -0
- package/skills/umap-learn/SKILL.md +488 -0
- package/skills/umap-learn/references/api_reference.md +574 -0
- package/skills/uncertainty-and-units/SKILL.md +384 -0
- package/skills/uncertainty-and-units/references/domain-conversions.md +188 -0
- package/skills/uncertainty-and-units/references/gum-methodology.md +219 -0
- package/skills/uncertainty-and-units/references/pint-recipes.md +228 -0
- package/skills/uncertainty-and-units/references/plausibility-scales.md +168 -0
- package/skills/uncertainty-and-units/references/reporting-rules.md +133 -0
- package/skills/uncertainty-and-units/references/uncertainties-recipes.md +167 -0
- package/skills/uncertainty-and-units/scripts/_common.py +666 -0
- package/skills/uncertainty-and-units/scripts/audit_units.py +575 -0
- package/skills/uncertainty-and-units/scripts/check_plausibility.py +894 -0
- package/skills/uncertainty-and-units/scripts/convert_units.py +280 -0
- package/skills/uncertainty-and-units/scripts/format_result.py +326 -0
- package/skills/uncertainty-and-units/scripts/propagate_uncertainty.py +662 -0
- package/skills/uncertainty-and-units/scripts/uncertainty_budget.py +363 -0
- package/skills/usfiscaldata/SKILL.md +171 -0
- package/skills/usfiscaldata/references/api-basics.md +105 -0
- package/skills/usfiscaldata/references/datasets-debt.md +166 -0
- package/skills/usfiscaldata/references/datasets-fiscal.md +212 -0
- package/skills/usfiscaldata/references/datasets-interest-rates.md +188 -0
- package/skills/usfiscaldata/references/datasets-securities.md +238 -0
- package/skills/usfiscaldata/references/examples.md +258 -0
- package/skills/usfiscaldata/references/parameters.md +182 -0
- package/skills/usfiscaldata/references/response-format.md +178 -0
- package/skills/vaex/SKILL.md +204 -0
- package/skills/vaex/references/core_dataframes.md +373 -0
- package/skills/vaex/references/data_processing.md +555 -0
- package/skills/vaex/references/io_operations.md +718 -0
- package/skills/vaex/references/machine_learning.md +728 -0
- package/skills/vaex/references/performance.md +571 -0
- package/skills/vaex/references/visualization.md +644 -0
- package/skills/venue-templates/SKILL.md +269 -0
- package/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
- package/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
- package/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
- package/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
- package/skills/venue-templates/assets/grants/nih_specific_aims.tex +237 -0
- package/skills/venue-templates/assets/grants/nsf_proposal_template.tex +384 -0
- package/skills/venue-templates/assets/journals/elsarticle-harv.bst +1598 -0
- package/skills/venue-templates/assets/journals/elsarticle-num-names.bst +1535 -0
- package/skills/venue-templates/assets/journals/elsarticle-num.bst +1509 -0
- package/skills/venue-templates/assets/journals/elsarticle-template-harv.tex +286 -0
- package/skills/venue-templates/assets/journals/elsarticle-template-num-names.tex +284 -0
- package/skills/venue-templates/assets/journals/elsarticle-template-num.tex +286 -0
- package/skills/venue-templates/assets/journals/nature_article.tex +174 -0
- package/skills/venue-templates/assets/journals/neurips_article.tex +292 -0
- package/skills/venue-templates/assets/journals/plos_one.tex +320 -0
- package/skills/venue-templates/assets/posters/beamerposter_academic.tex +312 -0
- package/skills/venue-templates/references/cell_press_style.md +486 -0
- package/skills/venue-templates/references/conferences_formatting.md +175 -0
- package/skills/venue-templates/references/cs_conference_style.md +465 -0
- package/skills/venue-templates/references/grants_requirements.md +267 -0
- package/skills/venue-templates/references/journals_formatting.md +200 -0
- package/skills/venue-templates/references/medical_journal_styles.md +536 -0
- package/skills/venue-templates/references/ml_conference_style.md +562 -0
- package/skills/venue-templates/references/nature_science_style.md +407 -0
- package/skills/venue-templates/references/posters_guidelines.md +630 -0
- package/skills/venue-templates/references/reviewer_expectations.md +422 -0
- package/skills/venue-templates/references/venue_writing_styles.md +323 -0
- package/skills/venue-templates/scripts/customize_template.py +206 -0
- package/skills/venue-templates/scripts/query_template.py +202 -0
- package/skills/venue-templates/scripts/validate_format.py +321 -0
- package/skills/verification-before-completion/SKILL.md +21 -0
- package/skills/waypoint-bio/SKILL.md +273 -0
- package/skills/waypoint-bio/references/cli-reference.md +210 -0
- package/skills/waypoint-bio/references/compass-benchmark.md +124 -0
- package/skills/waypoint-bio/references/data-preparation.md +200 -0
- package/skills/waypoint-bio/references/python-api.md +219 -0
- package/skills/waypoint-bio/scripts/profiler_to_waypoint.py +481 -0
- package/skills/waypoint-bio/scripts/vocab_coverage.py +235 -0
- package/skills/what-if-oracle/SKILL.md +184 -0
- package/skills/what-if-oracle/references/scenario-templates.md +137 -0
- package/skills/writing-plans/SKILL.md +15 -0
- package/skills/xlsx/LICENSE.txt +30 -0
- package/skills/xlsx/SKILL.md +110 -0
- package/skills/xlsx/scripts/office/helpers/__init__.py +111 -0
- package/skills/xlsx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/xlsx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/xlsx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/xlsx/scripts/office/soffice.py +232 -0
- package/skills/xlsx/scripts/office/validate.py +173 -0
- package/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/skills/xlsx/scripts/office/validators/base.py +875 -0
- package/skills/xlsx/scripts/office/validators/docx.py +466 -0
- package/skills/xlsx/scripts/office/validators/pptx.py +441 -0
- package/skills/xlsx/scripts/office/validators/redlining.py +299 -0
- package/skills/xlsx/scripts/recalc.py +308 -0
- package/skills/zarr-python/SKILL.md +241 -0
- package/skills/zarr-python/references/api_reference.md +162 -0
- package/skills/zarr-python/references/chunking_and_compression.md +138 -0
- package/skills/zarr-python/references/integration.md +147 -0
- package/skills/zarr-python/references/performance_and_patterns.md +198 -0
- package/skills/zarr-python/references/storage_backends.md +91 -0
- package/skills/zarr-python/references/v3_migration.md +127 -0
- package/templates/agents/orchestrator.md +37 -0
- package/templates/base/groupy_prompt.md +92 -0
- package/templates/compact/prompt.md +9 -0
- package/templates/compact/summary_prefix.md +1 -0
- package/templates/modes/default.md +19 -0
- package/templates/modes/plan.md +128 -0
- package/templates/modes/review.md +60 -0
- package/templates/permissions/approval_policy/never.md +1 -0
- package/templates/permissions/approval_policy/on_request.md +23 -0
- package/templates/permissions/sandbox_mode/danger_full_access.md +1 -0
- package/templates/permissions/sandbox_mode/read_only.md +1 -0
- package/templates/permissions/sandbox_mode/workspace_write.md +1 -0
- package/templates/personalities/friendly.md +19 -0
- package/templates/personalities/pragmatic.md +17 -0
|
@@ -0,0 +1,2087 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Bounded, provenance-preserving client for the NCATS Translator ARAX API."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import email.utils
|
|
8
|
+
import hashlib
|
|
9
|
+
import ipaddress
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import re
|
|
13
|
+
import socket
|
|
14
|
+
import sys
|
|
15
|
+
import tempfile
|
|
16
|
+
import time
|
|
17
|
+
import urllib.error
|
|
18
|
+
import urllib.parse
|
|
19
|
+
import urllib.request
|
|
20
|
+
import uuid
|
|
21
|
+
from dataclasses import dataclass
|
|
22
|
+
from datetime import datetime, timezone
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
from typing import Any, Callable, Iterable, Mapping, Sequence
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
CLIENT_NAME = "ncats-arax"
|
|
28
|
+
CLIENT_VERSION = "1.0"
|
|
29
|
+
USER_AGENT = "scientific-agent-skills-ncats-arax/1.0"
|
|
30
|
+
SUBMITTER = "scientific-agent-skills-ncats-arax"
|
|
31
|
+
PRODUCTION_BASE_URL = "https://arax.transltr.io/api/arax/v1.4"
|
|
32
|
+
TESTED_ARAX_VERSION = "1.5.4"
|
|
33
|
+
TESTED_TRAPI_VERSION = "1.5.0"
|
|
34
|
+
SUPPORTED_TRAPI_SERIES = {"1.5", "1.6"}
|
|
35
|
+
|
|
36
|
+
GET_TIMEOUT_SECONDS = 30
|
|
37
|
+
LOOKUP_TIMEOUT_SECONDS = 120
|
|
38
|
+
FEDERATED_TIMEOUT_SECONDS = 180
|
|
39
|
+
KP_TIMEOUT_SECONDS = 30
|
|
40
|
+
LOOKUP_RESULT_LIMIT = 20
|
|
41
|
+
FEDERATED_RESULT_LIMIT = 50
|
|
42
|
+
MAX_RESULT_LIMIT = 50
|
|
43
|
+
MAX_PROVIDERS = 5
|
|
44
|
+
MIN_FEDERATED_PROVIDERS = 2
|
|
45
|
+
MAX_PREDICATES = 5
|
|
46
|
+
MAX_QUALIFIERS = 6
|
|
47
|
+
MAX_IDENTIFIER_LENGTH = 200
|
|
48
|
+
MAX_RESPONSE_BYTES = 25 * 1024 * 1024
|
|
49
|
+
MAX_WARNING_MESSAGE = 500
|
|
50
|
+
MAX_DISPLAY_TEXT = 500
|
|
51
|
+
PUBLICATION_PREVIEW = 10
|
|
52
|
+
|
|
53
|
+
RETRYABLE_GET_STATUS = {429, 502, 503, 504}
|
|
54
|
+
CURIE_RE = re.compile(r"^[A-Za-z][A-Za-z0-9._-]*:[^\s]+$")
|
|
55
|
+
BIOLINK_RE = re.compile(r"^biolink:[A-Za-z][A-Za-z0-9._-]*$")
|
|
56
|
+
PROVIDER_RE = re.compile(r"^infores:[A-Za-z0-9._-]+$")
|
|
57
|
+
TRAPI_VERSION_RE = re.compile(r"\bTRAPI\s+(\d+\.\d+(?:\.\d+)?)\b", re.IGNORECASE)
|
|
58
|
+
EXPAND_RE = re.compile(
|
|
59
|
+
r"^expand\(edge_key=(e[01]),kp=(.+),kp_timeout=30,"
|
|
60
|
+
r"return_minimal_metadata=false\)$"
|
|
61
|
+
)
|
|
62
|
+
FILTER_RE = re.compile(
|
|
63
|
+
r"^filter_results\(action=limit_number_of_results,max_results=(\d+),"
|
|
64
|
+
r"prune_kg=true\)$"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
WARNING_CODES = {
|
|
68
|
+
"PUBLIC_QUERY",
|
|
69
|
+
"NORMALIZATION_REQUIRES_CONFIRMATION",
|
|
70
|
+
"NORMALIZATION_CATEGORY_MISMATCH",
|
|
71
|
+
"NO_RESULTS",
|
|
72
|
+
"NO_PUBLICATIONS_RETURNED",
|
|
73
|
+
"NO_PRIMARY_SOURCE_RETURNED",
|
|
74
|
+
"UNSCORED_RESPONSE_ORDER",
|
|
75
|
+
"RESULT_LIMIT_REACHED",
|
|
76
|
+
"INTERNAL_PRUNING_DETECTED",
|
|
77
|
+
"KP_TIMEOUT",
|
|
78
|
+
"KP_ERROR",
|
|
79
|
+
"MALFORMED_KP_RESPONSE",
|
|
80
|
+
"MISSING_AUXILIARY_GRAPH",
|
|
81
|
+
"REVERSED_EDGE_BINDING",
|
|
82
|
+
"UNTESTED_SERVICE_VERSION",
|
|
83
|
+
"NONPRODUCTION_ENDPOINT",
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class AraxClientError(Exception):
|
|
88
|
+
"""Base error carrying the documented CLI exit classification."""
|
|
89
|
+
|
|
90
|
+
def __init__(
|
|
91
|
+
self,
|
|
92
|
+
message: str,
|
|
93
|
+
*,
|
|
94
|
+
exit_code: int,
|
|
95
|
+
kind: str,
|
|
96
|
+
http_status: int | None = None,
|
|
97
|
+
response_body: bytes | None = None,
|
|
98
|
+
attempts: int = 0,
|
|
99
|
+
) -> None:
|
|
100
|
+
super().__init__(message)
|
|
101
|
+
self.exit_code = exit_code
|
|
102
|
+
self.kind = kind
|
|
103
|
+
self.http_status = http_status
|
|
104
|
+
self.response_body = response_body
|
|
105
|
+
self.attempts = attempts
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class UsageError(AraxClientError):
|
|
109
|
+
def __init__(self, message: str) -> None:
|
|
110
|
+
super().__init__(message, exit_code=2, kind="invalid_input")
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class PreflightError(AraxClientError):
|
|
114
|
+
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
115
|
+
super().__init__(message, exit_code=3, kind="preflight", **kwargs)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class NormalizationError(AraxClientError):
|
|
119
|
+
def __init__(self, message: str) -> None:
|
|
120
|
+
super().__init__(message, exit_code=4, kind="normalization_no_result")
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class TransportError(AraxClientError):
|
|
124
|
+
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
125
|
+
super().__init__(message, exit_code=5, kind="transport_or_http", **kwargs)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class ResponseError(AraxClientError):
|
|
129
|
+
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
130
|
+
super().__init__(message, exit_code=6, kind="invalid_response", **kwargs)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
@dataclass(frozen=True)
|
|
134
|
+
class HttpResult:
|
|
135
|
+
status: int
|
|
136
|
+
body: bytes
|
|
137
|
+
headers: dict[str, str]
|
|
138
|
+
elapsed_ms: int
|
|
139
|
+
attempts: int
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
@dataclass(frozen=True)
|
|
143
|
+
class ServiceInfo:
|
|
144
|
+
base_url: str
|
|
145
|
+
openapi_url: str
|
|
146
|
+
arax_version: str | None
|
|
147
|
+
trapi_version: str | None
|
|
148
|
+
warnings: tuple[dict[str, Any], ...]
|
|
149
|
+
|
|
150
|
+
def as_dict(self, *, biolink_version: str | None = None) -> dict[str, Any]:
|
|
151
|
+
return {
|
|
152
|
+
"base_url": self.base_url,
|
|
153
|
+
"openapi_url": self.openapi_url,
|
|
154
|
+
"arax_version": self.arax_version,
|
|
155
|
+
"trapi_version": self.trapi_version,
|
|
156
|
+
"biolink_version": biolink_version,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
@dataclass(frozen=True)
|
|
161
|
+
class QueryContract:
|
|
162
|
+
kind: str
|
|
163
|
+
mode: str
|
|
164
|
+
provider_ids: tuple[str, ...]
|
|
165
|
+
expand_order: str | None
|
|
166
|
+
qnode_ids: dict[str, list[str]]
|
|
167
|
+
result_limit: int
|
|
168
|
+
query_edges: dict[str, tuple[str, str]]
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class RejectRepeatedValueAction(argparse.Action):
|
|
172
|
+
"""Reject repeated scalar flags instead of silently accepting the last value."""
|
|
173
|
+
|
|
174
|
+
def __call__(
|
|
175
|
+
self,
|
|
176
|
+
parser: argparse.ArgumentParser,
|
|
177
|
+
namespace: argparse.Namespace,
|
|
178
|
+
values: Any,
|
|
179
|
+
option_string: str | None = None,
|
|
180
|
+
) -> None:
|
|
181
|
+
if getattr(namespace, self.dest, None) is not None:
|
|
182
|
+
parser.error(f"{option_string} may be supplied only once")
|
|
183
|
+
setattr(namespace, self.dest, values)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def _sanitize_text(value: Any, limit: int = MAX_DISPLAY_TEXT) -> str:
|
|
187
|
+
text = str(value)
|
|
188
|
+
text = "".join(" " if ord(char) < 32 or ord(char) == 127 else char for char in text)
|
|
189
|
+
text = " ".join(text.split())
|
|
190
|
+
if len(text) > limit:
|
|
191
|
+
return text[: max(0, limit - 1)] + "…"
|
|
192
|
+
return text
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def make_warning(
|
|
196
|
+
code: str,
|
|
197
|
+
message: str,
|
|
198
|
+
context: Mapping[str, Any] | None = None,
|
|
199
|
+
) -> dict[str, Any]:
|
|
200
|
+
if code not in WARNING_CODES:
|
|
201
|
+
raise ValueError(f"unknown warning code: {code}")
|
|
202
|
+
safe_context: dict[str, Any] = {}
|
|
203
|
+
for key, value in (context or {}).items():
|
|
204
|
+
if value is None or isinstance(value, (bool, int, float)):
|
|
205
|
+
safe_context[str(key)] = value
|
|
206
|
+
else:
|
|
207
|
+
safe_context[str(key)] = _sanitize_text(value, 200)
|
|
208
|
+
return {
|
|
209
|
+
"code": code,
|
|
210
|
+
"message": _sanitize_text(message, MAX_WARNING_MESSAGE),
|
|
211
|
+
"context": safe_context,
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def _append_warning(
|
|
216
|
+
warnings: list[dict[str, Any]],
|
|
217
|
+
code: str,
|
|
218
|
+
message: str,
|
|
219
|
+
context: Mapping[str, Any] | None = None,
|
|
220
|
+
) -> None:
|
|
221
|
+
warning = make_warning(code, message, context)
|
|
222
|
+
identity = (warning["code"], json.dumps(warning["context"], sort_keys=True), warning["message"])
|
|
223
|
+
existing = {
|
|
224
|
+
(item.get("code"), json.dumps(item.get("context", {}), sort_keys=True), item.get("message"))
|
|
225
|
+
for item in warnings
|
|
226
|
+
}
|
|
227
|
+
if identity not in existing:
|
|
228
|
+
warnings.append(warning)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def _has_control(value: str) -> bool:
|
|
232
|
+
return any(ord(char) < 32 or ord(char) == 127 for char in value)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def validate_curie(value: str) -> str:
|
|
236
|
+
if not isinstance(value, str) or not value or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
237
|
+
raise UsageError("CURIE must be a nonempty string of at most 200 characters")
|
|
238
|
+
if _has_control(value) or not CURIE_RE.fullmatch(value):
|
|
239
|
+
raise UsageError(f"invalid CURIE: {_sanitize_text(value, 80)}")
|
|
240
|
+
return value
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def _looks_like_curie(value: str) -> bool:
|
|
244
|
+
try:
|
|
245
|
+
validate_curie(value)
|
|
246
|
+
except UsageError:
|
|
247
|
+
return False
|
|
248
|
+
return True
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def validate_biolink_term(value: str, label: str = "Biolink term") -> str:
|
|
252
|
+
if not isinstance(value, str) or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
253
|
+
raise UsageError(f"{label} must be at most 200 characters")
|
|
254
|
+
if _has_control(value) or not BIOLINK_RE.fullmatch(value):
|
|
255
|
+
raise UsageError(f"invalid {label.lower()}: {_sanitize_text(value, 80)}")
|
|
256
|
+
return value
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def validate_provider_id(value: str) -> str:
|
|
260
|
+
if not isinstance(value, str) or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
261
|
+
raise UsageError("provider identifier must be at most 200 characters")
|
|
262
|
+
if _has_control(value) or not PROVIDER_RE.fullmatch(value):
|
|
263
|
+
raise UsageError(f"invalid provider identifier: {_sanitize_text(value, 80)}")
|
|
264
|
+
if value.lower() == "infores:all":
|
|
265
|
+
raise UsageError("all-provider federation is not supported")
|
|
266
|
+
return value
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def _unique(values: Sequence[str], label: str) -> list[str]:
|
|
270
|
+
if len(set(values)) != len(values):
|
|
271
|
+
raise UsageError(f"duplicate {label} values are not allowed")
|
|
272
|
+
return list(values)
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def validate_predicates(values: Sequence[str]) -> list[str]:
|
|
276
|
+
if not 1 <= len(values) <= MAX_PREDICATES:
|
|
277
|
+
raise UsageError("each query edge requires one to five predicates")
|
|
278
|
+
return _unique([validate_biolink_term(value, "Biolink predicate") for value in values], "predicate")
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def parse_qualifiers(values: Sequence[str]) -> list[tuple[str, str]]:
|
|
282
|
+
if len(values) > MAX_QUALIFIERS:
|
|
283
|
+
raise UsageError("each query edge accepts at most six qualifiers")
|
|
284
|
+
parsed: list[tuple[str, str]] = []
|
|
285
|
+
seen_types: set[str] = set()
|
|
286
|
+
for raw in values:
|
|
287
|
+
if "=" not in raw:
|
|
288
|
+
raise UsageError("qualifiers must use TYPE=VALUE")
|
|
289
|
+
qualifier_type, qualifier_value = raw.split("=", 1)
|
|
290
|
+
validate_biolink_term(qualifier_type, "Biolink qualifier type")
|
|
291
|
+
if (
|
|
292
|
+
not qualifier_value
|
|
293
|
+
or len(qualifier_value) > MAX_IDENTIFIER_LENGTH
|
|
294
|
+
or _has_control(qualifier_value)
|
|
295
|
+
):
|
|
296
|
+
raise UsageError("qualifier values must be nonempty, control-free, and at most 200 characters")
|
|
297
|
+
if qualifier_type in seen_types:
|
|
298
|
+
raise UsageError("a qualifier type may appear only once per edge")
|
|
299
|
+
seen_types.add(qualifier_type)
|
|
300
|
+
parsed.append((qualifier_type, qualifier_value))
|
|
301
|
+
return parsed
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def validate_result_limit(value: int) -> int:
|
|
305
|
+
if not 1 <= value <= MAX_RESULT_LIMIT:
|
|
306
|
+
raise UsageError("result limit must be between 1 and 50")
|
|
307
|
+
return value
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
def validate_base_url(value: str, allow_nonproduction: bool) -> tuple[str, list[dict[str, Any]]]:
|
|
311
|
+
raw = value.rstrip("/")
|
|
312
|
+
parts = urllib.parse.urlsplit(raw)
|
|
313
|
+
try:
|
|
314
|
+
parts.port
|
|
315
|
+
except ValueError as exc:
|
|
316
|
+
raise UsageError("base URL contains an invalid port") from exc
|
|
317
|
+
if parts.scheme.lower() != "https" or not parts.hostname:
|
|
318
|
+
raise UsageError("base URL must be an absolute HTTPS URL")
|
|
319
|
+
if parts.username or parts.password or parts.query or parts.fragment:
|
|
320
|
+
raise UsageError("base URL may not contain credentials, a query string, or a fragment")
|
|
321
|
+
hostname = parts.hostname.lower()
|
|
322
|
+
if hostname == "localhost" or hostname.endswith(".localhost"):
|
|
323
|
+
raise UsageError("localhost endpoints are not allowed")
|
|
324
|
+
try:
|
|
325
|
+
address = ipaddress.ip_address(hostname)
|
|
326
|
+
except ValueError:
|
|
327
|
+
address = None
|
|
328
|
+
if address is not None and not address.is_global:
|
|
329
|
+
raise UsageError("private, loopback, link-local, and reserved endpoint addresses are not allowed")
|
|
330
|
+
normalized = urllib.parse.urlunsplit(("https", parts.netloc, parts.path.rstrip("/"), "", ""))
|
|
331
|
+
warnings: list[dict[str, Any]] = []
|
|
332
|
+
if normalized != PRODUCTION_BASE_URL:
|
|
333
|
+
if not allow_nonproduction:
|
|
334
|
+
raise PreflightError(
|
|
335
|
+
"nonproduction endpoint requires --allow-nonproduction-endpoint"
|
|
336
|
+
)
|
|
337
|
+
_append_warning(
|
|
338
|
+
warnings,
|
|
339
|
+
"NONPRODUCTION_ENDPOINT",
|
|
340
|
+
"An explicitly selected nonproduction ARAX endpoint is in use.",
|
|
341
|
+
{"base_url": normalized},
|
|
342
|
+
)
|
|
343
|
+
return normalized, warnings
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def resolve_mode(
|
|
347
|
+
mode: str,
|
|
348
|
+
provider_values: Sequence[str],
|
|
349
|
+
result_limit: int | None,
|
|
350
|
+
) -> tuple[list[str], int]:
|
|
351
|
+
if mode == "lookup":
|
|
352
|
+
if provider_values:
|
|
353
|
+
raise UsageError("--kp is allowed only with --mode federated")
|
|
354
|
+
providers = ["infores:rtx-kg2"]
|
|
355
|
+
limit = LOOKUP_RESULT_LIMIT if result_limit is None else result_limit
|
|
356
|
+
elif mode == "federated":
|
|
357
|
+
providers = _unique([validate_provider_id(value) for value in provider_values], "provider")
|
|
358
|
+
if not MIN_FEDERATED_PROVIDERS <= len(providers) <= MAX_PROVIDERS:
|
|
359
|
+
raise UsageError("federated mode requires two to five explicit providers")
|
|
360
|
+
limit = FEDERATED_RESULT_LIMIT if result_limit is None else result_limit
|
|
361
|
+
else:
|
|
362
|
+
raise UsageError(f"unsupported mode: {mode}")
|
|
363
|
+
return providers, validate_result_limit(limit)
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def build_query_edge(
|
|
367
|
+
subject: str,
|
|
368
|
+
object_: str,
|
|
369
|
+
predicates: Sequence[str],
|
|
370
|
+
qualifiers: Sequence[tuple[str, str]],
|
|
371
|
+
) -> dict[str, Any]:
|
|
372
|
+
edge: dict[str, Any] = {
|
|
373
|
+
"subject": subject,
|
|
374
|
+
"object": object_,
|
|
375
|
+
"predicates": list(predicates),
|
|
376
|
+
}
|
|
377
|
+
if qualifiers:
|
|
378
|
+
edge["qualifier_constraints"] = [
|
|
379
|
+
{
|
|
380
|
+
"qualifier_set": [
|
|
381
|
+
{"qualifier_type_id": qualifier_type, "qualifier_value": qualifier_value}
|
|
382
|
+
for qualifier_type, qualifier_value in qualifiers
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
return edge
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def _provider_parameter(mode: str, provider_ids: Sequence[str]) -> str:
|
|
390
|
+
if mode == "lookup":
|
|
391
|
+
return "infores:rtx-kg2"
|
|
392
|
+
return "[" + ",".join(provider_ids) + "]"
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def build_operations(
|
|
396
|
+
edge_keys: Sequence[str],
|
|
397
|
+
mode: str,
|
|
398
|
+
provider_ids: Sequence[str],
|
|
399
|
+
result_limit: int,
|
|
400
|
+
) -> dict[str, list[str]]:
|
|
401
|
+
kp_value = _provider_parameter(mode, provider_ids)
|
|
402
|
+
actions = [
|
|
403
|
+
f"expand(edge_key={edge_key},kp={kp_value},kp_timeout={KP_TIMEOUT_SECONDS},"
|
|
404
|
+
"return_minimal_metadata=false)"
|
|
405
|
+
for edge_key in edge_keys
|
|
406
|
+
]
|
|
407
|
+
actions.extend(
|
|
408
|
+
[
|
|
409
|
+
"scoreless_resultify(ignore_edge_direction=true)",
|
|
410
|
+
f"filter_results(action=limit_number_of_results,max_results={result_limit},prune_kg=true)",
|
|
411
|
+
"return(response=true,store=false)",
|
|
412
|
+
]
|
|
413
|
+
)
|
|
414
|
+
return {"actions": actions}
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def build_one_hop_query(
|
|
418
|
+
*,
|
|
419
|
+
subject_id: str | None,
|
|
420
|
+
subject_category: str,
|
|
421
|
+
predicates: Sequence[str],
|
|
422
|
+
object_id: str | None,
|
|
423
|
+
object_category: str,
|
|
424
|
+
qualifiers: Sequence[tuple[str, str]],
|
|
425
|
+
mode: str,
|
|
426
|
+
provider_ids: Sequence[str],
|
|
427
|
+
result_limit: int,
|
|
428
|
+
) -> dict[str, Any]:
|
|
429
|
+
if subject_id is None and object_id is None:
|
|
430
|
+
raise UsageError("one-hop queries require at least one pinned endpoint")
|
|
431
|
+
nodes: dict[str, dict[str, Any]] = {
|
|
432
|
+
"n0": {"categories": [validate_biolink_term(subject_category, "Biolink category")]},
|
|
433
|
+
"n1": {"categories": [validate_biolink_term(object_category, "Biolink category")]},
|
|
434
|
+
}
|
|
435
|
+
if subject_id is not None:
|
|
436
|
+
nodes["n0"]["ids"] = [validate_curie(subject_id)]
|
|
437
|
+
if object_id is not None:
|
|
438
|
+
nodes["n1"]["ids"] = [validate_curie(object_id)]
|
|
439
|
+
body = {
|
|
440
|
+
"message": {
|
|
441
|
+
"query_graph": {
|
|
442
|
+
"nodes": nodes,
|
|
443
|
+
"edges": {
|
|
444
|
+
"e0": build_query_edge("n0", "n1", validate_predicates(predicates), qualifiers)
|
|
445
|
+
},
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"operations": build_operations(["e0"], mode, provider_ids, result_limit),
|
|
449
|
+
"stream_progress": False,
|
|
450
|
+
"submitter": SUBMITTER,
|
|
451
|
+
}
|
|
452
|
+
return body
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def build_two_hop_query(
|
|
456
|
+
*,
|
|
457
|
+
subject_id: str,
|
|
458
|
+
subject_category: str,
|
|
459
|
+
predicates_1: Sequence[str],
|
|
460
|
+
intermediate_category: str,
|
|
461
|
+
predicates_2: Sequence[str],
|
|
462
|
+
object_id: str,
|
|
463
|
+
object_category: str,
|
|
464
|
+
qualifiers_1: Sequence[tuple[str, str]],
|
|
465
|
+
qualifiers_2: Sequence[tuple[str, str]],
|
|
466
|
+
mode: str,
|
|
467
|
+
provider_ids: Sequence[str],
|
|
468
|
+
expand_order: str,
|
|
469
|
+
result_limit: int,
|
|
470
|
+
) -> dict[str, Any]:
|
|
471
|
+
if expand_order not in {"right-first", "left-first"}:
|
|
472
|
+
raise UsageError("expand order must be right-first or left-first")
|
|
473
|
+
nodes = {
|
|
474
|
+
"n0": {
|
|
475
|
+
"ids": [validate_curie(subject_id)],
|
|
476
|
+
"categories": [validate_biolink_term(subject_category, "Biolink category")],
|
|
477
|
+
},
|
|
478
|
+
"n1": {
|
|
479
|
+
"categories": [validate_biolink_term(intermediate_category, "Biolink category")]
|
|
480
|
+
},
|
|
481
|
+
"n2": {
|
|
482
|
+
"ids": [validate_curie(object_id)],
|
|
483
|
+
"categories": [validate_biolink_term(object_category, "Biolink category")],
|
|
484
|
+
},
|
|
485
|
+
}
|
|
486
|
+
edge_order = ["e1", "e0"] if expand_order == "right-first" else ["e0", "e1"]
|
|
487
|
+
return {
|
|
488
|
+
"message": {
|
|
489
|
+
"query_graph": {
|
|
490
|
+
"nodes": nodes,
|
|
491
|
+
"edges": {
|
|
492
|
+
"e0": build_query_edge(
|
|
493
|
+
"n0", "n1", validate_predicates(predicates_1), qualifiers_1
|
|
494
|
+
),
|
|
495
|
+
"e1": build_query_edge(
|
|
496
|
+
"n1", "n2", validate_predicates(predicates_2), qualifiers_2
|
|
497
|
+
),
|
|
498
|
+
},
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
"operations": build_operations(edge_order, mode, provider_ids, result_limit),
|
|
502
|
+
"stream_progress": False,
|
|
503
|
+
"submitter": SUBMITTER,
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def serialize_request(body: Mapping[str, Any]) -> bytes:
|
|
508
|
+
try:
|
|
509
|
+
return json.dumps(
|
|
510
|
+
body,
|
|
511
|
+
sort_keys=True,
|
|
512
|
+
separators=(",", ":"),
|
|
513
|
+
ensure_ascii=False,
|
|
514
|
+
allow_nan=False,
|
|
515
|
+
).encode("utf-8")
|
|
516
|
+
except (TypeError, ValueError) as exc:
|
|
517
|
+
raise UsageError("request contains a value that cannot be represented as strict JSON") from exc
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
def _origin(url: str) -> tuple[str, str | None, int | None]:
|
|
521
|
+
parts = urllib.parse.urlsplit(url)
|
|
522
|
+
try:
|
|
523
|
+
port = parts.port
|
|
524
|
+
except ValueError as exc:
|
|
525
|
+
raise ValueError("URL contains an invalid port") from exc
|
|
526
|
+
if port is None and parts.scheme.lower() == "https":
|
|
527
|
+
port = 443
|
|
528
|
+
return parts.scheme.lower(), parts.hostname.lower() if parts.hostname else None, port
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
class SameOriginHttpsRedirectHandler(urllib.request.HTTPRedirectHandler):
|
|
532
|
+
def redirect_request(
|
|
533
|
+
self,
|
|
534
|
+
req: urllib.request.Request,
|
|
535
|
+
fp: Any,
|
|
536
|
+
code: int,
|
|
537
|
+
msg: str,
|
|
538
|
+
headers: Any,
|
|
539
|
+
newurl: str,
|
|
540
|
+
) -> urllib.request.Request | None:
|
|
541
|
+
try:
|
|
542
|
+
original_origin = _origin(req.full_url)
|
|
543
|
+
redirect_origin = _origin(newurl)
|
|
544
|
+
except ValueError:
|
|
545
|
+
original_origin = _origin(req.full_url)
|
|
546
|
+
redirect_origin = ("", None, None)
|
|
547
|
+
if original_origin != redirect_origin or redirect_origin[0] != "https":
|
|
548
|
+
raise urllib.error.HTTPError(
|
|
549
|
+
newurl,
|
|
550
|
+
code,
|
|
551
|
+
"cross-origin or protocol-downgrade redirect rejected",
|
|
552
|
+
headers,
|
|
553
|
+
fp,
|
|
554
|
+
)
|
|
555
|
+
return super().redirect_request(req, fp, code, msg, headers, newurl)
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
def _open_url(request: urllib.request.Request, timeout: int) -> Any:
|
|
559
|
+
opener = urllib.request.build_opener(SameOriginHttpsRedirectHandler())
|
|
560
|
+
return opener.open(request, timeout=timeout)
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
def read_bounded_response(response: Any, byte_limit: int = MAX_RESPONSE_BYTES) -> bytes:
|
|
564
|
+
body = response.read(byte_limit + 1)
|
|
565
|
+
if len(body) > byte_limit:
|
|
566
|
+
raise ResponseError("response exceeded the 25 MiB byte limit")
|
|
567
|
+
return body
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
def _response_status(response: Any) -> int:
|
|
571
|
+
status = getattr(response, "status", None)
|
|
572
|
+
return int(status if status is not None else response.getcode())
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def _headers_dict(headers: Any) -> dict[str, str]:
|
|
576
|
+
if headers is None:
|
|
577
|
+
return {}
|
|
578
|
+
try:
|
|
579
|
+
return {str(key): str(value) for key, value in headers.items()}
|
|
580
|
+
except AttributeError:
|
|
581
|
+
return {}
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def _retry_delay(headers: Mapping[str, str], now: Callable[[], datetime] | None = None) -> float:
|
|
585
|
+
raw = next((value for key, value in headers.items() if key.lower() == "retry-after"), None)
|
|
586
|
+
if raw is None:
|
|
587
|
+
return 1.0
|
|
588
|
+
try:
|
|
589
|
+
return min(10.0, max(0.0, float(raw)))
|
|
590
|
+
except ValueError:
|
|
591
|
+
try:
|
|
592
|
+
parsed = email.utils.parsedate_to_datetime(raw)
|
|
593
|
+
current = (now or (lambda: datetime.now(timezone.utc)))()
|
|
594
|
+
if parsed.tzinfo is None:
|
|
595
|
+
parsed = parsed.replace(tzinfo=timezone.utc)
|
|
596
|
+
return min(10.0, max(0.0, (parsed - current).total_seconds()))
|
|
597
|
+
except (TypeError, ValueError, OverflowError):
|
|
598
|
+
return 1.0
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
def _is_timeout_error(error: BaseException) -> bool:
|
|
602
|
+
if isinstance(error, (TimeoutError, socket.timeout)):
|
|
603
|
+
return True
|
|
604
|
+
return isinstance(error, urllib.error.URLError) and isinstance(
|
|
605
|
+
getattr(error, "reason", None), (TimeoutError, socket.timeout)
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
def request_get_with_retry(
|
|
610
|
+
url: str,
|
|
611
|
+
*,
|
|
612
|
+
timeout: int = GET_TIMEOUT_SECONDS,
|
|
613
|
+
sleep: Callable[[float], None] = time.sleep,
|
|
614
|
+
) -> HttpResult:
|
|
615
|
+
request = urllib.request.Request(
|
|
616
|
+
url,
|
|
617
|
+
method="GET",
|
|
618
|
+
headers={
|
|
619
|
+
"Accept": "application/json",
|
|
620
|
+
"Accept-Encoding": "identity",
|
|
621
|
+
"User-Agent": USER_AGENT,
|
|
622
|
+
},
|
|
623
|
+
)
|
|
624
|
+
started = time.monotonic()
|
|
625
|
+
for attempt in (1, 2):
|
|
626
|
+
try:
|
|
627
|
+
with _open_url(request, timeout) as response:
|
|
628
|
+
try:
|
|
629
|
+
body = read_bounded_response(response)
|
|
630
|
+
except ResponseError as exc:
|
|
631
|
+
exc.attempts = attempt
|
|
632
|
+
exc.http_status = _response_status(response)
|
|
633
|
+
raise
|
|
634
|
+
return HttpResult(
|
|
635
|
+
status=_response_status(response),
|
|
636
|
+
body=body,
|
|
637
|
+
headers=_headers_dict(getattr(response, "headers", None)),
|
|
638
|
+
elapsed_ms=round((time.monotonic() - started) * 1000),
|
|
639
|
+
attempts=attempt,
|
|
640
|
+
)
|
|
641
|
+
except urllib.error.HTTPError as exc:
|
|
642
|
+
headers = _headers_dict(exc.headers)
|
|
643
|
+
if exc.code in RETRYABLE_GET_STATUS and attempt == 1:
|
|
644
|
+
try:
|
|
645
|
+
exc.close()
|
|
646
|
+
finally:
|
|
647
|
+
sleep(_retry_delay(headers))
|
|
648
|
+
continue
|
|
649
|
+
try:
|
|
650
|
+
body = read_bounded_response(exc)
|
|
651
|
+
except ResponseError as oversized:
|
|
652
|
+
oversized.http_status = exc.code
|
|
653
|
+
oversized.attempts = attempt
|
|
654
|
+
raise oversized from exc
|
|
655
|
+
raise TransportError(
|
|
656
|
+
f"GET failed with HTTP {exc.code}",
|
|
657
|
+
http_status=exc.code,
|
|
658
|
+
response_body=body,
|
|
659
|
+
attempts=attempt,
|
|
660
|
+
) from exc
|
|
661
|
+
except (urllib.error.URLError, TimeoutError, socket.timeout) as exc:
|
|
662
|
+
if _is_timeout_error(exc) and attempt == 1:
|
|
663
|
+
sleep(1.0)
|
|
664
|
+
continue
|
|
665
|
+
raise TransportError(f"GET transport failure: {_sanitize_text(exc)}", attempts=attempt) from exc
|
|
666
|
+
raise AssertionError("unreachable")
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
def post_query(url: str, request_bytes: bytes, *, timeout: int) -> HttpResult:
|
|
670
|
+
request = urllib.request.Request(
|
|
671
|
+
url,
|
|
672
|
+
data=request_bytes,
|
|
673
|
+
method="POST",
|
|
674
|
+
headers={
|
|
675
|
+
"Accept": "application/json",
|
|
676
|
+
"Accept-Encoding": "identity",
|
|
677
|
+
"Content-Type": "application/json",
|
|
678
|
+
"User-Agent": USER_AGENT,
|
|
679
|
+
},
|
|
680
|
+
)
|
|
681
|
+
started = time.monotonic()
|
|
682
|
+
try:
|
|
683
|
+
with _open_url(request, timeout) as response:
|
|
684
|
+
try:
|
|
685
|
+
body = read_bounded_response(response)
|
|
686
|
+
except ResponseError as exc:
|
|
687
|
+
exc.attempts = 1
|
|
688
|
+
exc.http_status = _response_status(response)
|
|
689
|
+
raise
|
|
690
|
+
return HttpResult(
|
|
691
|
+
status=_response_status(response),
|
|
692
|
+
body=body,
|
|
693
|
+
headers=_headers_dict(getattr(response, "headers", None)),
|
|
694
|
+
elapsed_ms=round((time.monotonic() - started) * 1000),
|
|
695
|
+
attempts=1,
|
|
696
|
+
)
|
|
697
|
+
except urllib.error.HTTPError as exc:
|
|
698
|
+
try:
|
|
699
|
+
body = read_bounded_response(exc)
|
|
700
|
+
except ResponseError as oversized:
|
|
701
|
+
oversized.http_status = exc.code
|
|
702
|
+
oversized.attempts = 1
|
|
703
|
+
raise oversized from exc
|
|
704
|
+
raise TransportError(
|
|
705
|
+
f"POST failed with HTTP {exc.code}",
|
|
706
|
+
http_status=exc.code,
|
|
707
|
+
response_body=body,
|
|
708
|
+
attempts=1,
|
|
709
|
+
) from exc
|
|
710
|
+
except ResponseError:
|
|
711
|
+
raise
|
|
712
|
+
except (urllib.error.URLError, TimeoutError, socket.timeout) as exc:
|
|
713
|
+
raise TransportError(f"POST transport failure: {_sanitize_text(exc)}", attempts=1) from exc
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
def _decode_json(body: bytes, label: str) -> Any:
|
|
717
|
+
def reject_constant(value: str) -> None:
|
|
718
|
+
raise ValueError(f"non-finite JSON number: {value}")
|
|
719
|
+
|
|
720
|
+
try:
|
|
721
|
+
return json.loads(body.decode("utf-8"), parse_constant=reject_constant)
|
|
722
|
+
except (UnicodeDecodeError, json.JSONDecodeError, ValueError) as exc:
|
|
723
|
+
raise ResponseError(f"{label} was not valid strict UTF-8 JSON") from exc
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
def _version_series(version: str | None) -> str | None:
|
|
727
|
+
if not version:
|
|
728
|
+
return None
|
|
729
|
+
parts = version.split(".")
|
|
730
|
+
if len(parts) < 2 or not all(part.isdigit() for part in parts[:2]):
|
|
731
|
+
return None
|
|
732
|
+
return ".".join(parts[:2])
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
def _check_trapi_version(
|
|
736
|
+
trapi_version: str | None,
|
|
737
|
+
allow_untested: bool,
|
|
738
|
+
warnings: list[dict[str, Any]],
|
|
739
|
+
) -> None:
|
|
740
|
+
series = _version_series(trapi_version)
|
|
741
|
+
if series not in SUPPORTED_TRAPI_SERIES and not allow_untested:
|
|
742
|
+
raise PreflightError(
|
|
743
|
+
"service reports an unknown or missing TRAPI series; use --allow-untested-version to continue"
|
|
744
|
+
)
|
|
745
|
+
if trapi_version != TESTED_TRAPI_VERSION:
|
|
746
|
+
_append_warning(
|
|
747
|
+
warnings,
|
|
748
|
+
"UNTESTED_SERVICE_VERSION",
|
|
749
|
+
"The service TRAPI version differs from the tested production version.",
|
|
750
|
+
{"reported": trapi_version, "tested": TESTED_TRAPI_VERSION},
|
|
751
|
+
)
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
def parse_openapi_service_info(
|
|
755
|
+
payload: Any,
|
|
756
|
+
*,
|
|
757
|
+
base_url: str,
|
|
758
|
+
openapi_url: str,
|
|
759
|
+
allow_untested_version: bool,
|
|
760
|
+
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
761
|
+
) -> ServiceInfo:
|
|
762
|
+
if not isinstance(payload, dict):
|
|
763
|
+
raise PreflightError("OpenAPI document is not an object")
|
|
764
|
+
info = payload.get("info")
|
|
765
|
+
paths = payload.get("paths")
|
|
766
|
+
if not isinstance(info, dict) or not isinstance(paths, dict):
|
|
767
|
+
raise PreflightError("OpenAPI document is missing info or paths")
|
|
768
|
+
title = info.get("title")
|
|
769
|
+
if not isinstance(title, str) or "arax" not in title.lower():
|
|
770
|
+
raise PreflightError("OpenAPI title does not identify ARAX")
|
|
771
|
+
if "/query" not in paths:
|
|
772
|
+
raise PreflightError("OpenAPI document does not expose /query")
|
|
773
|
+
version_match = TRAPI_VERSION_RE.search(title)
|
|
774
|
+
trapi_version = version_match.group(1) if version_match else None
|
|
775
|
+
arax_version = str(info["version"]) if info.get("version") is not None else None
|
|
776
|
+
warnings = list(initial_warnings)
|
|
777
|
+
_check_trapi_version(trapi_version, allow_untested_version, warnings)
|
|
778
|
+
if arax_version != TESTED_ARAX_VERSION:
|
|
779
|
+
_append_warning(
|
|
780
|
+
warnings,
|
|
781
|
+
"UNTESTED_SERVICE_VERSION",
|
|
782
|
+
"The ARAX version differs from the tested production version.",
|
|
783
|
+
{"reported": arax_version, "tested": TESTED_ARAX_VERSION},
|
|
784
|
+
)
|
|
785
|
+
return ServiceInfo(
|
|
786
|
+
base_url=base_url,
|
|
787
|
+
openapi_url=openapi_url,
|
|
788
|
+
arax_version=arax_version,
|
|
789
|
+
trapi_version=trapi_version,
|
|
790
|
+
warnings=tuple(warnings),
|
|
791
|
+
)
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
def fetch_openapi(
|
|
795
|
+
base_url: str,
|
|
796
|
+
*,
|
|
797
|
+
allow_untested_version: bool,
|
|
798
|
+
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
799
|
+
) -> tuple[ServiceInfo, HttpResult]:
|
|
800
|
+
openapi_url = base_url + "/openapi.json"
|
|
801
|
+
try:
|
|
802
|
+
result = request_get_with_retry(openapi_url)
|
|
803
|
+
except TransportError as exc:
|
|
804
|
+
raise PreflightError(
|
|
805
|
+
str(exc),
|
|
806
|
+
http_status=exc.http_status,
|
|
807
|
+
response_body=exc.response_body,
|
|
808
|
+
attempts=exc.attempts,
|
|
809
|
+
) from exc
|
|
810
|
+
try:
|
|
811
|
+
payload = _decode_json(result.body, "OpenAPI response")
|
|
812
|
+
service = parse_openapi_service_info(
|
|
813
|
+
payload,
|
|
814
|
+
base_url=base_url,
|
|
815
|
+
openapi_url=openapi_url,
|
|
816
|
+
allow_untested_version=allow_untested_version,
|
|
817
|
+
initial_warnings=initial_warnings,
|
|
818
|
+
)
|
|
819
|
+
except (PreflightError, ResponseError) as exc:
|
|
820
|
+
if isinstance(exc, ResponseError):
|
|
821
|
+
wrapped = PreflightError(str(exc))
|
|
822
|
+
else:
|
|
823
|
+
wrapped = exc
|
|
824
|
+
wrapped.http_status = result.status
|
|
825
|
+
wrapped.response_body = result.body
|
|
826
|
+
wrapped.attempts = result.attempts
|
|
827
|
+
raise wrapped
|
|
828
|
+
return service, result
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
def normalize_entity_request(base_url: str, term: str) -> HttpResult:
|
|
832
|
+
query = urllib.parse.urlencode({"q": term})
|
|
833
|
+
return request_get_with_retry(base_url + "/entity?" + query)
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
def parse_normalization_response(
|
|
837
|
+
payload: Any,
|
|
838
|
+
*,
|
|
839
|
+
term: str,
|
|
840
|
+
expected_category: str | None,
|
|
841
|
+
max_synonyms: int,
|
|
842
|
+
service: ServiceInfo,
|
|
843
|
+
) -> tuple[dict[str, Any], bool]:
|
|
844
|
+
warnings = [make_warning("PUBLIC_QUERY", "The normalization request was sent to a public service.")]
|
|
845
|
+
requires_confirmation = not _looks_like_curie(term)
|
|
846
|
+
if requires_confirmation:
|
|
847
|
+
_append_warning(
|
|
848
|
+
warnings,
|
|
849
|
+
"NORMALIZATION_REQUIRES_CONFIRMATION",
|
|
850
|
+
"Review the normalized identifier and category before constructing a graph query.",
|
|
851
|
+
)
|
|
852
|
+
record: Any = payload.get(term) if isinstance(payload, dict) else None
|
|
853
|
+
if record is None and isinstance(payload, dict) and len(payload) == 1:
|
|
854
|
+
record = next(iter(payload.values()))
|
|
855
|
+
usable = isinstance(record, dict) and isinstance(record.get("id"), dict)
|
|
856
|
+
identifier_record = record.get("id", {}) if usable else {}
|
|
857
|
+
identifier = identifier_record.get("identifier") if isinstance(identifier_record, dict) else None
|
|
858
|
+
if not isinstance(identifier, str) or not _looks_like_curie(identifier):
|
|
859
|
+
usable = False
|
|
860
|
+
identifier = None
|
|
861
|
+
category = identifier_record.get("category") if isinstance(identifier_record, dict) else None
|
|
862
|
+
if expected_category is not None and category != expected_category and usable:
|
|
863
|
+
_append_warning(
|
|
864
|
+
warnings,
|
|
865
|
+
"NORMALIZATION_CATEGORY_MISMATCH",
|
|
866
|
+
"The canonical category differs from the expected category.",
|
|
867
|
+
{"expected": expected_category, "returned": category},
|
|
868
|
+
)
|
|
869
|
+
nodes = record.get("nodes", []) if isinstance(record, dict) else []
|
|
870
|
+
preview: list[dict[str, Any]] = []
|
|
871
|
+
if isinstance(nodes, list):
|
|
872
|
+
for node in nodes[:max_synonyms]:
|
|
873
|
+
if not isinstance(node, dict):
|
|
874
|
+
continue
|
|
875
|
+
preview.append(
|
|
876
|
+
{
|
|
877
|
+
"identifier": node.get("identifier", node.get("id")),
|
|
878
|
+
"name": node.get("name"),
|
|
879
|
+
"category": node.get("category"),
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
if not usable:
|
|
883
|
+
_append_warning(
|
|
884
|
+
warnings,
|
|
885
|
+
"NO_RESULTS",
|
|
886
|
+
"Normalization returned no usable canonical CURIE.",
|
|
887
|
+
)
|
|
888
|
+
summary = {
|
|
889
|
+
"schema_version": "1.0",
|
|
890
|
+
"kind": "normalization",
|
|
891
|
+
"query": {
|
|
892
|
+
"input": term,
|
|
893
|
+
"expected_category": expected_category,
|
|
894
|
+
"requires_user_confirmation": requires_confirmation,
|
|
895
|
+
},
|
|
896
|
+
"service": service.as_dict(),
|
|
897
|
+
"canonical": {
|
|
898
|
+
"identifier": identifier,
|
|
899
|
+
"name": identifier_record.get("name") if isinstance(identifier_record, dict) else None,
|
|
900
|
+
"category": category,
|
|
901
|
+
},
|
|
902
|
+
"category_counts": record.get("categories", {}) if isinstance(record, dict) else {},
|
|
903
|
+
"total_synonyms": record.get("total_synonyms", 0) if isinstance(record, dict) else 0,
|
|
904
|
+
"synonym_preview": preview,
|
|
905
|
+
"warnings": warnings,
|
|
906
|
+
}
|
|
907
|
+
return summary, usable
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
def _require_exact_keys(value: Mapping[str, Any], allowed: set[str], label: str) -> None:
|
|
911
|
+
extras = set(value) - allowed
|
|
912
|
+
missing = allowed - set(value)
|
|
913
|
+
if extras or missing:
|
|
914
|
+
details: list[str] = []
|
|
915
|
+
if missing:
|
|
916
|
+
details.append("missing " + ", ".join(sorted(missing)))
|
|
917
|
+
if extras:
|
|
918
|
+
details.append("unsupported " + ", ".join(sorted(extras)))
|
|
919
|
+
raise UsageError(f"{label} has " + "; ".join(details))
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
def _validate_edge_contract(edge: Any) -> tuple[str, str]:
|
|
923
|
+
if not isinstance(edge, dict):
|
|
924
|
+
raise UsageError("saved request contains an invalid query edge")
|
|
925
|
+
allowed = {"subject", "object", "predicates"}
|
|
926
|
+
if "qualifier_constraints" in edge:
|
|
927
|
+
allowed.add("qualifier_constraints")
|
|
928
|
+
_require_exact_keys(edge, allowed, "saved query edge")
|
|
929
|
+
subject = edge.get("subject")
|
|
930
|
+
object_ = edge.get("object")
|
|
931
|
+
if not isinstance(subject, str) or not isinstance(object_, str):
|
|
932
|
+
raise UsageError("saved query edge lacks subject or object")
|
|
933
|
+
predicates = edge.get("predicates")
|
|
934
|
+
if not isinstance(predicates, list):
|
|
935
|
+
raise UsageError("saved query edge lacks predicates")
|
|
936
|
+
validate_predicates(predicates)
|
|
937
|
+
constraints = edge.get("qualifier_constraints")
|
|
938
|
+
if constraints is not None:
|
|
939
|
+
if not isinstance(constraints, list) or len(constraints) != 1:
|
|
940
|
+
raise UsageError("saved query edge must have one AND qualifier set")
|
|
941
|
+
if not isinstance(constraints[0], dict):
|
|
942
|
+
raise UsageError("saved query edge has invalid qualifiers")
|
|
943
|
+
_require_exact_keys(constraints[0], {"qualifier_set"}, "qualifier constraint")
|
|
944
|
+
qualifier_set = constraints[0].get("qualifier_set")
|
|
945
|
+
if not isinstance(qualifier_set, list):
|
|
946
|
+
raise UsageError("saved query edge has invalid qualifiers")
|
|
947
|
+
raw = []
|
|
948
|
+
for qualifier in qualifier_set:
|
|
949
|
+
if not isinstance(qualifier, dict):
|
|
950
|
+
raise UsageError("saved query edge has invalid qualifiers")
|
|
951
|
+
_require_exact_keys(
|
|
952
|
+
qualifier,
|
|
953
|
+
{"qualifier_type_id", "qualifier_value"},
|
|
954
|
+
"saved qualifier",
|
|
955
|
+
)
|
|
956
|
+
raw.append(f"{qualifier.get('qualifier_type_id')}={qualifier.get('qualifier_value')}")
|
|
957
|
+
parse_qualifiers(raw)
|
|
958
|
+
return subject, object_
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
def _parse_kp_parameter(value: str) -> tuple[str, tuple[str, ...]]:
|
|
962
|
+
if value == "infores:rtx-kg2":
|
|
963
|
+
return "lookup", (value,)
|
|
964
|
+
if not value.startswith("[") or not value.endswith("]"):
|
|
965
|
+
raise UsageError("saved request does not use lookup or selected-provider federation")
|
|
966
|
+
providers = tuple(validate_provider_id(item) for item in value[1:-1].split(",") if item)
|
|
967
|
+
if not MIN_FEDERATED_PROVIDERS <= len(providers) <= MAX_PROVIDERS:
|
|
968
|
+
raise UsageError("saved federated request must name two to five providers")
|
|
969
|
+
_unique(list(providers), "provider")
|
|
970
|
+
return "federated", providers
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
def validate_saved_request_contract(payload: Any) -> QueryContract:
|
|
974
|
+
if not isinstance(payload, dict) or "workflow" in payload:
|
|
975
|
+
raise UsageError("saved request is not a supported fixed-operation request")
|
|
976
|
+
_require_exact_keys(
|
|
977
|
+
payload,
|
|
978
|
+
{"message", "operations", "stream_progress", "submitter"},
|
|
979
|
+
"saved request",
|
|
980
|
+
)
|
|
981
|
+
if payload["stream_progress"] is not False or payload["submitter"] != SUBMITTER:
|
|
982
|
+
raise UsageError("saved request changes fixed submission controls")
|
|
983
|
+
message = payload.get("message")
|
|
984
|
+
if not isinstance(message, dict):
|
|
985
|
+
raise UsageError("saved request lacks a query graph")
|
|
986
|
+
_require_exact_keys(message, {"query_graph"}, "saved message")
|
|
987
|
+
graph = message.get("query_graph") if isinstance(message, dict) else None
|
|
988
|
+
if not isinstance(graph, dict):
|
|
989
|
+
raise UsageError("saved request lacks a query graph")
|
|
990
|
+
_require_exact_keys(graph, {"nodes", "edges"}, "saved query graph")
|
|
991
|
+
nodes = graph.get("nodes") if isinstance(graph, dict) else None
|
|
992
|
+
edges = graph.get("edges") if isinstance(graph, dict) else None
|
|
993
|
+
if not isinstance(nodes, dict) or not isinstance(edges, dict):
|
|
994
|
+
raise UsageError("saved request lacks a query graph")
|
|
995
|
+
if set(nodes) == {"n0", "n1"} and set(edges) == {"e0"}:
|
|
996
|
+
kind = "one-hop"
|
|
997
|
+
elif set(nodes) == {"n0", "n1", "n2"} and set(edges) == {"e0", "e1"}:
|
|
998
|
+
kind = "two-hop"
|
|
999
|
+
else:
|
|
1000
|
+
raise UsageError("saved request must be exactly one hop or endpoint-pinned two hop")
|
|
1001
|
+
qnode_ids: dict[str, list[str]] = {}
|
|
1002
|
+
for key, node in nodes.items():
|
|
1003
|
+
if not isinstance(node, dict):
|
|
1004
|
+
raise UsageError("saved request contains an invalid qnode")
|
|
1005
|
+
allowed_node_keys = {"categories"}
|
|
1006
|
+
if "ids" in node:
|
|
1007
|
+
allowed_node_keys.add("ids")
|
|
1008
|
+
_require_exact_keys(node, allowed_node_keys, "saved qnode")
|
|
1009
|
+
categories = node.get("categories")
|
|
1010
|
+
if not isinstance(categories, list) or len(categories) != 1:
|
|
1011
|
+
raise UsageError("every saved qnode must have exactly one category")
|
|
1012
|
+
validate_biolink_term(categories[0], "Biolink category")
|
|
1013
|
+
ids = node.get("ids", [])
|
|
1014
|
+
if not isinstance(ids, list) or len(ids) > 1:
|
|
1015
|
+
raise UsageError("saved qnodes may have at most one CURIE")
|
|
1016
|
+
qnode_ids[key] = [validate_curie(value) for value in ids]
|
|
1017
|
+
if kind == "one-hop" and not (qnode_ids["n0"] or qnode_ids["n1"]):
|
|
1018
|
+
raise UsageError("saved one-hop request has no pinned endpoint")
|
|
1019
|
+
if kind == "two-hop" and not (
|
|
1020
|
+
len(qnode_ids["n0"]) == 1 and not qnode_ids["n1"] and len(qnode_ids["n2"]) == 1
|
|
1021
|
+
):
|
|
1022
|
+
raise UsageError("saved two-hop request is not endpoint pinned")
|
|
1023
|
+
query_edges = {key: _validate_edge_contract(edge) for key, edge in edges.items()}
|
|
1024
|
+
expected_edges = {"e0": ("n0", "n1")}
|
|
1025
|
+
if kind == "two-hop":
|
|
1026
|
+
expected_edges["e1"] = ("n1", "n2")
|
|
1027
|
+
if query_edges != expected_edges:
|
|
1028
|
+
raise UsageError("saved query edge topology is unsupported")
|
|
1029
|
+
operations = payload.get("operations")
|
|
1030
|
+
if not isinstance(operations, dict):
|
|
1031
|
+
raise UsageError("saved request lacks operations")
|
|
1032
|
+
_require_exact_keys(operations, {"actions"}, "saved operations")
|
|
1033
|
+
actions = operations.get("actions") if isinstance(operations, dict) else None
|
|
1034
|
+
expected_count = 4 if kind == "one-hop" else 5
|
|
1035
|
+
if not isinstance(actions, list) or len(actions) != expected_count:
|
|
1036
|
+
raise UsageError("saved request does not contain the fixed action sequence")
|
|
1037
|
+
if actions[-3] != "scoreless_resultify(ignore_edge_direction=true)":
|
|
1038
|
+
raise UsageError("saved request does not use scoreless resultification")
|
|
1039
|
+
filter_match = FILTER_RE.fullmatch(actions[-2]) if isinstance(actions[-2], str) else None
|
|
1040
|
+
if filter_match is None or actions[-1] != "return(response=true,store=false)":
|
|
1041
|
+
raise UsageError("saved request does not use the fixed filter and return actions")
|
|
1042
|
+
result_limit = validate_result_limit(int(filter_match.group(1)))
|
|
1043
|
+
expand_actions = actions[:-3]
|
|
1044
|
+
expand_keys: list[str] = []
|
|
1045
|
+
mode: str | None = None
|
|
1046
|
+
provider_ids: tuple[str, ...] | None = None
|
|
1047
|
+
for action in expand_actions:
|
|
1048
|
+
match = EXPAND_RE.fullmatch(action) if isinstance(action, str) else None
|
|
1049
|
+
if match is None:
|
|
1050
|
+
raise UsageError("saved request contains an unsupported expansion action")
|
|
1051
|
+
current_mode, current_providers = _parse_kp_parameter(match.group(2))
|
|
1052
|
+
if mode is not None and (current_mode, current_providers) != (mode, provider_ids):
|
|
1053
|
+
raise UsageError("saved request changes providers between edges")
|
|
1054
|
+
mode, provider_ids = current_mode, current_providers
|
|
1055
|
+
expand_keys.append(match.group(1))
|
|
1056
|
+
if kind == "one-hop":
|
|
1057
|
+
if expand_keys != ["e0"]:
|
|
1058
|
+
raise UsageError("saved one-hop request has invalid expansion order")
|
|
1059
|
+
expand_order = None
|
|
1060
|
+
elif expand_keys == ["e1", "e0"]:
|
|
1061
|
+
expand_order = "right-first"
|
|
1062
|
+
elif expand_keys == ["e0", "e1"]:
|
|
1063
|
+
expand_order = "left-first"
|
|
1064
|
+
else:
|
|
1065
|
+
raise UsageError("saved two-hop request has invalid expansion order")
|
|
1066
|
+
return QueryContract(
|
|
1067
|
+
kind=kind,
|
|
1068
|
+
mode=mode or "lookup",
|
|
1069
|
+
provider_ids=provider_ids or ("infores:rtx-kg2",),
|
|
1070
|
+
expand_order=expand_order,
|
|
1071
|
+
qnode_ids=qnode_ids,
|
|
1072
|
+
result_limit=result_limit,
|
|
1073
|
+
query_edges=query_edges,
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
def _normalize_node_bindings(value: Any) -> tuple[dict[str, list[dict[str, Any]]], dict[str, set[str]]]:
|
|
1078
|
+
if not isinstance(value, dict):
|
|
1079
|
+
raise ResponseError("result node_bindings is not an object")
|
|
1080
|
+
normalized: dict[str, list[dict[str, Any]]] = {}
|
|
1081
|
+
identifiers: dict[str, set[str]] = {}
|
|
1082
|
+
for qnode_key, bindings in value.items():
|
|
1083
|
+
if not isinstance(bindings, list):
|
|
1084
|
+
raise ResponseError("node binding list is malformed")
|
|
1085
|
+
normalized[qnode_key] = []
|
|
1086
|
+
identifiers[qnode_key] = set()
|
|
1087
|
+
for binding in bindings:
|
|
1088
|
+
if not isinstance(binding, dict) or not isinstance(binding.get("id"), str):
|
|
1089
|
+
raise ResponseError("node binding is missing an identifier")
|
|
1090
|
+
identifiers[qnode_key].add(binding["id"])
|
|
1091
|
+
normalized[qnode_key].append(
|
|
1092
|
+
{
|
|
1093
|
+
"id": binding["id"],
|
|
1094
|
+
"query_id": binding.get("query_id"),
|
|
1095
|
+
"attributes": binding.get("attributes", []),
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1098
|
+
return normalized, identifiers
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
def _resource_ids_for_role(sources: Sequence[dict[str, Any]], role: str) -> list[str]:
|
|
1102
|
+
found: list[str] = []
|
|
1103
|
+
for source in sources:
|
|
1104
|
+
resource_role = source.get("resource_role")
|
|
1105
|
+
if isinstance(resource_role, str) and resource_role.removeprefix("biolink:") == role:
|
|
1106
|
+
resource_id = source.get("resource_id")
|
|
1107
|
+
if isinstance(resource_id, str) and resource_id not in found:
|
|
1108
|
+
found.append(resource_id)
|
|
1109
|
+
return found
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
def extract_publications(edge: Mapping[str, Any]) -> list[str]:
|
|
1113
|
+
publications: list[str] = []
|
|
1114
|
+
attributes = edge.get("attributes", [])
|
|
1115
|
+
if not isinstance(attributes, list):
|
|
1116
|
+
return publications
|
|
1117
|
+
for attribute in attributes:
|
|
1118
|
+
if not isinstance(attribute, dict) or attribute.get("attribute_type_id") != "biolink:publications":
|
|
1119
|
+
continue
|
|
1120
|
+
value = attribute.get("value")
|
|
1121
|
+
candidates: Iterable[Any] = value if isinstance(value, list) else [value]
|
|
1122
|
+
for candidate in candidates:
|
|
1123
|
+
if isinstance(candidate, str) and candidate not in publications:
|
|
1124
|
+
publications.append(candidate)
|
|
1125
|
+
return publications
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
def _classify_logs(
|
|
1129
|
+
payload: Mapping[str, Any],
|
|
1130
|
+
contract: QueryContract,
|
|
1131
|
+
warnings: list[dict[str, Any]],
|
|
1132
|
+
) -> bool:
|
|
1133
|
+
partial = False
|
|
1134
|
+
logs = payload.get("logs", [])
|
|
1135
|
+
if not isinstance(logs, list):
|
|
1136
|
+
return partial
|
|
1137
|
+
for log in logs:
|
|
1138
|
+
if not isinstance(log, dict):
|
|
1139
|
+
continue
|
|
1140
|
+
message = _sanitize_text(log.get("message", ""), MAX_WARNING_MESSAGE)
|
|
1141
|
+
code = _sanitize_text(log.get("code", ""), 100)
|
|
1142
|
+
level = _sanitize_text(log.get("level", ""), 30).lower()
|
|
1143
|
+
combined = f"{code} {message}".lower()
|
|
1144
|
+
provider = next((item for item in contract.provider_ids if item.lower() in combined), None)
|
|
1145
|
+
context = {"provider_id": provider} if provider else {}
|
|
1146
|
+
failure_level = level in {"warning", "error", "critical", "fatal"}
|
|
1147
|
+
timeout_failure = failure_level and (
|
|
1148
|
+
"timed out" in combined
|
|
1149
|
+
or "timeout error" in combined
|
|
1150
|
+
or "timeout failure" in combined
|
|
1151
|
+
or "timeout" in code.lower()
|
|
1152
|
+
)
|
|
1153
|
+
malformed_failure = failure_level and any(
|
|
1154
|
+
token in combined for token in ("malformed", "deserial", "invalid trapi")
|
|
1155
|
+
)
|
|
1156
|
+
if timeout_failure:
|
|
1157
|
+
_append_warning(warnings, "KP_TIMEOUT", message or "A provider timed out.", context)
|
|
1158
|
+
partial = partial or contract.mode == "federated"
|
|
1159
|
+
elif malformed_failure:
|
|
1160
|
+
_append_warning(
|
|
1161
|
+
warnings,
|
|
1162
|
+
"MALFORMED_KP_RESPONSE",
|
|
1163
|
+
message or "A provider returned a malformed response.",
|
|
1164
|
+
context,
|
|
1165
|
+
)
|
|
1166
|
+
partial = partial or contract.mode == "federated"
|
|
1167
|
+
elif contract.mode == "federated" and level in {"warning", "error", "critical"} and (
|
|
1168
|
+
"kp" in combined or provider is not None
|
|
1169
|
+
):
|
|
1170
|
+
_append_warning(warnings, "KP_ERROR", message or "A provider reported an error.", context)
|
|
1171
|
+
partial = True
|
|
1172
|
+
result_pruning = (
|
|
1173
|
+
"result_limit" in code.lower()
|
|
1174
|
+
or "result_prun" in code.lower()
|
|
1175
|
+
or "pruned result" in combined
|
|
1176
|
+
or ("removed" in combined and "result" in combined)
|
|
1177
|
+
)
|
|
1178
|
+
if result_pruning:
|
|
1179
|
+
_append_warning(
|
|
1180
|
+
warnings,
|
|
1181
|
+
"INTERNAL_PRUNING_DETECTED",
|
|
1182
|
+
message or "ARAX reported internal pruning or result removal.",
|
|
1183
|
+
)
|
|
1184
|
+
return partial
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
def parse_trapi_response(
|
|
1188
|
+
payload: Any,
|
|
1189
|
+
contract: QueryContract,
|
|
1190
|
+
*,
|
|
1191
|
+
service: ServiceInfo | None = None,
|
|
1192
|
+
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
1193
|
+
) -> dict[str, Any]:
|
|
1194
|
+
if not isinstance(payload, dict):
|
|
1195
|
+
raise ResponseError("TRAPI response is not an object")
|
|
1196
|
+
message = payload.get("message")
|
|
1197
|
+
if not isinstance(message, dict):
|
|
1198
|
+
raise ResponseError("TRAPI response is missing message")
|
|
1199
|
+
knowledge_graph = message.get("knowledge_graph")
|
|
1200
|
+
if not isinstance(knowledge_graph, dict):
|
|
1201
|
+
raise ResponseError("TRAPI response is missing knowledge_graph")
|
|
1202
|
+
kg_nodes = knowledge_graph.get("nodes")
|
|
1203
|
+
kg_edges = knowledge_graph.get("edges")
|
|
1204
|
+
results = message.get("results")
|
|
1205
|
+
if not isinstance(kg_nodes, dict) or not isinstance(kg_edges, dict) or not isinstance(results, list):
|
|
1206
|
+
raise ResponseError("TRAPI response has malformed nodes, edges, or results")
|
|
1207
|
+
auxiliary_graphs = message.get("auxiliary_graphs", {})
|
|
1208
|
+
if not isinstance(auxiliary_graphs, dict):
|
|
1209
|
+
auxiliary_graphs = {}
|
|
1210
|
+
warnings = [dict(item) for item in initial_warnings]
|
|
1211
|
+
_append_warning(
|
|
1212
|
+
warnings,
|
|
1213
|
+
"UNSCORED_RESPONSE_ORDER",
|
|
1214
|
+
"Result positions are preserved from the unscored ARAX response.",
|
|
1215
|
+
)
|
|
1216
|
+
partial = _classify_logs(payload, contract, warnings)
|
|
1217
|
+
summarized_results: list[dict[str, Any]] = []
|
|
1218
|
+
analyses_count = 0
|
|
1219
|
+
bound_edges_count = 0
|
|
1220
|
+
for position, result in enumerate(results[: contract.result_limit], start=1):
|
|
1221
|
+
if not isinstance(result, dict):
|
|
1222
|
+
raise ResponseError("TRAPI result is not an object")
|
|
1223
|
+
node_bindings, binding_ids = _normalize_node_bindings(result.get("node_bindings"))
|
|
1224
|
+
if set(node_bindings) != set(contract.qnode_ids):
|
|
1225
|
+
raise ResponseError("result node_bindings do not match the supported query graph")
|
|
1226
|
+
analyses = result.get("analyses")
|
|
1227
|
+
if not isinstance(analyses, list):
|
|
1228
|
+
raise ResponseError("TRAPI result analyses is not a list")
|
|
1229
|
+
normalized_analyses: list[dict[str, Any]] = []
|
|
1230
|
+
for analysis in analyses:
|
|
1231
|
+
if not isinstance(analysis, dict):
|
|
1232
|
+
raise ResponseError("TRAPI analysis is not an object")
|
|
1233
|
+
edge_bindings = analysis.get("edge_bindings")
|
|
1234
|
+
if not isinstance(edge_bindings, dict):
|
|
1235
|
+
raise ResponseError("TRAPI analysis edge_bindings is not an object")
|
|
1236
|
+
if set(edge_bindings) != set(contract.query_edges):
|
|
1237
|
+
raise ResponseError("TRAPI analysis edge_bindings do not match the supported query graph")
|
|
1238
|
+
support_graph_ids = analysis.get("support_graphs", [])
|
|
1239
|
+
if not isinstance(support_graph_ids, list):
|
|
1240
|
+
support_graph_ids = []
|
|
1241
|
+
missing_support = [item for item in support_graph_ids if item not in auxiliary_graphs]
|
|
1242
|
+
if support_graph_ids and missing_support:
|
|
1243
|
+
support_status = "missing"
|
|
1244
|
+
for graph_id in missing_support:
|
|
1245
|
+
_append_warning(
|
|
1246
|
+
warnings,
|
|
1247
|
+
"MISSING_AUXILIARY_GRAPH",
|
|
1248
|
+
"A referenced auxiliary graph was not returned.",
|
|
1249
|
+
{"support_graph_id": graph_id},
|
|
1250
|
+
)
|
|
1251
|
+
elif support_graph_ids:
|
|
1252
|
+
support_status = "available"
|
|
1253
|
+
else:
|
|
1254
|
+
support_status = "not_returned"
|
|
1255
|
+
normalized_edges: dict[str, list[dict[str, Any]]] = {}
|
|
1256
|
+
for qedge_key in contract.query_edges:
|
|
1257
|
+
bindings = edge_bindings.get(qedge_key, [])
|
|
1258
|
+
if not isinstance(bindings, list):
|
|
1259
|
+
raise ResponseError("query-edge binding list is malformed")
|
|
1260
|
+
normalized_edges[qedge_key] = []
|
|
1261
|
+
qsubject, qobject = contract.query_edges[qedge_key]
|
|
1262
|
+
expected_subjects = binding_ids.get(qsubject, set())
|
|
1263
|
+
expected_objects = binding_ids.get(qobject, set())
|
|
1264
|
+
for binding in bindings:
|
|
1265
|
+
if not isinstance(binding, dict) or not isinstance(binding.get("id"), str):
|
|
1266
|
+
raise ResponseError("query-edge binding is missing an edge identifier")
|
|
1267
|
+
edge_id = binding["id"]
|
|
1268
|
+
edge = kg_edges.get(edge_id)
|
|
1269
|
+
if not isinstance(edge, dict):
|
|
1270
|
+
raise ResponseError(f"bound knowledge-graph edge is missing: {edge_id}")
|
|
1271
|
+
subject = edge.get("subject")
|
|
1272
|
+
object_ = edge.get("object")
|
|
1273
|
+
predicate = edge.get("predicate")
|
|
1274
|
+
if not all(isinstance(item, str) for item in (subject, object_, predicate)):
|
|
1275
|
+
raise ResponseError(f"bound edge is malformed: {edge_id}")
|
|
1276
|
+
matches_direction = subject in expected_subjects and object_ in expected_objects
|
|
1277
|
+
matches_reverse = subject in expected_objects and object_ in expected_subjects
|
|
1278
|
+
if not matches_direction and not matches_reverse:
|
|
1279
|
+
raise ResponseError(
|
|
1280
|
+
f"bound edge endpoints do not match result node bindings: {edge_id}"
|
|
1281
|
+
)
|
|
1282
|
+
if matches_reverse:
|
|
1283
|
+
_append_warning(
|
|
1284
|
+
warnings,
|
|
1285
|
+
"REVERSED_EDGE_BINDING",
|
|
1286
|
+
"A bound edge does not match the query's physical direction; it was preserved.",
|
|
1287
|
+
{"edge_id": edge_id, "query_edge": qedge_key},
|
|
1288
|
+
)
|
|
1289
|
+
sources_value = edge.get("sources", [])
|
|
1290
|
+
sources = [dict(item) for item in sources_value if isinstance(item, dict)] if isinstance(sources_value, list) else []
|
|
1291
|
+
primary = _resource_ids_for_role(sources, "primary_knowledge_source")
|
|
1292
|
+
aggregators = _resource_ids_for_role(sources, "aggregator_knowledge_source")
|
|
1293
|
+
supporting = _resource_ids_for_role(sources, "supporting_data_source")
|
|
1294
|
+
if not primary:
|
|
1295
|
+
_append_warning(
|
|
1296
|
+
warnings,
|
|
1297
|
+
"NO_PRIMARY_SOURCE_RETURNED",
|
|
1298
|
+
"No primary knowledge source was returned for a bound edge.",
|
|
1299
|
+
{"edge_id": edge_id},
|
|
1300
|
+
)
|
|
1301
|
+
publications = extract_publications(edge)
|
|
1302
|
+
if not publications:
|
|
1303
|
+
_append_warning(
|
|
1304
|
+
warnings,
|
|
1305
|
+
"NO_PUBLICATIONS_RETURNED",
|
|
1306
|
+
"No recognized publication metadata was returned for a bound edge.",
|
|
1307
|
+
{"edge_id": edge_id},
|
|
1308
|
+
)
|
|
1309
|
+
qualifiers_value = edge.get("qualifiers", [])
|
|
1310
|
+
qualifiers = []
|
|
1311
|
+
if isinstance(qualifiers_value, list):
|
|
1312
|
+
qualifiers = [
|
|
1313
|
+
{
|
|
1314
|
+
"qualifier_type_id": item.get("qualifier_type_id"),
|
|
1315
|
+
"qualifier_value": item.get("qualifier_value"),
|
|
1316
|
+
}
|
|
1317
|
+
for item in qualifiers_value
|
|
1318
|
+
if isinstance(item, dict)
|
|
1319
|
+
]
|
|
1320
|
+
subject_node = kg_nodes.get(subject, {})
|
|
1321
|
+
object_node = kg_nodes.get(object_, {})
|
|
1322
|
+
normalized_edges[qedge_key].append(
|
|
1323
|
+
{
|
|
1324
|
+
"edge_id": edge_id,
|
|
1325
|
+
"subject": subject,
|
|
1326
|
+
"subject_name": subject_node.get("name") if isinstance(subject_node, dict) else None,
|
|
1327
|
+
"predicate": predicate,
|
|
1328
|
+
"object": object_,
|
|
1329
|
+
"object_name": object_node.get("name") if isinstance(object_node, dict) else None,
|
|
1330
|
+
"matches_query_direction": matches_direction,
|
|
1331
|
+
"qualifiers": qualifiers,
|
|
1332
|
+
"sources": sources,
|
|
1333
|
+
"primary_knowledge_sources": primary,
|
|
1334
|
+
"aggregator_knowledge_sources": aggregators,
|
|
1335
|
+
"supporting_data_sources": supporting,
|
|
1336
|
+
"publication_ids": publications,
|
|
1337
|
+
"publication_availability": "available" if publications else "not_returned",
|
|
1338
|
+
"support_graph_ids": list(support_graph_ids),
|
|
1339
|
+
"support_graph_status": support_status,
|
|
1340
|
+
}
|
|
1341
|
+
)
|
|
1342
|
+
bound_edges_count += 1
|
|
1343
|
+
normalized_analyses.append(
|
|
1344
|
+
{
|
|
1345
|
+
"resource_id": analysis.get("resource_id"),
|
|
1346
|
+
"score": analysis.get("score"),
|
|
1347
|
+
"support_graphs": list(support_graph_ids),
|
|
1348
|
+
"edge_bindings": normalized_edges,
|
|
1349
|
+
}
|
|
1350
|
+
)
|
|
1351
|
+
analyses_count += 1
|
|
1352
|
+
summarized_results.append(
|
|
1353
|
+
{
|
|
1354
|
+
"position": position,
|
|
1355
|
+
"description": _sanitize_text(result.get("description"), MAX_DISPLAY_TEXT)
|
|
1356
|
+
if result.get("description") is not None
|
|
1357
|
+
else None,
|
|
1358
|
+
"node_bindings": node_bindings,
|
|
1359
|
+
"analyses": normalized_analyses,
|
|
1360
|
+
}
|
|
1361
|
+
)
|
|
1362
|
+
raw_count = len(results)
|
|
1363
|
+
total_results_count = payload.get("total_results_count")
|
|
1364
|
+
if not isinstance(total_results_count, int) or isinstance(total_results_count, bool):
|
|
1365
|
+
total_results_count = None
|
|
1366
|
+
pruning = any(item.get("code") == "INTERNAL_PRUNING_DETECTED" for item in warnings)
|
|
1367
|
+
if raw_count > contract.result_limit or pruning or (
|
|
1368
|
+
total_results_count is not None and total_results_count > raw_count
|
|
1369
|
+
):
|
|
1370
|
+
truncation_status = "confirmed"
|
|
1371
|
+
elif raw_count == contract.result_limit:
|
|
1372
|
+
truncation_status = "possible"
|
|
1373
|
+
else:
|
|
1374
|
+
truncation_status = "no"
|
|
1375
|
+
if raw_count >= contract.result_limit:
|
|
1376
|
+
_append_warning(
|
|
1377
|
+
warnings,
|
|
1378
|
+
"RESULT_LIMIT_REACHED",
|
|
1379
|
+
"The response reached or exceeded the requested result limit.",
|
|
1380
|
+
{"result_limit": contract.result_limit},
|
|
1381
|
+
)
|
|
1382
|
+
if raw_count == 0:
|
|
1383
|
+
_append_warning(
|
|
1384
|
+
warnings,
|
|
1385
|
+
"NO_RESULTS",
|
|
1386
|
+
"ARAX returned no results under these constraints.",
|
|
1387
|
+
)
|
|
1388
|
+
if service is None:
|
|
1389
|
+
service_data = {
|
|
1390
|
+
"base_url": None,
|
|
1391
|
+
"openapi_url": None,
|
|
1392
|
+
"arax_version": payload.get("tool_version"),
|
|
1393
|
+
"trapi_version": payload.get("schema_version"),
|
|
1394
|
+
"biolink_version": payload.get("biolink_version"),
|
|
1395
|
+
}
|
|
1396
|
+
else:
|
|
1397
|
+
service_data = service.as_dict(biolink_version=payload.get("biolink_version"))
|
|
1398
|
+
return {
|
|
1399
|
+
"schema_version": "1.0",
|
|
1400
|
+
"query": {
|
|
1401
|
+
"kind": contract.kind,
|
|
1402
|
+
"mode": contract.mode,
|
|
1403
|
+
"provider_ids": list(contract.provider_ids),
|
|
1404
|
+
"expand_order": contract.expand_order,
|
|
1405
|
+
"qnode_ids": contract.qnode_ids,
|
|
1406
|
+
"result_limit": contract.result_limit,
|
|
1407
|
+
},
|
|
1408
|
+
"service": service_data,
|
|
1409
|
+
"counts": {
|
|
1410
|
+
"results_returned": raw_count,
|
|
1411
|
+
"results_summarized": len(summarized_results),
|
|
1412
|
+
"analyses_summarized": analyses_count,
|
|
1413
|
+
"bound_edges_summarized": bound_edges_count,
|
|
1414
|
+
"knowledge_graph_nodes": len(kg_nodes),
|
|
1415
|
+
"knowledge_graph_edges": len(kg_edges),
|
|
1416
|
+
"server_total_results_count": total_results_count,
|
|
1417
|
+
},
|
|
1418
|
+
"truncation_status": truncation_status,
|
|
1419
|
+
"completeness": "partial" if partial else "complete",
|
|
1420
|
+
"results": summarized_results,
|
|
1421
|
+
"warnings": warnings,
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
def render_text_summary(
|
|
1426
|
+
summary: Mapping[str, Any],
|
|
1427
|
+
*,
|
|
1428
|
+
summary_path: str = "summary.json",
|
|
1429
|
+
response_path: str = "response.json",
|
|
1430
|
+
) -> str:
|
|
1431
|
+
def rendered(value: Any, limit: int = 200) -> str:
|
|
1432
|
+
return _sanitize_text(value, limit)
|
|
1433
|
+
|
|
1434
|
+
def rendered_list(values: Any, *, limit: int = 200) -> str:
|
|
1435
|
+
if not isinstance(values, list) or not values:
|
|
1436
|
+
return "not returned"
|
|
1437
|
+
return ", ".join(rendered(value, limit) for value in values)
|
|
1438
|
+
|
|
1439
|
+
lines: list[str] = []
|
|
1440
|
+
query = summary.get("query", {})
|
|
1441
|
+
counts = summary.get("counts", {})
|
|
1442
|
+
lines.append(
|
|
1443
|
+
f"ARAX returned {counts.get('results_returned', 0)} result(s); "
|
|
1444
|
+
f"showing {counts.get('results_summarized', 0)} in unscored response order."
|
|
1445
|
+
)
|
|
1446
|
+
lines.append(
|
|
1447
|
+
f"Query: {rendered(query.get('kind'))} / {rendered(query.get('mode'))}; "
|
|
1448
|
+
f"limit {rendered(query.get('result_limit'))}; "
|
|
1449
|
+
f"truncation {rendered(summary.get('truncation_status'))}; "
|
|
1450
|
+
f"completeness {rendered(summary.get('completeness'))}."
|
|
1451
|
+
)
|
|
1452
|
+
warnings = summary.get("warnings", [])
|
|
1453
|
+
if isinstance(warnings, list) and warnings:
|
|
1454
|
+
lines.append("Warnings:")
|
|
1455
|
+
for warning in warnings:
|
|
1456
|
+
if isinstance(warning, dict):
|
|
1457
|
+
lines.append(
|
|
1458
|
+
f" - {rendered(warning.get('code'), 100)}: "
|
|
1459
|
+
f"{rendered(warning.get('message', ''), MAX_WARNING_MESSAGE)}"
|
|
1460
|
+
)
|
|
1461
|
+
results = summary.get("results", [])
|
|
1462
|
+
if not results:
|
|
1463
|
+
lines.append("Not returned under these constraints.")
|
|
1464
|
+
for result in results if isinstance(results, list) else []:
|
|
1465
|
+
if not isinstance(result, dict):
|
|
1466
|
+
continue
|
|
1467
|
+
lines.append(
|
|
1468
|
+
f"Unscored position {rendered(result.get('position'))}: "
|
|
1469
|
+
f"{rendered(result.get('description') or 'candidate path', MAX_DISPLAY_TEXT)}"
|
|
1470
|
+
)
|
|
1471
|
+
node_bindings = result.get("node_bindings", {})
|
|
1472
|
+
if isinstance(node_bindings, dict):
|
|
1473
|
+
for qnode, bindings in node_bindings.items():
|
|
1474
|
+
ids = [item.get("id") for item in bindings if isinstance(item, dict)] if isinstance(bindings, list) else []
|
|
1475
|
+
lines.append(f" {rendered(qnode, 100)}: {rendered_list(ids)}")
|
|
1476
|
+
analyses = result.get("analyses", [])
|
|
1477
|
+
for analysis_index, analysis in enumerate(analyses if isinstance(analyses, list) else [], start=1):
|
|
1478
|
+
if not isinstance(analysis, dict):
|
|
1479
|
+
continue
|
|
1480
|
+
lines.append(
|
|
1481
|
+
f" Analysis {analysis_index}: resource {rendered(analysis.get('resource_id'))}; "
|
|
1482
|
+
f"score {rendered(analysis.get('score'))}"
|
|
1483
|
+
)
|
|
1484
|
+
edge_bindings = analysis.get("edge_bindings", {})
|
|
1485
|
+
if not isinstance(edge_bindings, dict):
|
|
1486
|
+
continue
|
|
1487
|
+
for qedge, edges in edge_bindings.items():
|
|
1488
|
+
for edge in edges if isinstance(edges, list) else []:
|
|
1489
|
+
if not isinstance(edge, dict):
|
|
1490
|
+
continue
|
|
1491
|
+
subject = edge.get("subject")
|
|
1492
|
+
subject_name = edge.get("subject_name")
|
|
1493
|
+
object_ = edge.get("object")
|
|
1494
|
+
object_name = edge.get("object_name")
|
|
1495
|
+
lines.append(
|
|
1496
|
+
f" {rendered(qedge, 100)}/{rendered(edge.get('edge_id'))}: "
|
|
1497
|
+
f"{rendered(subject)} ({rendered(subject_name)}) "
|
|
1498
|
+
f"--{rendered(edge.get('predicate'))}--> "
|
|
1499
|
+
f"{rendered(object_)} ({rendered(object_name)})"
|
|
1500
|
+
)
|
|
1501
|
+
if not edge.get("matches_query_direction"):
|
|
1502
|
+
lines.append(" Direction warning: physical edge orientation differs from the query.")
|
|
1503
|
+
qualifiers = edge.get("qualifiers", [])
|
|
1504
|
+
if qualifiers:
|
|
1505
|
+
rendered_qualifiers = ", ".join(
|
|
1506
|
+
f"{_sanitize_text(item.get('qualifier_type_id'), 200)}="
|
|
1507
|
+
f"{_sanitize_text(item.get('qualifier_value'), 200)}"
|
|
1508
|
+
for item in qualifiers
|
|
1509
|
+
if isinstance(item, dict)
|
|
1510
|
+
)
|
|
1511
|
+
lines.append(f" Qualifiers: {rendered_qualifiers}")
|
|
1512
|
+
for label, field in (
|
|
1513
|
+
("Primary sources", "primary_knowledge_sources"),
|
|
1514
|
+
("Aggregator sources", "aggregator_knowledge_sources"),
|
|
1515
|
+
("Supporting sources", "supporting_data_sources"),
|
|
1516
|
+
):
|
|
1517
|
+
values = edge.get(field, [])
|
|
1518
|
+
lines.append(f" {label}: {rendered_list(values)}")
|
|
1519
|
+
publications = edge.get("publication_ids", [])
|
|
1520
|
+
preview = publications[:PUBLICATION_PREVIEW] if isinstance(publications, list) else []
|
|
1521
|
+
lines.append(
|
|
1522
|
+
f" Publications: {len(publications) if isinstance(publications, list) else 0}; "
|
|
1523
|
+
f"preview {rendered_list(preview)}"
|
|
1524
|
+
)
|
|
1525
|
+
lines.append(f"Complete bounded publication and source lists: {rendered(summary_path, 500)}")
|
|
1526
|
+
lines.append(f"Exact TRAPI payload: {rendered(response_path, 500)}")
|
|
1527
|
+
lines.append("Candidate paths require subsequent scientific verification.")
|
|
1528
|
+
return "\n".join(lines)
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
def sha256_bytes(value: bytes) -> str:
|
|
1532
|
+
return hashlib.sha256(value).hexdigest()
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
def prepare_output_directory(value: str | Path) -> Path:
|
|
1536
|
+
path = Path(value)
|
|
1537
|
+
try:
|
|
1538
|
+
if path.exists():
|
|
1539
|
+
if not path.is_dir():
|
|
1540
|
+
raise UsageError("output path exists and is not a directory")
|
|
1541
|
+
if any(path.iterdir()):
|
|
1542
|
+
raise UsageError("output directory must be new or empty")
|
|
1543
|
+
else:
|
|
1544
|
+
path.mkdir(parents=True)
|
|
1545
|
+
except UsageError:
|
|
1546
|
+
raise
|
|
1547
|
+
except OSError as exc:
|
|
1548
|
+
raise ResponseError(f"could not prepare output directory: {_sanitize_text(exc)}") from exc
|
|
1549
|
+
return path
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
def atomic_write_bytes(path: Path, value: bytes) -> None:
|
|
1553
|
+
try:
|
|
1554
|
+
if path.exists():
|
|
1555
|
+
raise ResponseError(f"refusing to overwrite existing artifact: {path.name}")
|
|
1556
|
+
except ResponseError:
|
|
1557
|
+
raise
|
|
1558
|
+
except OSError as exc:
|
|
1559
|
+
raise ResponseError(f"could not inspect artifact path {path.name}: {_sanitize_text(exc)}") from exc
|
|
1560
|
+
descriptor: int | None = None
|
|
1561
|
+
temporary: Path | None = None
|
|
1562
|
+
try:
|
|
1563
|
+
descriptor, temporary_name = tempfile.mkstemp(
|
|
1564
|
+
prefix=".ncats-arax-", dir=str(path.parent)
|
|
1565
|
+
)
|
|
1566
|
+
temporary = Path(temporary_name)
|
|
1567
|
+
try:
|
|
1568
|
+
os.chmod(temporary, 0o600)
|
|
1569
|
+
except OSError:
|
|
1570
|
+
pass
|
|
1571
|
+
handle = os.fdopen(descriptor, "wb")
|
|
1572
|
+
descriptor = None
|
|
1573
|
+
with handle:
|
|
1574
|
+
handle.write(value)
|
|
1575
|
+
handle.flush()
|
|
1576
|
+
os.fsync(handle.fileno())
|
|
1577
|
+
if path.exists():
|
|
1578
|
+
raise ResponseError(f"refusing to overwrite concurrently created artifact: {path.name}")
|
|
1579
|
+
os.replace(temporary, path)
|
|
1580
|
+
except ResponseError:
|
|
1581
|
+
raise
|
|
1582
|
+
except OSError as exc:
|
|
1583
|
+
raise ResponseError(f"could not write artifact {path.name}: {_sanitize_text(exc)}") from exc
|
|
1584
|
+
finally:
|
|
1585
|
+
if descriptor is not None:
|
|
1586
|
+
try:
|
|
1587
|
+
os.close(descriptor)
|
|
1588
|
+
except OSError:
|
|
1589
|
+
pass
|
|
1590
|
+
try:
|
|
1591
|
+
if temporary is not None:
|
|
1592
|
+
temporary.unlink(missing_ok=True)
|
|
1593
|
+
except OSError:
|
|
1594
|
+
pass
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
def atomic_write_json(path: Path, value: Mapping[str, Any]) -> bytes:
|
|
1598
|
+
try:
|
|
1599
|
+
encoded = (
|
|
1600
|
+
json.dumps(value, indent=2, sort_keys=True, ensure_ascii=False, allow_nan=False) + "\n"
|
|
1601
|
+
).encode("utf-8")
|
|
1602
|
+
except (TypeError, ValueError) as exc:
|
|
1603
|
+
raise ResponseError("artifact data cannot be represented as strict JSON") from exc
|
|
1604
|
+
atomic_write_bytes(path, encoded)
|
|
1605
|
+
return encoded
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
def _utc_now() -> str:
|
|
1609
|
+
return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
def new_manifest(
|
|
1613
|
+
command: str,
|
|
1614
|
+
*,
|
|
1615
|
+
base_url: str,
|
|
1616
|
+
privacy_acknowledged: bool,
|
|
1617
|
+
http_timeout: int,
|
|
1618
|
+
result_limit: int | None = None,
|
|
1619
|
+
) -> dict[str, Any]:
|
|
1620
|
+
return {
|
|
1621
|
+
"manifest_version": "1.0",
|
|
1622
|
+
"run_id": str(uuid.uuid4()),
|
|
1623
|
+
"command": command,
|
|
1624
|
+
"started_at": _utc_now(),
|
|
1625
|
+
"finished_at": None,
|
|
1626
|
+
"execution_status": "client_error",
|
|
1627
|
+
"result_status": "not_available",
|
|
1628
|
+
"privacy_acknowledged": privacy_acknowledged,
|
|
1629
|
+
"client": {"name": CLIENT_NAME, "version": CLIENT_VERSION},
|
|
1630
|
+
"service": {
|
|
1631
|
+
"base_url": base_url,
|
|
1632
|
+
"openapi_url": base_url + "/openapi.json",
|
|
1633
|
+
"arax_version": None,
|
|
1634
|
+
"trapi_version": None,
|
|
1635
|
+
"biolink_version": None,
|
|
1636
|
+
},
|
|
1637
|
+
"request": {
|
|
1638
|
+
"method": "GET",
|
|
1639
|
+
"url": base_url + "/openapi.json",
|
|
1640
|
+
"file": None,
|
|
1641
|
+
"bytes": None,
|
|
1642
|
+
"sha256": None,
|
|
1643
|
+
},
|
|
1644
|
+
"response": {
|
|
1645
|
+
"http_status": None,
|
|
1646
|
+
"file": None,
|
|
1647
|
+
"bytes": None,
|
|
1648
|
+
"sha256": None,
|
|
1649
|
+
"elapsed_ms": None,
|
|
1650
|
+
},
|
|
1651
|
+
"limits": {
|
|
1652
|
+
"result_limit": result_limit,
|
|
1653
|
+
"response_byte_limit": MAX_RESPONSE_BYTES,
|
|
1654
|
+
"kp_timeout_seconds": KP_TIMEOUT_SECONDS if command in {"one-hop", "two-hop"} else None,
|
|
1655
|
+
"http_timeout_seconds": http_timeout,
|
|
1656
|
+
},
|
|
1657
|
+
"attempts": {"openapi_get": 0, "entity_get": 0, "query_post": 0},
|
|
1658
|
+
"artifacts": {"request": None, "response": None, "summary": None},
|
|
1659
|
+
"error": None,
|
|
1660
|
+
"warnings": [],
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
def _apply_service_to_manifest(manifest: dict[str, Any], service: ServiceInfo) -> None:
|
|
1665
|
+
manifest["service"].update(service.as_dict())
|
|
1666
|
+
manifest["warnings"] = [dict(item) for item in service.warnings]
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
def _record_response(manifest: dict[str, Any], result: HttpResult, filename: str = "response.json") -> None:
|
|
1670
|
+
manifest["response"].update(
|
|
1671
|
+
{
|
|
1672
|
+
"http_status": result.status,
|
|
1673
|
+
"file": filename,
|
|
1674
|
+
"bytes": len(result.body),
|
|
1675
|
+
"sha256": sha256_bytes(result.body),
|
|
1676
|
+
"elapsed_ms": result.elapsed_ms,
|
|
1677
|
+
}
|
|
1678
|
+
)
|
|
1679
|
+
manifest["artifacts"]["response"] = filename
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
def _write_manifest(output_dir: Path, manifest: dict[str, Any]) -> None:
|
|
1683
|
+
manifest["finished_at"] = _utc_now()
|
|
1684
|
+
atomic_write_json(output_dir / "manifest.json", manifest)
|
|
1685
|
+
|
|
1686
|
+
|
|
1687
|
+
def _retain_failure(
|
|
1688
|
+
output_dir: Path | None,
|
|
1689
|
+
manifest: dict[str, Any] | None,
|
|
1690
|
+
error: AraxClientError,
|
|
1691
|
+
stage: str,
|
|
1692
|
+
) -> None:
|
|
1693
|
+
if output_dir is None or manifest is None:
|
|
1694
|
+
return
|
|
1695
|
+
try:
|
|
1696
|
+
manifest["execution_status"] = "http_error" if error.exit_code == 5 else "client_error"
|
|
1697
|
+
manifest["result_status"] = "not_available"
|
|
1698
|
+
manifest["error"] = {"kind": error.kind, "message": _sanitize_text(error)}
|
|
1699
|
+
if error.http_status is not None:
|
|
1700
|
+
manifest["response"]["http_status"] = error.http_status
|
|
1701
|
+
attempt_key = {
|
|
1702
|
+
"openapi": "openapi_get",
|
|
1703
|
+
"entity": "entity_get",
|
|
1704
|
+
"query": "query_post",
|
|
1705
|
+
}.get(stage)
|
|
1706
|
+
if error.attempts and attempt_key is not None:
|
|
1707
|
+
manifest["attempts"][attempt_key] = error.attempts
|
|
1708
|
+
if error.response_body is not None and not (output_dir / "response.json").exists():
|
|
1709
|
+
atomic_write_bytes(output_dir / "response.json", error.response_body)
|
|
1710
|
+
failed = HttpResult(
|
|
1711
|
+
status=error.http_status or 0,
|
|
1712
|
+
body=error.response_body,
|
|
1713
|
+
headers={},
|
|
1714
|
+
elapsed_ms=0,
|
|
1715
|
+
attempts=error.attempts,
|
|
1716
|
+
)
|
|
1717
|
+
_record_response(manifest, failed)
|
|
1718
|
+
if not (output_dir / "manifest.json").exists():
|
|
1719
|
+
_write_manifest(output_dir, manifest)
|
|
1720
|
+
except Exception as manifest_error:
|
|
1721
|
+
print(
|
|
1722
|
+
f"warning: could not retain failure artifacts: {_sanitize_text(manifest_error)}",
|
|
1723
|
+
file=sys.stderr,
|
|
1724
|
+
)
|
|
1725
|
+
|
|
1726
|
+
|
|
1727
|
+
def _json_from_http(result: HttpResult, label: str) -> Any:
|
|
1728
|
+
return _decode_json(result.body, label)
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
def _preflight_summary(service: ServiceInfo) -> dict[str, Any]:
|
|
1732
|
+
return {
|
|
1733
|
+
"schema_version": "1.0",
|
|
1734
|
+
"kind": "preflight",
|
|
1735
|
+
"service": service.as_dict(),
|
|
1736
|
+
"checks": {
|
|
1737
|
+
"title_identifies_arax": True,
|
|
1738
|
+
"query_path_present": True,
|
|
1739
|
+
"version_supported": _version_series(service.trapi_version) in SUPPORTED_TRAPI_SERIES,
|
|
1740
|
+
},
|
|
1741
|
+
"warnings": [dict(item) for item in service.warnings],
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
def handle_preflight(args: argparse.Namespace) -> int:
|
|
1746
|
+
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1747
|
+
output_dir = prepare_output_directory(args.output_dir) if args.output_dir else None
|
|
1748
|
+
manifest = new_manifest(
|
|
1749
|
+
"preflight", base_url=base_url, privacy_acknowledged=False, http_timeout=GET_TIMEOUT_SECONDS
|
|
1750
|
+
) if output_dir else None
|
|
1751
|
+
stage = "openapi"
|
|
1752
|
+
try:
|
|
1753
|
+
service, result = fetch_openapi(
|
|
1754
|
+
base_url,
|
|
1755
|
+
allow_untested_version=args.allow_untested_version,
|
|
1756
|
+
initial_warnings=endpoint_warnings,
|
|
1757
|
+
)
|
|
1758
|
+
summary = _preflight_summary(service)
|
|
1759
|
+
if output_dir is not None and manifest is not None:
|
|
1760
|
+
_apply_service_to_manifest(manifest, service)
|
|
1761
|
+
manifest["attempts"]["openapi_get"] = result.attempts
|
|
1762
|
+
atomic_write_bytes(output_dir / "response.json", result.body)
|
|
1763
|
+
_record_response(manifest, result)
|
|
1764
|
+
atomic_write_json(output_dir / "summary.json", summary)
|
|
1765
|
+
manifest["artifacts"]["summary"] = "summary.json"
|
|
1766
|
+
manifest["execution_status"] = "success"
|
|
1767
|
+
manifest["result_status"] = "not_available"
|
|
1768
|
+
_write_manifest(output_dir, manifest)
|
|
1769
|
+
print(
|
|
1770
|
+
f"ARAX {service.arax_version or 'unknown'}; TRAPI {service.trapi_version or 'unknown'}; "
|
|
1771
|
+
f"/query available at {service.base_url}"
|
|
1772
|
+
)
|
|
1773
|
+
for warning in service.warnings:
|
|
1774
|
+
print(f"warning {warning['code']}: {warning['message']}", file=sys.stderr)
|
|
1775
|
+
return 0
|
|
1776
|
+
except AraxClientError as exc:
|
|
1777
|
+
_retain_failure(output_dir, manifest, exc, stage)
|
|
1778
|
+
raise
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
def handle_normalize(args: argparse.Namespace) -> int:
|
|
1782
|
+
if not 0 <= args.max_synonyms <= 50:
|
|
1783
|
+
raise UsageError("--max-synonyms must be between 0 and 50")
|
|
1784
|
+
expected_category = (
|
|
1785
|
+
validate_biolink_term(args.expected_category, "Biolink category")
|
|
1786
|
+
if args.expected_category
|
|
1787
|
+
else None
|
|
1788
|
+
)
|
|
1789
|
+
if not args.term or len(args.term) > MAX_IDENTIFIER_LENGTH or _has_control(args.term):
|
|
1790
|
+
raise UsageError("normalization term must be control-free and at most 200 characters")
|
|
1791
|
+
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1792
|
+
output_dir = prepare_output_directory(args.output_dir)
|
|
1793
|
+
manifest = new_manifest(
|
|
1794
|
+
"normalize", base_url=base_url, privacy_acknowledged=True, http_timeout=GET_TIMEOUT_SECONDS
|
|
1795
|
+
)
|
|
1796
|
+
stage = "openapi"
|
|
1797
|
+
try:
|
|
1798
|
+
service, preflight_result = fetch_openapi(
|
|
1799
|
+
base_url,
|
|
1800
|
+
allow_untested_version=args.allow_untested_version,
|
|
1801
|
+
initial_warnings=endpoint_warnings,
|
|
1802
|
+
)
|
|
1803
|
+
_apply_service_to_manifest(manifest, service)
|
|
1804
|
+
manifest["attempts"]["openapi_get"] = preflight_result.attempts
|
|
1805
|
+
stage = "entity"
|
|
1806
|
+
manifest["request"].update(
|
|
1807
|
+
{
|
|
1808
|
+
"method": "GET",
|
|
1809
|
+
"url": base_url + "/entity?" + urllib.parse.urlencode({"q": args.term}),
|
|
1810
|
+
}
|
|
1811
|
+
)
|
|
1812
|
+
entity_result = normalize_entity_request(base_url, args.term)
|
|
1813
|
+
manifest["attempts"]["entity_get"] = entity_result.attempts
|
|
1814
|
+
atomic_write_bytes(output_dir / "response.json", entity_result.body)
|
|
1815
|
+
_record_response(manifest, entity_result)
|
|
1816
|
+
payload = _json_from_http(entity_result, "entity response")
|
|
1817
|
+
summary, usable = parse_normalization_response(
|
|
1818
|
+
payload,
|
|
1819
|
+
term=args.term,
|
|
1820
|
+
expected_category=expected_category,
|
|
1821
|
+
max_synonyms=args.max_synonyms,
|
|
1822
|
+
service=service,
|
|
1823
|
+
)
|
|
1824
|
+
atomic_write_json(output_dir / "summary.json", summary)
|
|
1825
|
+
manifest["artifacts"]["summary"] = "summary.json"
|
|
1826
|
+
manifest["warnings"] = summary["warnings"]
|
|
1827
|
+
manifest["execution_status"] = "success"
|
|
1828
|
+
manifest["result_status"] = "results" if usable else "no_results"
|
|
1829
|
+
_write_manifest(output_dir, manifest)
|
|
1830
|
+
if not usable:
|
|
1831
|
+
raise NormalizationError("normalization returned no usable canonical CURIE")
|
|
1832
|
+
canonical = summary["canonical"]
|
|
1833
|
+
print(
|
|
1834
|
+
f"Canonical: {canonical['identifier']} ({canonical.get('name') or 'name not returned'}; "
|
|
1835
|
+
f"{canonical.get('category') or 'category not returned'})"
|
|
1836
|
+
)
|
|
1837
|
+
if summary["query"]["requires_user_confirmation"]:
|
|
1838
|
+
print("Review and confirm this normalization before constructing a graph query.")
|
|
1839
|
+
return 0
|
|
1840
|
+
except NormalizationError:
|
|
1841
|
+
raise
|
|
1842
|
+
except AraxClientError as exc:
|
|
1843
|
+
_retain_failure(output_dir, manifest, exc, stage)
|
|
1844
|
+
raise
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
def _build_from_args(args: argparse.Namespace) -> tuple[dict[str, Any], QueryContract, int]:
|
|
1848
|
+
providers, limit = resolve_mode(args.mode, args.kp or [], args.result_limit)
|
|
1849
|
+
if args.command == "one-hop":
|
|
1850
|
+
body = build_one_hop_query(
|
|
1851
|
+
subject_id=args.subject_id,
|
|
1852
|
+
subject_category=args.subject_category,
|
|
1853
|
+
predicates=args.predicate,
|
|
1854
|
+
object_id=args.object_id,
|
|
1855
|
+
object_category=args.object_category,
|
|
1856
|
+
qualifiers=parse_qualifiers(args.qualifier or []),
|
|
1857
|
+
mode=args.mode,
|
|
1858
|
+
provider_ids=providers,
|
|
1859
|
+
result_limit=limit,
|
|
1860
|
+
)
|
|
1861
|
+
timeout = LOOKUP_TIMEOUT_SECONDS if args.mode == "lookup" else FEDERATED_TIMEOUT_SECONDS
|
|
1862
|
+
else:
|
|
1863
|
+
body = build_two_hop_query(
|
|
1864
|
+
subject_id=args.subject_id,
|
|
1865
|
+
subject_category=args.subject_category,
|
|
1866
|
+
predicates_1=args.predicate_1,
|
|
1867
|
+
intermediate_category=args.intermediate_category,
|
|
1868
|
+
predicates_2=args.predicate_2,
|
|
1869
|
+
object_id=args.object_id,
|
|
1870
|
+
object_category=args.object_category,
|
|
1871
|
+
qualifiers_1=parse_qualifiers(args.qualifier_1 or []),
|
|
1872
|
+
qualifiers_2=parse_qualifiers(args.qualifier_2 or []),
|
|
1873
|
+
mode=args.mode,
|
|
1874
|
+
provider_ids=providers,
|
|
1875
|
+
expand_order=args.expand_order,
|
|
1876
|
+
result_limit=limit,
|
|
1877
|
+
)
|
|
1878
|
+
timeout = LOOKUP_TIMEOUT_SECONDS if args.mode == "lookup" else FEDERATED_TIMEOUT_SECONDS
|
|
1879
|
+
return body, validate_saved_request_contract(body), timeout
|
|
1880
|
+
|
|
1881
|
+
|
|
1882
|
+
def _validate_query_response_version(
|
|
1883
|
+
payload: Mapping[str, Any],
|
|
1884
|
+
allow_untested_version: bool,
|
|
1885
|
+
warnings: list[dict[str, Any]],
|
|
1886
|
+
) -> None:
|
|
1887
|
+
try:
|
|
1888
|
+
_check_trapi_version(
|
|
1889
|
+
payload.get("schema_version") if isinstance(payload.get("schema_version"), str) else None,
|
|
1890
|
+
allow_untested_version,
|
|
1891
|
+
warnings,
|
|
1892
|
+
)
|
|
1893
|
+
except PreflightError:
|
|
1894
|
+
raise
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
def handle_graph_query(args: argparse.Namespace) -> int:
|
|
1898
|
+
body, contract, timeout = _build_from_args(args)
|
|
1899
|
+
request_bytes = serialize_request(body)
|
|
1900
|
+
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1901
|
+
output_dir = prepare_output_directory(args.output_dir)
|
|
1902
|
+
manifest = new_manifest(
|
|
1903
|
+
args.command,
|
|
1904
|
+
base_url=base_url,
|
|
1905
|
+
privacy_acknowledged=True,
|
|
1906
|
+
http_timeout=timeout,
|
|
1907
|
+
result_limit=contract.result_limit,
|
|
1908
|
+
)
|
|
1909
|
+
stage = "openapi"
|
|
1910
|
+
try:
|
|
1911
|
+
service, preflight_result = fetch_openapi(
|
|
1912
|
+
base_url,
|
|
1913
|
+
allow_untested_version=args.allow_untested_version,
|
|
1914
|
+
initial_warnings=endpoint_warnings,
|
|
1915
|
+
)
|
|
1916
|
+
_apply_service_to_manifest(manifest, service)
|
|
1917
|
+
manifest["attempts"]["openapi_get"] = preflight_result.attempts
|
|
1918
|
+
stage = "query"
|
|
1919
|
+
atomic_write_bytes(output_dir / "request.json", request_bytes)
|
|
1920
|
+
manifest["request"].update(
|
|
1921
|
+
{
|
|
1922
|
+
"method": "POST",
|
|
1923
|
+
"url": base_url + "/query",
|
|
1924
|
+
"file": "request.json",
|
|
1925
|
+
"bytes": len(request_bytes),
|
|
1926
|
+
"sha256": sha256_bytes(request_bytes),
|
|
1927
|
+
}
|
|
1928
|
+
)
|
|
1929
|
+
manifest["artifacts"]["request"] = "request.json"
|
|
1930
|
+
result = post_query(base_url + "/query", request_bytes, timeout=timeout)
|
|
1931
|
+
manifest["attempts"]["query_post"] = result.attempts
|
|
1932
|
+
atomic_write_bytes(output_dir / "response.json", result.body)
|
|
1933
|
+
_record_response(manifest, result)
|
|
1934
|
+
payload = _json_from_http(result, "TRAPI response")
|
|
1935
|
+
if not isinstance(payload, dict):
|
|
1936
|
+
raise ResponseError("TRAPI response is not an object")
|
|
1937
|
+
warnings = [dict(item) for item in service.warnings]
|
|
1938
|
+
_append_warning(warnings, "PUBLIC_QUERY", "The graph query was sent to a public service.")
|
|
1939
|
+
_validate_query_response_version(payload, args.allow_untested_version, warnings)
|
|
1940
|
+
summary = parse_trapi_response(payload, contract, service=service, initial_warnings=warnings)
|
|
1941
|
+
atomic_write_json(output_dir / "summary.json", summary)
|
|
1942
|
+
manifest["artifacts"]["summary"] = "summary.json"
|
|
1943
|
+
manifest["service"]["biolink_version"] = payload.get("biolink_version")
|
|
1944
|
+
manifest["warnings"] = summary["warnings"]
|
|
1945
|
+
manifest["execution_status"] = "success"
|
|
1946
|
+
if summary["completeness"] == "partial":
|
|
1947
|
+
manifest["result_status"] = "partial"
|
|
1948
|
+
exit_code = 7
|
|
1949
|
+
elif summary["counts"]["results_returned"] == 0:
|
|
1950
|
+
manifest["result_status"] = "no_results"
|
|
1951
|
+
exit_code = 0
|
|
1952
|
+
else:
|
|
1953
|
+
manifest["result_status"] = "results"
|
|
1954
|
+
exit_code = 0
|
|
1955
|
+
_write_manifest(output_dir, manifest)
|
|
1956
|
+
print(
|
|
1957
|
+
render_text_summary(
|
|
1958
|
+
summary,
|
|
1959
|
+
summary_path=str(output_dir / "summary.json"),
|
|
1960
|
+
response_path=str(output_dir / "response.json"),
|
|
1961
|
+
)
|
|
1962
|
+
)
|
|
1963
|
+
return exit_code
|
|
1964
|
+
except AraxClientError as exc:
|
|
1965
|
+
_retain_failure(output_dir, manifest, exc, stage)
|
|
1966
|
+
raise
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
def handle_summarize(args: argparse.Namespace) -> int:
|
|
1970
|
+
request_path = Path(args.request)
|
|
1971
|
+
response_path = Path(args.response)
|
|
1972
|
+
try:
|
|
1973
|
+
request_bytes = request_path.read_bytes()
|
|
1974
|
+
response_bytes = response_path.read_bytes()
|
|
1975
|
+
except OSError as exc:
|
|
1976
|
+
raise UsageError(f"could not read saved artifact: {_sanitize_text(exc)}") from exc
|
|
1977
|
+
if len(response_bytes) > MAX_RESPONSE_BYTES:
|
|
1978
|
+
raise ResponseError("saved response exceeded the 25 MiB byte limit")
|
|
1979
|
+
request_payload = _decode_json(request_bytes, "saved request")
|
|
1980
|
+
response_payload = _decode_json(response_bytes, "saved response")
|
|
1981
|
+
contract = validate_saved_request_contract(request_payload)
|
|
1982
|
+
warnings: list[dict[str, Any]] = []
|
|
1983
|
+
if isinstance(response_payload, dict):
|
|
1984
|
+
_validate_query_response_version(response_payload, False, warnings)
|
|
1985
|
+
summary = parse_trapi_response(
|
|
1986
|
+
response_payload,
|
|
1987
|
+
contract,
|
|
1988
|
+
service=None,
|
|
1989
|
+
initial_warnings=warnings,
|
|
1990
|
+
)
|
|
1991
|
+
if args.format == "json":
|
|
1992
|
+
print(json.dumps(summary, indent=2, sort_keys=True, ensure_ascii=False))
|
|
1993
|
+
else:
|
|
1994
|
+
print(
|
|
1995
|
+
render_text_summary(
|
|
1996
|
+
summary,
|
|
1997
|
+
summary_path="standard output with --format json",
|
|
1998
|
+
response_path=str(response_path),
|
|
1999
|
+
)
|
|
2000
|
+
)
|
|
2001
|
+
return 7 if summary["completeness"] == "partial" else 0
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
def _add_network_policy_options(parser: argparse.ArgumentParser) -> None:
|
|
2005
|
+
parser.add_argument("--base-url", default=PRODUCTION_BASE_URL)
|
|
2006
|
+
parser.add_argument("--allow-nonproduction-endpoint", action="store_true")
|
|
2007
|
+
parser.add_argument("--allow-untested-version", action="store_true")
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
def _add_query_common(parser: argparse.ArgumentParser) -> None:
|
|
2011
|
+
parser.add_argument("--mode", choices=("lookup", "federated"), default="lookup")
|
|
2012
|
+
parser.add_argument("--kp", action="append", default=[])
|
|
2013
|
+
parser.add_argument("--result-limit", type=int)
|
|
2014
|
+
parser.add_argument("--acknowledge-public-query", action="store_true", required=True)
|
|
2015
|
+
parser.add_argument("--output-dir", required=True)
|
|
2016
|
+
_add_network_policy_options(parser)
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
2020
|
+
parser = argparse.ArgumentParser(
|
|
2021
|
+
description="Bounded NCATS Translator ARAX lookup and provenance inspection"
|
|
2022
|
+
)
|
|
2023
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
2024
|
+
|
|
2025
|
+
preflight = subparsers.add_parser("preflight", help="verify the ARAX OpenAPI and versions")
|
|
2026
|
+
preflight.add_argument("--output-dir")
|
|
2027
|
+
_add_network_policy_options(preflight)
|
|
2028
|
+
|
|
2029
|
+
normalize = subparsers.add_parser("normalize", help="normalize one term or CURIE for review")
|
|
2030
|
+
normalize.add_argument("term")
|
|
2031
|
+
normalize.add_argument("--expected-category")
|
|
2032
|
+
normalize.add_argument("--max-synonyms", type=int, default=10)
|
|
2033
|
+
normalize.add_argument("--acknowledge-public-query", action="store_true", required=True)
|
|
2034
|
+
normalize.add_argument("--output-dir", required=True)
|
|
2035
|
+
_add_network_policy_options(normalize)
|
|
2036
|
+
|
|
2037
|
+
one_hop = subparsers.add_parser("one-hop", help="run a typed one-hop lookup")
|
|
2038
|
+
one_hop.add_argument("--subject-id", action=RejectRepeatedValueAction)
|
|
2039
|
+
one_hop.add_argument("--subject-category", required=True)
|
|
2040
|
+
one_hop.add_argument("--predicate", action="append", required=True)
|
|
2041
|
+
one_hop.add_argument("--object-id", action=RejectRepeatedValueAction)
|
|
2042
|
+
one_hop.add_argument("--object-category", required=True)
|
|
2043
|
+
one_hop.add_argument("--qualifier", action="append", default=[])
|
|
2044
|
+
_add_query_common(one_hop)
|
|
2045
|
+
|
|
2046
|
+
two_hop = subparsers.add_parser("two-hop", help="run an endpoint-pinned two-hop lookup")
|
|
2047
|
+
two_hop.add_argument("--subject-id", required=True, action=RejectRepeatedValueAction)
|
|
2048
|
+
two_hop.add_argument("--subject-category", required=True)
|
|
2049
|
+
two_hop.add_argument("--predicate-1", action="append", required=True)
|
|
2050
|
+
two_hop.add_argument("--intermediate-category", required=True)
|
|
2051
|
+
two_hop.add_argument("--predicate-2", action="append", required=True)
|
|
2052
|
+
two_hop.add_argument("--object-id", required=True, action=RejectRepeatedValueAction)
|
|
2053
|
+
two_hop.add_argument("--object-category", required=True)
|
|
2054
|
+
two_hop.add_argument("--qualifier-1", action="append", default=[])
|
|
2055
|
+
two_hop.add_argument("--qualifier-2", action="append", default=[])
|
|
2056
|
+
two_hop.add_argument(
|
|
2057
|
+
"--expand-order", choices=("right-first", "left-first"), default="right-first"
|
|
2058
|
+
)
|
|
2059
|
+
_add_query_common(two_hop)
|
|
2060
|
+
|
|
2061
|
+
summarize = subparsers.add_parser("summarize", help="inspect a saved supported ARAX response")
|
|
2062
|
+
summarize.add_argument("--request", required=True)
|
|
2063
|
+
summarize.add_argument("--response", required=True)
|
|
2064
|
+
summarize.add_argument("--format", choices=("text", "json"), default="text")
|
|
2065
|
+
return parser
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
2069
|
+
parser = build_parser()
|
|
2070
|
+
args = parser.parse_args(argv)
|
|
2071
|
+
try:
|
|
2072
|
+
if args.command == "preflight":
|
|
2073
|
+
return handle_preflight(args)
|
|
2074
|
+
if args.command == "normalize":
|
|
2075
|
+
return handle_normalize(args)
|
|
2076
|
+
if args.command in {"one-hop", "two-hop"}:
|
|
2077
|
+
return handle_graph_query(args)
|
|
2078
|
+
if args.command == "summarize":
|
|
2079
|
+
return handle_summarize(args)
|
|
2080
|
+
raise UsageError(f"unsupported command: {args.command}")
|
|
2081
|
+
except AraxClientError as exc:
|
|
2082
|
+
print(f"error: {exc}", file=sys.stderr)
|
|
2083
|
+
return exc.exit_code
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
if __name__ == "__main__":
|
|
2087
|
+
raise SystemExit(main())
|