chunk-your-tools 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. chunk_your_tools-1.0.1/.ast-grep/rule-tests/.gitkeep +0 -0
  2. chunk_your_tools-1.0.1/.ast-grep/rule-tests/Test.md +3 -0
  3. chunk_your_tools-1.0.1/.ast-grep/rules/.gitkeep +0 -0
  4. chunk_your_tools-1.0.1/.ast-grep/rules/Lint.md +12 -0
  5. chunk_your_tools-1.0.1/.ast-grep/rules/avoid-mktemp-python.yml +75 -0
  6. chunk_your_tools-1.0.1/.ast-grep/rules/avoid-nested-links-tsx.yml +8 -0
  7. chunk_your_tools-1.0.1/.ast-grep/rules/avoid_app_run_with_bad_host-python.yml +74 -0
  8. chunk_your_tools-1.0.1/.ast-grep/rules/debug-enabled-python.yml +93 -0
  9. chunk_your_tools-1.0.1/.ast-grep/rules/find-import-file-without-extension-ts.yml +17 -0
  10. chunk_your_tools-1.0.1/.ast-grep/rules/hashids-with-django-secret-python.yml +284 -0
  11. chunk_your_tools-1.0.1/.ast-grep/rules/hashids-with-flask-secret-python.yml +202 -0
  12. chunk_your_tools-1.0.1/.ast-grep/rules/incorrect-return-type.yaml +52 -0
  13. chunk_your_tools-1.0.1/.ast-grep/rules/insecure-cipher-algorithm-rc4-python.yml +79 -0
  14. chunk_your_tools-1.0.1/.ast-grep/rules/insecure-cors-config.yaml +49 -0
  15. chunk_your_tools-1.0.1/.ast-grep/rules/jwt-python-hardcoded-secret-python.yml +119 -0
  16. chunk_your_tools-1.0.1/.ast-grep/rules/litellm-hardcoded-secret-python.yml +26 -0
  17. chunk_your_tools-1.0.1/.ast-grep/rules/missing-component-decorator-ts.yml +26 -0
  18. chunk_your_tools-1.0.1/.ast-grep/rules/missing-sse-upload.yaml +52 -0
  19. chunk_your_tools-1.0.1/.ast-grep/rules/no-await-in-promise-all-ts.yml +9 -0
  20. chunk_your_tools-1.0.1/.ast-grep/rules/no-console-except-catch-ts.yml +10 -0
  21. chunk_your_tools-1.0.1/.ast-grep/rules/no-print-statements.yaml +63 -0
  22. chunk_your_tools-1.0.1/.ast-grep/rules/openai-hardcoded-secret-python.yml +25 -0
  23. chunk_your_tools-1.0.1/.ast-grep/rules/openrouter-hardcoded-secret-python.yml +25 -0
  24. chunk_your_tools-1.0.1/.ast-grep/rules/optional-to-none-union.yaml +37 -0
  25. chunk_your_tools-1.0.1/.ast-grep/rules/prefer-generator-expressions.yaml +53 -0
  26. chunk_your_tools-1.0.1/.ast-grep/rules/pytest-fixture-return-type.yaml +22 -0
  27. chunk_your_tools-1.0.1/.ast-grep/rules/pytest-fixture-type-hints.yaml +38 -0
  28. chunk_your_tools-1.0.1/.ast-grep/rules/python-elasticsearch-hardcoded-bearer-auth-python.yml +70 -0
  29. chunk_your_tools-1.0.1/.ast-grep/rules/python-ldap3-empty-password-python.yml +99 -0
  30. chunk_your_tools-1.0.1/.ast-grep/rules/python-ldap3-hardcoded-secret-python.yml +153 -0
  31. chunk_your_tools-1.0.1/.ast-grep/rules/python-peewee-pg-empty-password-python.yml +56 -0
  32. chunk_your_tools-1.0.1/.ast-grep/rules/python-peewee-pg-hardcoded-secret-python.yml +54 -0
  33. chunk_your_tools-1.0.1/.ast-grep/rules/python-pg8000-empty-password-python.yml +49 -0
  34. chunk_your_tools-1.0.1/.ast-grep/rules/python-pg8000-hardcoded-secret-python.yml +73 -0
  35. chunk_your_tools-1.0.1/.ast-grep/rules/python-psycopg2-empty-password-python.yml +70 -0
  36. chunk_your_tools-1.0.1/.ast-grep/rules/python-psycopg2-hardcoded-secret-python.yml +69 -0
  37. chunk_your_tools-1.0.1/.ast-grep/rules/python-pyjwt-hardcoded-secret-python.yml +48 -0
  38. chunk_your_tools-1.0.1/.ast-grep/rules/python-pymongo-empty-password-python.yml +88 -0
  39. chunk_your_tools-1.0.1/.ast-grep/rules/python-redis-empty-password-python.yml +71 -0
  40. chunk_your_tools-1.0.1/.ast-grep/rules/python-redis-hardcoded-secret-python.yml +70 -0
  41. chunk_your_tools-1.0.1/.ast-grep/rules/python-requests-empty-password-python.yml +55 -0
  42. chunk_your_tools-1.0.1/.ast-grep/rules/python-requests-hardcoded-secret-python.yml +155 -0
  43. chunk_your_tools-1.0.1/.ast-grep/rules/python-requests-oauth-hardcoded-secret-python.yml +290 -0
  44. chunk_your_tools-1.0.1/.ast-grep/rules/python-tormysql-empty-password-python.yml +313 -0
  45. chunk_your_tools-1.0.1/.ast-grep/rules/python-tormysql-hardcoded-secret-python.yml +303 -0
  46. chunk_your_tools-1.0.1/.ast-grep/rules/python-urllib3-hardcoded-secret-python.yml +58 -0
  47. chunk_your_tools-1.0.1/.ast-grep/rules/python-webrepl-empty-password-python.yml +55 -0
  48. chunk_your_tools-1.0.1/.ast-grep/rules/python-webrepl-hardcoded-secret-python.yml +53 -0
  49. chunk_your_tools-1.0.1/.ast-grep/rules/rewrite-mobx-component-tsx.yml +7 -0
  50. chunk_your_tools-1.0.1/.ast-grep/rules/security-detect-angular-sce-disabled-js.yml +18 -0
  51. chunk_your_tools-1.0.1/.ast-grep/rules/security-detect-angular-sce-disabled-ts.yml +38 -0
  52. chunk_your_tools-1.0.1/.ast-grep/rules/security-express-session-hardcoded-secret-js.yml +106 -0
  53. chunk_your_tools-1.0.1/.ast-grep/rules/security-express-session-hardcoded-secret-ts.yml +207 -0
  54. chunk_your_tools-1.0.1/.ast-grep/rules/security-jwt-simple-noverify-js.yml +45 -0
  55. chunk_your_tools-1.0.1/.ast-grep/rules/security-jwt-simple-noverify-ts.yml +116 -0
  56. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-rsa-weak-key-js.yml +581 -0
  57. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-rsa-weak-key-ts.yml +1490 -0
  58. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-sequelize-empty-password-argument-js.yml +195 -0
  59. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-sequelize-empty-password-argument-ts.yml +173 -0
  60. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-sequelize-hardcoded-secret-argument-js.yml +97 -0
  61. chunk_your_tools-1.0.1/.ast-grep/rules/security-node-sequelize-hardcoded-secret-argument-ts.yml +158 -0
  62. chunk_your_tools-1.0.1/.ast-grep/rules/security-plaintext-http-link-html.yml +78 -0
  63. chunk_your_tools-1.0.1/.ast-grep/rules/securityexpress-jwt-hardcoded-secret-js.yml +295 -0
  64. chunk_your_tools-1.0.1/.ast-grep/rules/speed-up-barrel-import-ts.yml +22 -0
  65. chunk_your_tools-1.0.1/.ast-grep/rules/sqlalchemy-mapped-column.yaml +13 -0
  66. chunk_your_tools-1.0.1/.ast-grep/rules/upgrade-ant-design-vue-html.yml +24 -0
  67. chunk_your_tools-1.0.1/.ast-grep/rules/use-walrus-operator.yaml +32 -0
  68. chunk_your_tools-1.0.1/.ast-grep/utils/.gitkeep +0 -0
  69. chunk_your_tools-1.0.1/.cursorignore +15 -0
  70. chunk_your_tools-1.0.1/.env.example +2 -0
  71. chunk_your_tools-1.0.1/.github/workflows/ci.yml +96 -0
  72. chunk_your_tools-1.0.1/.github/workflows/e2e-published-sdk.yml +178 -0
  73. chunk_your_tools-1.0.1/.github/workflows/publish-c-ffi.yml +230 -0
  74. chunk_your_tools-1.0.1/.github/workflows/publish-crates.yml +102 -0
  75. chunk_your_tools-1.0.1/.github/workflows/publish-npm-sdk.yml +313 -0
  76. chunk_your_tools-1.0.1/.github/workflows/publish-pypi-sdk.yml +203 -0
  77. chunk_your_tools-1.0.1/.github/workflows/sdk-c-go.yml +178 -0
  78. chunk_your_tools-1.0.1/.gitignore +149 -0
  79. chunk_your_tools-1.0.1/.gitleaks.toml +14 -0
  80. chunk_your_tools-1.0.1/.markdownlint-cli2.yaml +28 -0
  81. chunk_your_tools-1.0.1/.markdownlintignore +2 -0
  82. chunk_your_tools-1.0.1/.osgrepignore +9 -0
  83. chunk_your_tools-1.0.1/.pre-commit-config.yaml +619 -0
  84. chunk_your_tools-1.0.1/.python-version +1 -0
  85. chunk_your_tools-1.0.1/.secrets.baseline +137 -0
  86. chunk_your_tools-1.0.1/.talismanrc +46 -0
  87. chunk_your_tools-1.0.1/CHANGELOG.md +25 -0
  88. chunk_your_tools-1.0.1/CONFIG.md +564 -0
  89. chunk_your_tools-1.0.1/Cargo.lock +847 -0
  90. chunk_your_tools-1.0.1/Cargo.toml +52 -0
  91. chunk_your_tools-1.0.1/DEV.md +66 -0
  92. chunk_your_tools-1.0.1/EXECUTOR.md +58 -0
  93. chunk_your_tools-1.0.1/LICENSE +201 -0
  94. chunk_your_tools-1.0.1/LIMITATIONS.md +115 -0
  95. chunk_your_tools-1.0.1/MIGRATION.md +57 -0
  96. chunk_your_tools-1.0.1/PKG-INFO +30 -0
  97. chunk_your_tools-1.0.1/README.md +107 -0
  98. chunk_your_tools-1.0.1/build.rs +20 -0
  99. chunk_your_tools-1.0.1/cbindgen.toml +63 -0
  100. chunk_your_tools-1.0.1/chunk_your_tools.h +520 -0
  101. chunk_your_tools-1.0.1/commitlint.config.js +1 -0
  102. chunk_your_tools-1.0.1/committed.toml +3 -0
  103. chunk_your_tools-1.0.1/count_request_tokens.py +45 -0
  104. chunk_your_tools-1.0.1/debug/README.md +154 -0
  105. chunk_your_tools-1.0.1/debug/example.json +88 -0
  106. chunk_your_tools-1.0.1/debug/full_example.json +7387 -0
  107. chunk_your_tools-1.0.1/deny.toml +32 -0
  108. chunk_your_tools-1.0.1/examples/go-git-smoke/.gitignore +4 -0
  109. chunk_your_tools-1.0.1/examples/go-git-smoke/README.md +62 -0
  110. chunk_your_tools-1.0.1/examples/go-git-smoke/ensure-ffi.sh +57 -0
  111. chunk_your_tools-1.0.1/examples/go-git-smoke/go.mod.in +9 -0
  112. chunk_your_tools-1.0.1/examples/go-git-smoke/main.go +35 -0
  113. chunk_your_tools-1.0.1/examples/go-git-smoke/prepare.sh +31 -0
  114. chunk_your_tools-1.0.1/examples/go-git-smoke/run.sh +17 -0
  115. chunk_your_tools-1.0.1/examples/providers/openrouter-anthropic.sh +3 -0
  116. chunk_your_tools-1.0.1/package-lock.json +179 -0
  117. chunk_your_tools-1.0.1/package.json +8 -0
  118. chunk_your_tools-1.0.1/pyproject.toml +59 -0
  119. chunk_your_tools-1.0.1/scripts/all-fallow.sh +9 -0
  120. chunk_your_tools-1.0.1/scripts/c-sdk-precommit.sh +51 -0
  121. chunk_your_tools-1.0.1/scripts/chunk-your-tools-cli.sh +32 -0
  122. chunk_your_tools-1.0.1/scripts/go-sdk-precommit.sh +65 -0
  123. chunk_your_tools-1.0.1/scripts/local-dev-lib.sh +534 -0
  124. chunk_your_tools-1.0.1/scripts/local-dev.sh +233 -0
  125. chunk_your_tools-1.0.1/scripts/prek-hook-groups.yaml +116 -0
  126. chunk_your_tools-1.0.1/scripts/prek-hook.sh +15 -0
  127. chunk_your_tools-1.0.1/scripts/prek-loop.sh +321 -0
  128. chunk_your_tools-1.0.1/scripts/psscriptanalyzer-docker.ps1 +46 -0
  129. chunk_your_tools-1.0.1/scripts/psscriptanalyzer-docker.sh +36 -0
  130. chunk_your_tools-1.0.1/scripts/publish-crates.sh +62 -0
  131. chunk_your_tools-1.0.1/scripts/publish-npm.sh +49 -0
  132. chunk_your_tools-1.0.1/scripts/publish-pypi.sh +49 -0
  133. chunk_your_tools-1.0.1/scripts/shorten-paths.sh +23 -0
  134. chunk_your_tools-1.0.1/scripts/sync-version.sh +207 -0
  135. chunk_your_tools-1.0.1/sdk/Taskfile.yml +243 -0
  136. chunk_your_tools-1.0.1/sdk/c/.clang-format +3 -0
  137. chunk_your_tools-1.0.1/sdk/c/.clang-tidy +16 -0
  138. chunk_your_tools-1.0.1/sdk/c/CMakeLists.txt +176 -0
  139. chunk_your_tools-1.0.1/sdk/c/README.md +117 -0
  140. chunk_your_tools-1.0.1/sdk/c/cmake/CYTConfig.cmake.in +32 -0
  141. chunk_your_tools-1.0.1/sdk/c/examples/basic.c +33 -0
  142. chunk_your_tools-1.0.1/sdk/c/examples/common.h +31 -0
  143. chunk_your_tools-1.0.1/sdk/c/examples/error_handling.c +35 -0
  144. chunk_your_tools-1.0.1/sdk/c/examples/policies.c +92 -0
  145. chunk_your_tools-1.0.1/sdk/c/examples/retrieve.c +74 -0
  146. chunk_your_tools-1.0.1/sdk/c/include/chunk_your_tools.h +520 -0
  147. chunk_your_tools-1.0.1/sdk/c/scripts/build-c-lib.sh +271 -0
  148. chunk_your_tools-1.0.1/sdk/e2e/README.md +89 -0
  149. chunk_your_tools-1.0.1/sdk/e2e/go/.gitignore +1 -0
  150. chunk_your_tools-1.0.1/sdk/e2e/go/example_snapshot.go +205 -0
  151. chunk_your_tools-1.0.1/sdk/e2e/go/go.mod.in +7 -0
  152. chunk_your_tools-1.0.1/sdk/e2e/go/policies_smoke_test.go +42 -0
  153. chunk_your_tools-1.0.1/sdk/e2e/go/registry_smoke_test.go +93 -0
  154. chunk_your_tools-1.0.1/sdk/e2e/python/.gitignore +1 -0
  155. chunk_your_tools-1.0.1/sdk/e2e/python/pyproject.toml.in +11 -0
  156. chunk_your_tools-1.0.1/sdk/e2e/python/tests/conftest.py +30 -0
  157. chunk_your_tools-1.0.1/sdk/e2e/python/tests/example_snapshot.py +104 -0
  158. chunk_your_tools-1.0.1/sdk/e2e/python/tests/helpers.py +1 -0
  159. chunk_your_tools-1.0.1/sdk/e2e/python/tests/test_registry_smoke.py +64 -0
  160. chunk_your_tools-1.0.1/sdk/e2e/python/tests/test_tokens_smoke.py +9 -0
  161. chunk_your_tools-1.0.1/sdk/e2e/rust/.gitignore +1 -0
  162. chunk_your_tools-1.0.1/sdk/e2e/rust/Cargo.toml.in +11 -0
  163. chunk_your_tools-1.0.1/sdk/e2e/rust/tests/registry_smoke.rs +78 -0
  164. chunk_your_tools-1.0.1/sdk/e2e/rust/tests/support/example_snapshot.rs +189 -0
  165. chunk_your_tools-1.0.1/sdk/e2e/rust/tests/tokens_smoke.rs +10 -0
  166. chunk_your_tools-1.0.1/sdk/e2e/scripts/build-staging-c-lib.sh +74 -0
  167. chunk_your_tools-1.0.1/sdk/e2e/scripts/ensure-release-native.sh +50 -0
  168. chunk_your_tools-1.0.1/sdk/e2e/scripts/host-rust-target.sh +5 -0
  169. chunk_your_tools-1.0.1/sdk/e2e/scripts/parse-version.sh +22 -0
  170. chunk_your_tools-1.0.1/sdk/e2e/scripts/prepare-release-checkout.sh +47 -0
  171. chunk_your_tools-1.0.1/sdk/e2e/scripts/render-manifests.sh +107 -0
  172. chunk_your_tools-1.0.1/sdk/e2e/scripts/resolve-version-from-parent.sh +37 -0
  173. chunk_your_tools-1.0.1/sdk/e2e/scripts/run-all.sh +21 -0
  174. chunk_your_tools-1.0.1/sdk/e2e/scripts/run-local.sh +152 -0
  175. chunk_your_tools-1.0.1/sdk/e2e/scripts/run-target.sh +90 -0
  176. chunk_your_tools-1.0.1/sdk/e2e/scripts/uv-sync-with-retry.sh +22 -0
  177. chunk_your_tools-1.0.1/sdk/e2e/scripts/wait-registry.sh +124 -0
  178. chunk_your_tools-1.0.1/sdk/e2e/typescript/.fallowrc.json +9 -0
  179. chunk_your_tools-1.0.1/sdk/e2e/typescript/.gitignore +2 -0
  180. chunk_your_tools-1.0.1/sdk/e2e/typescript/package.json.in +11 -0
  181. chunk_your_tools-1.0.1/sdk/e2e/typescript/test/example-file.test.mjs +54 -0
  182. chunk_your_tools-1.0.1/sdk/e2e/typescript/test/example-snapshot.mjs +228 -0
  183. chunk_your_tools-1.0.1/sdk/e2e/typescript/test/policies-smoke.test.mjs +10 -0
  184. chunk_your_tools-1.0.1/sdk/e2e/typescript/test/registry-smoke.test.mjs +84 -0
  185. chunk_your_tools-1.0.1/sdk/e2e/typescript/test/run.mjs +35 -0
  186. chunk_your_tools-1.0.1/sdk/e2e/typescript/tsconfig.json +21 -0
  187. chunk_your_tools-1.0.1/sdk/go/README.md +85 -0
  188. chunk_your_tools-1.0.1/sdk/go/build.go +105 -0
  189. chunk_your_tools-1.0.1/sdk/go/catalog_io.go +6 -0
  190. chunk_your_tools-1.0.1/sdk/go/cgo_lib.go +1142 -0
  191. chunk_your_tools-1.0.1/sdk/go/chunk_your_tools.go +26 -0
  192. chunk_your_tools-1.0.1/sdk/go/chunk_your_tools_test.go +60 -0
  193. chunk_your_tools-1.0.1/sdk/go/cmd/chunk-native-ensure/main.go +500 -0
  194. chunk_your_tools-1.0.1/sdk/go/cmd/chunk-native-ensure/main_test.go +185 -0
  195. chunk_your_tools-1.0.1/sdk/go/cmd/chunk-native-ensure/module.go +55 -0
  196. chunk_your_tools-1.0.1/sdk/go/cmd/chunk-native-ensure/triplet.go +95 -0
  197. chunk_your_tools-1.0.1/sdk/go/go.mod +82 -0
  198. chunk_your_tools-1.0.1/sdk/go/go.sum +197 -0
  199. chunk_your_tools-1.0.1/sdk/go/moduleversion/version.go +4 -0
  200. chunk_your_tools-1.0.1/sdk/go/native/.gitignore +2 -0
  201. chunk_your_tools-1.0.1/sdk/go/parity_test.go +274 -0
  202. chunk_your_tools-1.0.1/sdk/go/paths.go +66 -0
  203. chunk_your_tools-1.0.1/sdk/go/policies.go +161 -0
  204. chunk_your_tools-1.0.1/sdk/go/policies_batch.go +7 -0
  205. chunk_your_tools-1.0.1/sdk/go/policies_helpers.go +106 -0
  206. chunk_your_tools-1.0.1/sdk/go/policy_context.go +66 -0
  207. chunk_your_tools-1.0.1/sdk/go/retrieve.go +97 -0
  208. chunk_your_tools-1.0.1/sdk/go/runtime.go +36 -0
  209. chunk_your_tools-1.0.1/sdk/go/scripts/install-llvm-mingw.ps1 +47 -0
  210. chunk_your_tools-1.0.1/sdk/go/scripts/prepare-windows-cgo.sh +64 -0
  211. chunk_your_tools-1.0.1/sdk/go/tokens.go +17 -0
  212. chunk_your_tools-1.0.1/sdk/go/tokens_batch.go +6 -0
  213. chunk_your_tools-1.0.1/sdk/go/version.go +7 -0
  214. chunk_your_tools-1.0.1/sdk/python/.gitignore +2 -0
  215. chunk_your_tools-1.0.1/sdk/python/README.md +14 -0
  216. chunk_your_tools-1.0.1/sdk/python/pyproject.toml +59 -0
  217. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/__init__.py +114 -0
  218. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/build.py +137 -0
  219. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/catalog_io.py +54 -0
  220. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/paths.py +117 -0
  221. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/policies.py +372 -0
  222. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/py.typed +0 -0
  223. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/retrieve.py +133 -0
  224. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/runtime_defaults.py +69 -0
  225. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/survivors.py +30 -0
  226. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/tokens.py +48 -0
  227. chunk_your_tools-1.0.1/sdk/python/src/chunk_your_tools/version.py +12 -0
  228. chunk_your_tools-1.0.1/sdk/python/tests/test_smoke.py +48 -0
  229. chunk_your_tools-1.0.1/sdk/typescript/.fallowrc.json +5 -0
  230. chunk_your_tools-1.0.1/sdk/typescript/LICENSE +201 -0
  231. chunk_your_tools-1.0.1/sdk/typescript/README.md +34 -0
  232. chunk_your_tools-1.0.1/sdk/typescript/package-lock.json +1922 -0
  233. chunk_your_tools-1.0.1/sdk/typescript/package.json +60 -0
  234. chunk_your_tools-1.0.1/sdk/typescript/src/build.ts +113 -0
  235. chunk_your_tools-1.0.1/sdk/typescript/src/catalog-io.ts +16 -0
  236. chunk_your_tools-1.0.1/sdk/typescript/src/core.ts +7 -0
  237. chunk_your_tools-1.0.1/sdk/typescript/src/decomposed-catalog.ts +6 -0
  238. chunk_your_tools-1.0.1/sdk/typescript/src/index.ts +71 -0
  239. chunk_your_tools-1.0.1/sdk/typescript/src/native.ts +139 -0
  240. chunk_your_tools-1.0.1/sdk/typescript/src/paths.ts +87 -0
  241. chunk_your_tools-1.0.1/sdk/typescript/src/policies.ts +435 -0
  242. chunk_your_tools-1.0.1/sdk/typescript/src/retrieve.ts +198 -0
  243. chunk_your_tools-1.0.1/sdk/typescript/src/runtime-defaults.ts +54 -0
  244. chunk_your_tools-1.0.1/sdk/typescript/src/survivors.ts +26 -0
  245. chunk_your_tools-1.0.1/sdk/typescript/src/test/build.test.ts +83 -0
  246. chunk_your_tools-1.0.1/sdk/typescript/src/test/parity.test.ts +182 -0
  247. chunk_your_tools-1.0.1/sdk/typescript/src/test/paths.test.ts +76 -0
  248. chunk_your_tools-1.0.1/sdk/typescript/src/test/policies.test.ts +58 -0
  249. chunk_your_tools-1.0.1/sdk/typescript/src/test/smoke.test.ts +160 -0
  250. chunk_your_tools-1.0.1/sdk/typescript/src/tokens.ts +27 -0
  251. chunk_your_tools-1.0.1/sdk/typescript/src/types.ts +17 -0
  252. chunk_your_tools-1.0.1/sdk/typescript/tsconfig.json +19 -0
  253. chunk_your_tools-1.0.1/search/prek-loop.sh +78 -0
  254. chunk_your_tools-1.0.1/sgconfig.yml +2 -0
  255. chunk_your_tools-1.0.1/src/bin/chunk-your-tools.rs +200 -0
  256. chunk_your_tools-1.0.1/src/bindings/cbindgen_stubs.rs +170 -0
  257. chunk_your_tools-1.0.1/src/bindings/manifest.rs +194 -0
  258. chunk_your_tools-1.0.1/src/bindings/mod.rs +3 -0
  259. chunk_your_tools-1.0.1/src/build.rs +691 -0
  260. chunk_your_tools-1.0.1/src/catalog_builder.rs +100 -0
  261. chunk_your_tools-1.0.1/src/catalog_io.rs +124 -0
  262. chunk_your_tools-1.0.1/src/chunk_your_tools/__init__.py +114 -0
  263. chunk_your_tools-1.0.1/src/chunk_your_tools/build.py +137 -0
  264. chunk_your_tools-1.0.1/src/chunk_your_tools/catalog_io.py +54 -0
  265. chunk_your_tools-1.0.1/src/chunk_your_tools/paths.py +117 -0
  266. chunk_your_tools-1.0.1/src/chunk_your_tools/policies.py +372 -0
  267. chunk_your_tools-1.0.1/src/chunk_your_tools/py.typed +0 -0
  268. chunk_your_tools-1.0.1/src/chunk_your_tools/retrieve.py +133 -0
  269. chunk_your_tools-1.0.1/src/chunk_your_tools/runtime_defaults.py +69 -0
  270. chunk_your_tools-1.0.1/src/chunk_your_tools/survivors.py +30 -0
  271. chunk_your_tools-1.0.1/src/chunk_your_tools/tokens.py +48 -0
  272. chunk_your_tools-1.0.1/src/chunk_your_tools/version.py +12 -0
  273. chunk_your_tools-1.0.1/src/ffi/catalog.rs +217 -0
  274. chunk_your_tools-1.0.1/src/ffi/catalog_io.rs +202 -0
  275. chunk_your_tools-1.0.1/src/ffi/error.rs +77 -0
  276. chunk_your_tools-1.0.1/src/ffi/json_util.rs +156 -0
  277. chunk_your_tools-1.0.1/src/ffi/memory.rs +47 -0
  278. chunk_your_tools-1.0.1/src/ffi/mod.rs +31 -0
  279. chunk_your_tools-1.0.1/src/ffi/paths.rs +152 -0
  280. chunk_your_tools-1.0.1/src/ffi/policies.rs +842 -0
  281. chunk_your_tools-1.0.1/src/ffi/retrieve.rs +429 -0
  282. chunk_your_tools-1.0.1/src/ffi/runtime.rs +81 -0
  283. chunk_your_tools-1.0.1/src/ffi/tokens.rs +124 -0
  284. chunk_your_tools-1.0.1/src/json_util.rs +12 -0
  285. chunk_your_tools-1.0.1/src/lib.rs +83 -0
  286. chunk_your_tools-1.0.1/src/node.rs +559 -0
  287. chunk_your_tools-1.0.1/src/paths.rs +290 -0
  288. chunk_your_tools-1.0.1/src/policies.rs +1617 -0
  289. chunk_your_tools-1.0.1/src/policies_node.rs +718 -0
  290. chunk_your_tools-1.0.1/src/policies_python.rs +832 -0
  291. chunk_your_tools-1.0.1/src/python.rs +686 -0
  292. chunk_your_tools-1.0.1/src/retrieve.rs +948 -0
  293. chunk_your_tools-1.0.1/src/runtime_config.rs +76 -0
  294. chunk_your_tools-1.0.1/src/survivors.rs +257 -0
  295. chunk_your_tools-1.0.1/src/tiktoken/config.rs +32 -0
  296. chunk_your_tools-1.0.1/src/tiktoken/mod.rs +197 -0
  297. chunk_your_tools-1.0.1/src/tokens_node.rs +62 -0
  298. chunk_your_tools-1.0.1/src/tokens_python.rs +47 -0
  299. chunk_your_tools-1.0.1/src/tool_entries.rs +212 -0
  300. chunk_your_tools-1.0.1/tests/ffi_policies.rs +221 -0
  301. chunk_your_tools-1.0.1/tests/ffi_smoke.rs +62 -0
  302. chunk_your_tools-1.0.1/tests/integration.rs +71 -0
  303. chunk_your_tools-1.0.1/typings/Stemmer.pyi +5 -0
  304. chunk_your_tools-1.0.1/typings/brotli.pyi +1 -0
  305. chunk_your_tools-1.0.1/typings/fastmcp/__init__.pyi +7 -0
  306. chunk_your_tools-1.0.1/typings/libsql_experimental/__init__.pyi +10 -0
  307. chunk_your_tools-1.0.1/typings/uuid_extensions/__init__.pyi +4 -0
  308. chunk_your_tools-1.0.1/typos.toml +8 -0
File without changes
@@ -0,0 +1,3 @@
1
+ # Test the rule
2
+
3
+ <https://github.com/ast-grep/ast-grep.github.io/blob/main/website/guide/test-rule.md>
File without changes
@@ -0,0 +1,12 @@
1
+ # Lint Rule
2
+
3
+ <https://github.com/ast-grep/ast-grep.github.io/blob/main/website/guide/project/lint-rule.md>
4
+
5
+ ## Rule Catalog
6
+
7
+ <https://github.com/ast-grep/ast-grep.github.io/tree/main/website/catalog/python>
8
+ <https://github.com/ast-grep/ast-grep.github.io/tree/main/website/catalog/yaml>
9
+ <https://github.com/ast-grep/ast-grep.github.io/tree/main/website/catalog/typescript>
10
+ <https://github.com/ast-grep/ast-grep.github.io/tree/main/website/catalog/html>
11
+
12
+ <https://github.com/coderabbitai/ast-grep-essentials/tree/main/rules>
@@ -0,0 +1,75 @@
1
+ id: avoid-mktemp-python
2
+ language: python
3
+ severity: warning
4
+ message: >-
5
+ The function `mktemp` is deprecated. When using this function, it is
6
+ possible for an attacker to modify the created file before the filename is
7
+ returned. Use `NamedTemporaryFile()` instead and pass it the
8
+ `delete=False` parameter.
9
+ note: >-
10
+ [CWE-377]: Insecure Temporary File
11
+ [OWASP A01:2021]: Broken Access Control
12
+ [REFERENCES]
13
+ https://docs.python.org/3/library/tempfile.html#tempfile.mktemp
14
+ https://owasp.org/Top10/A01_2021-Broken_Access_Control
15
+ ast-grep-essentials: true
16
+ utils:
17
+ match_call:
18
+ kind: call
19
+ all:
20
+ - has:
21
+ stopBy: end
22
+ kind: attribute
23
+ field: function
24
+ all:
25
+ - has:
26
+ stopBy: end
27
+ kind: identifier
28
+ field: object
29
+ regex: "^tempfile$"
30
+ - has:
31
+ stopBy: end
32
+ kind: identifier
33
+ field: attribute
34
+ regex: "^mktemp$"
35
+ - has:
36
+ stopBy: end
37
+ kind: argument_list
38
+ field: arguments
39
+ match_second_call:
40
+ kind: call
41
+ all:
42
+ - has:
43
+ stopBy: end
44
+ kind: identifier
45
+ field: function
46
+ regex: "^mktemp$"
47
+ - has:
48
+ stopBy: end
49
+ kind: argument_list
50
+ field: arguments
51
+ inside:
52
+ stopBy: end
53
+ kind: expression_statement
54
+ follows:
55
+ stopBy: end
56
+ kind: import_from_statement
57
+ all:
58
+ - has:
59
+ kind: dotted_name
60
+ field: module_name
61
+ has:
62
+ kind: identifier
63
+ regex: "^tempfile$"
64
+ - has:
65
+ stopBy: end
66
+ kind: dotted_name
67
+ field: name
68
+ has:
69
+ stopBy: end
70
+ kind: identifier
71
+ regex: "^mktemp$"
72
+ rule:
73
+ any:
74
+ - matches: match_call
75
+ - matches: match_second_call
@@ -0,0 +1,8 @@
1
+ id: no-nested-links
2
+ language: tsx
3
+ severity: error
4
+ rule:
5
+ pattern: <a $$$>$$$A</a>
6
+ has:
7
+ pattern: <a $$$>$$$</a>
8
+ stopBy: end
@@ -0,0 +1,74 @@
1
+ id: avoid_app_run_with_bad_host-python
2
+ language: python
3
+ severity: warning
4
+ message: >-
5
+ Running flask app with host 0.0.0.0 could expose the server publicly.
6
+ note: >-
7
+ [CWE-668]: Exposure of Resource to Wrong Sphere
8
+ [OWASP A01:2021]: Broken Access Control
9
+ [REFERENCES]
10
+ https://owasp.org/Top10/A01_2021-Broken_Access_Control
11
+ ast-grep-essentials: true
12
+ utils:
13
+ MATCH_PATTERN_app.run:
14
+ kind: call
15
+ all:
16
+ - has:
17
+ stopBy: neighbor
18
+ kind: attribute
19
+ all:
20
+ - has:
21
+ stopBy: neighbor
22
+ kind: identifier
23
+ regex: "^app$"
24
+ - has:
25
+ stopBy: neighbor
26
+ kind: identifier
27
+ regex: "^run$"
28
+ - has:
29
+ stopBy: neighbor
30
+ kind: argument_list
31
+ has:
32
+ stopBy: neighbor
33
+ kind: string
34
+ regex: ^"0.0.0.0"$
35
+
36
+ MATCH_PATTERN_app.run_HOST:
37
+ kind: call
38
+ all:
39
+ - has:
40
+ stopBy: neighbor
41
+ kind: attribute
42
+ all:
43
+ - has:
44
+ stopBy: neighbor
45
+ kind: identifier
46
+ regex: "^app$"
47
+ - has:
48
+ stopBy: neighbor
49
+ kind: identifier
50
+ regex: "^run$"
51
+ - has:
52
+ stopBy: neighbor
53
+ kind: argument_list
54
+ has:
55
+ stopBy: neighbor
56
+ kind: keyword_argument
57
+ all:
58
+ - has:
59
+ stopBy: neighbor
60
+ kind: identifier
61
+ regex: "^host$"
62
+ - has:
63
+ stopBy: neighbor
64
+ kind: string
65
+ regex: ^"0.0.0.0"$
66
+ - has:
67
+ stopBy: neighbor
68
+ regex: "^=$"
69
+
70
+ rule:
71
+ kind: call
72
+ any:
73
+ - matches: MATCH_PATTERN_app.run
74
+ - matches: MATCH_PATTERN_app.run_HOST
@@ -0,0 +1,93 @@
1
+ id: debug-enabled-python
2
+ severity: warning
3
+ language: python
4
+ message: >-
5
+ Detected Flask app with debug=True. Do not deploy to production with
6
+ this flag enabled as it will leak sensitive information. Instead, consider
7
+ using Flask configuration variables or setting 'debug' using system
8
+ environment variables.
9
+ note: >-
10
+ [CWE-489] Active Debug Code.
11
+ [REFERENCES]
12
+ - https://labs.detectify.com/2015/10/02/how-patreon-got-hacked-publicly-exposed-werkzeug-debugger/
13
+ ast-grep-essentials: true
14
+ utils:
15
+ MATCH_PATTERN_debug=True:
16
+ kind: call
17
+ all:
18
+ - has:
19
+ stopBy: neighbor
20
+ kind: attribute
21
+ all:
22
+ - has:
23
+ stopBy: neighbor
24
+ kind: identifier
25
+ regex: "^app$"
26
+ - has:
27
+ stopBy: neighbor
28
+ kind: identifier
29
+ regex: "^run$"
30
+ - has:
31
+ stopBy: neighbor
32
+ kind: argument_list
33
+ has:
34
+ stopBy: neighbor
35
+ kind: keyword_argument
36
+ regex: "^debug=True$"
37
+ - any:
38
+ - inside:
39
+ stopBy: end
40
+ kind: if_statement
41
+ follows:
42
+ stopBy: end
43
+ kind: import_from_statement
44
+ has:
45
+ stopBy: end
46
+ kind: dotted_name
47
+ has:
48
+ stopBy: neighbor
49
+ kind: identifier
50
+ regex: "^Flask$"
51
+ - inside:
52
+ stopBy: end
53
+ kind: function_definition
54
+ follows:
55
+ stopBy: end
56
+ kind: import_from_statement
57
+ has:
58
+ stopBy: end
59
+ kind: dotted_name
60
+ has:
61
+ stopBy: neighbor
62
+ kind: identifier
63
+ regex: "^Flask$"
64
+ - inside:
65
+ stopBy: end
66
+ kind: expression_statement
67
+ follows:
68
+ stopBy: end
69
+ kind: import_from_statement
70
+ has:
71
+ stopBy: end
72
+ kind: dotted_name
73
+ has:
74
+ stopBy: neighbor
75
+ kind: identifier
76
+ regex: "^Flask$"
77
+ - inside:
78
+ stopBy: end
79
+ kind: decorated_definition
80
+ follows:
81
+ stopBy: end
82
+ kind: import_from_statement
83
+ has:
84
+ stopBy: end
85
+ kind: dotted_name
86
+ has:
87
+ stopBy: neighbor
88
+ kind: identifier
89
+ regex: "^Flask$"
90
+ rule:
91
+ kind: call
92
+ any:
93
+ - matches: MATCH_PATTERN_debug=True
@@ -0,0 +1,17 @@
1
+ id: find-import-file
2
+ message: Local file imports should include file extensions (.ts, .js, etc). Exclude npm packages.
3
+ language: js
4
+ severity: info
5
+ rule:
6
+ regex: "^\\./[^.]+[^/]$"
7
+ kind: string_fragment
8
+ any:
9
+ - inside:
10
+ stopBy: end
11
+ kind: import_statement
12
+ - inside:
13
+ stopBy: end
14
+ kind: call_expression
15
+ has:
16
+ field: function
17
+ regex: "^import$"
@@ -0,0 +1,284 @@
1
+ id: hashids-with-django-secret-python
2
+ language: python
3
+ severity: warning
4
+ message: >-
5
+ The Django secret key is used as salt in HashIDs. The HashID mechanism
6
+ is not secure. By observing sufficient HashIDs, the salt used to construct
7
+ them can be recovered. This means the Django secret key can be obtained by
8
+ attackers, through the HashIDs.
9
+ note: >-
10
+ [CWE-327]: Use of a Broken or Risky Cryptographic Algorithm
11
+ [OWASP A02:2021]: Cryptographic Failures
12
+ [REFERENCES]
13
+ https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-SECRET_KEY
14
+ http://carnage.github.io/2015/08/cryptanalysis-of-hashids
15
+ ast-grep-essentials: true
16
+ utils:
17
+ Hashids(salt=settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH):
18
+ kind: call
19
+ all:
20
+ - has:
21
+ kind: identifier
22
+ nthChild: 1
23
+ regex: ^Hashids$
24
+ - has:
25
+ kind: argument_list
26
+ nthChild: 2
27
+ has:
28
+ kind: keyword_argument
29
+ all:
30
+ - has:
31
+ kind: identifier
32
+ regex: ^salt$
33
+ - has:
34
+ kind: attribute
35
+ all:
36
+ - has:
37
+ kind: identifier
38
+ regex: ^settings$
39
+ nthChild: 1
40
+ - has:
41
+ kind: identifier
42
+ nthChild: 2
43
+ regex: ^SECRET_KEY$
44
+ - all:
45
+ - any:
46
+ - inside:
47
+ stopBy: end
48
+ follows:
49
+ stopBy: end
50
+ kind: import_from_statement
51
+ pattern: from django.conf import settings
52
+ - follows:
53
+ stopBy: end
54
+ kind: import_from_statement
55
+ pattern: from django.conf import settings
56
+ - any:
57
+ - inside:
58
+ stopBy: end
59
+ follows:
60
+ stopBy: end
61
+ kind: import_from_statement
62
+ pattern: from hashids import Hashids
63
+ - follows:
64
+ stopBy: end
65
+ kind: import_from_statement
66
+ pattern: from hashids import Hashids
67
+
68
+ Hashids(settings.SECRET_KEY, min_length=length, alphabet=alphabet):
69
+ kind: call
70
+ all:
71
+ - has:
72
+ kind: identifier
73
+ nthChild: 1
74
+ regex: ^Hashids$
75
+ - has:
76
+ kind: argument_list
77
+ nthChild: 2
78
+ has:
79
+ kind: attribute
80
+ all:
81
+ - has:
82
+ kind: identifier
83
+ regex: ^settings$
84
+ nthChild: 1
85
+ - has:
86
+ kind: identifier
87
+ nthChild: 2
88
+ regex: ^SECRET_KEY$
89
+ - all:
90
+ - any:
91
+ - inside:
92
+ stopBy: end
93
+ follows:
94
+ stopBy: end
95
+ kind: import_from_statement
96
+ pattern: from django.conf import settings
97
+ - follows:
98
+ stopBy: end
99
+ kind: import_from_statement
100
+ pattern: from django.conf import settings
101
+ - any:
102
+ - inside:
103
+ stopBy: end
104
+ follows:
105
+ stopBy: end
106
+ kind: import_from_statement
107
+ pattern: from hashids import Hashids
108
+ - follows:
109
+ stopBy: end
110
+ kind: import_from_statement
111
+ pattern: from hashids import Hashids
112
+
113
+ hashids.Hashids(salt=settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH):
114
+ kind: call
115
+ all:
116
+ - has:
117
+ kind: attribute
118
+ regex: ^hashids.Hashids$
119
+ - has:
120
+ kind: argument_list
121
+ nthChild: 2
122
+ has:
123
+ kind: keyword_argument
124
+ all:
125
+ - has:
126
+ kind: identifier
127
+ regex: ^salt$
128
+ - has:
129
+ kind: attribute
130
+ all:
131
+ - has:
132
+ kind: identifier
133
+ regex: ^settings$
134
+ nthChild: 1
135
+ - has:
136
+ kind: identifier
137
+ nthChild: 2
138
+ regex: ^SECRET_KEY$
139
+ - any:
140
+ - inside:
141
+ stopBy: end
142
+ follows:
143
+ stopBy: end
144
+ kind: import_from_statement
145
+ pattern: from django.conf import settings
146
+ - follows:
147
+ stopBy: end
148
+ kind: import_from_statement
149
+ pattern: from django.conf import settings
150
+
151
+ hashids.Hashids(settings.SECRET_KEY, min_length=length, alphabet=alphabet):
152
+ kind: call
153
+ all:
154
+ - has:
155
+ kind: attribute
156
+ nthChild: 1
157
+ regex: ^hashids.Hashids$
158
+ - has:
159
+ kind: argument_list
160
+ nthChild: 2
161
+ has:
162
+ kind: attribute
163
+ all:
164
+ - has:
165
+ kind: identifier
166
+ regex: ^settings$
167
+ nthChild: 1
168
+ - has:
169
+ kind: identifier
170
+ nthChild: 2
171
+ regex: ^SECRET_KEY$
172
+ - all:
173
+ - any:
174
+ - inside:
175
+ stopBy: end
176
+ follows:
177
+ stopBy: end
178
+ kind: import_from_statement
179
+ pattern: from django.conf import settings
180
+ - follows:
181
+ stopBy: end
182
+ kind: import_from_statement
183
+ pattern: from django.conf import settings
184
+
185
+ hashids.Hashids(salt=django.conf.settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH):
186
+ kind: call
187
+ all:
188
+ - has:
189
+ kind: attribute
190
+ nthChild: 1
191
+ regex: ^hashids.Hashids$
192
+ - has:
193
+ kind: argument_list
194
+ nthChild: 2
195
+ has:
196
+ kind: keyword_argument
197
+ all:
198
+ - has:
199
+ kind: identifier
200
+ regex: ^salt$
201
+ - has:
202
+ kind: attribute
203
+ regex: ^django.conf.settings.SECRET_KEY$
204
+
205
+ hashids.Hashids(django.conf.settings.SECRET_KEY, min_length=length, alphabet=alphabet):
206
+ kind: call
207
+ all:
208
+ - has:
209
+ kind: attribute
210
+ nthChild: 1
211
+ regex: ^hashids.Hashids$
212
+ - has:
213
+ kind: argument_list
214
+ nthChild: 2
215
+ has:
216
+ kind: attribute
217
+ regex: ^django.conf.settings.SECRET_KEY$
218
+
219
+ Hashids(django.conf.settings.SECRET_KEY, min_length=length, alphabet=alphabet):
220
+ kind: call
221
+ all:
222
+ - has:
223
+ kind: identifier
224
+ nthChild: 1
225
+ regex: ^Hashids$
226
+ - has:
227
+ kind: argument_list
228
+ nthChild: 2
229
+ has:
230
+ kind: attribute
231
+ regex: ^django.conf.settings.SECRET_KEY$
232
+ - any:
233
+ - inside:
234
+ stopBy: end
235
+ follows:
236
+ stopBy: end
237
+ kind: import_from_statement
238
+ pattern: from hashids import Hashids
239
+ - follows:
240
+ stopBy: end
241
+ kind: import_from_statement
242
+ pattern: from hashids import Hashids
243
+
244
+ Hashids(salt=django.conf.settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH):
245
+ kind: call
246
+ all:
247
+ - has:
248
+ kind: identifier
249
+ nthChild: 1
250
+ regex: ^Hashids$
251
+ - has:
252
+ kind: argument_list
253
+ nthChild: 2
254
+ has:
255
+ kind: keyword_argument
256
+ all:
257
+ - has:
258
+ kind: identifier
259
+ regex: ^salt$
260
+ - has:
261
+ kind: attribute
262
+ regex: ^django.conf.settings.SECRET_KEY$
263
+ - any:
264
+ - inside:
265
+ stopBy: end
266
+ follows:
267
+ stopBy: end
268
+ kind: import_from_statement
269
+ pattern: from hashids import Hashids
270
+ - follows:
271
+ stopBy: end
272
+ kind: import_from_statement
273
+ pattern: from hashids import Hashids
274
+
275
+ rule:
276
+ any:
277
+ - matches: Hashids(salt=settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH)
278
+ - matches: Hashids(settings.SECRET_KEY, min_length=length, alphabet=alphabet)
279
+ - matches: hashids.Hashids(salt=settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH)
280
+ - matches: hashids.Hashids(settings.SECRET_KEY, min_length=length, alphabet=alphabet)
281
+ - matches: hashids.Hashids(salt=django.conf.settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH)
282
+ - matches: hashids.Hashids(django.conf.settings.SECRET_KEY, min_length=length, alphabet=alphabet)
283
+ - matches: Hashids(django.conf.settings.SECRET_KEY, min_length=length, alphabet=alphabet)
284
+ - matches: Hashids(salt=django.conf.settings.SECRET_KEY, min_length=settings.ID_HASH_MIN_LENGTH)