@vltpkg/query 1.0.0-rc.8 → 1.0.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.
Files changed (463) hide show
  1. package/dist/{esm/attribute.d.ts → attribute.d.ts} +0 -1
  2. package/dist/{esm/attribute.js → attribute.js} +0 -1
  3. package/dist/{esm/combinator.d.ts → combinator.d.ts} +0 -1
  4. package/dist/{esm/combinator.js → combinator.js} +0 -1
  5. package/dist/{esm/id.d.ts → id.d.ts} +0 -1
  6. package/dist/{esm/id.js → id.js} +0 -1
  7. package/dist/{esm/index.d.ts → index.d.ts} +3 -3
  8. package/dist/{esm/index.js → index.js} +14 -8
  9. package/dist/{esm/parser.d.ts → parser.d.ts} +0 -1
  10. package/dist/{esm/parser.js → parser.js} +2 -2
  11. package/dist/{esm/pseudo → pseudo}/abandoned.d.ts +0 -1
  12. package/dist/{esm/pseudo → pseudo}/abandoned.js +0 -1
  13. package/dist/{esm/pseudo → pseudo}/attr.d.ts +0 -1
  14. package/dist/{esm/pseudo → pseudo}/attr.js +0 -1
  15. package/dist/{esm/pseudo → pseudo}/built.d.ts +0 -1
  16. package/dist/{esm/pseudo → pseudo}/built.js +0 -1
  17. package/dist/{esm/pseudo → pseudo}/confused.d.ts +0 -1
  18. package/dist/{esm/pseudo → pseudo}/confused.js +0 -1
  19. package/dist/{esm/pseudo → pseudo}/cve.d.ts +6 -3
  20. package/dist/pseudo/cve.js +61 -0
  21. package/dist/{esm/pseudo → pseudo}/cwe.d.ts +6 -3
  22. package/dist/pseudo/cwe.js +61 -0
  23. package/dist/{esm/pseudo → pseudo}/debug.d.ts +0 -1
  24. package/dist/{esm/pseudo → pseudo}/debug.js +0 -1
  25. package/dist/{esm/pseudo → pseudo}/deprecated.d.ts +0 -1
  26. package/dist/{esm/pseudo → pseudo}/deprecated.js +0 -1
  27. package/dist/{esm/pseudo → pseudo}/dev.d.ts +0 -1
  28. package/dist/{esm/pseudo → pseudo}/dev.js +0 -1
  29. package/dist/pseudo/diff.d.ts +26 -0
  30. package/dist/pseudo/diff.js +75 -0
  31. package/dist/pseudo/dist.d.ts +22 -0
  32. package/dist/pseudo/dist.js +110 -0
  33. package/dist/{esm/pseudo → pseudo}/dynamic.d.ts +0 -1
  34. package/dist/{esm/pseudo → pseudo}/dynamic.js +0 -1
  35. package/dist/{esm/pseudo → pseudo}/empty.d.ts +0 -1
  36. package/dist/{esm/pseudo → pseudo}/empty.js +0 -1
  37. package/dist/{esm/pseudo → pseudo}/entropic.d.ts +0 -1
  38. package/dist/{esm/pseudo → pseudo}/entropic.js +0 -1
  39. package/dist/{esm/pseudo → pseudo}/env.d.ts +0 -1
  40. package/dist/{esm/pseudo → pseudo}/env.js +0 -1
  41. package/dist/{esm/pseudo → pseudo}/eval.d.ts +0 -1
  42. package/dist/{esm/pseudo → pseudo}/eval.js +0 -1
  43. package/dist/{esm/pseudo → pseudo}/fs.d.ts +0 -1
  44. package/dist/{esm/pseudo → pseudo}/fs.js +0 -1
  45. package/dist/{esm/pseudo → pseudo}/helpers.d.ts +0 -1
  46. package/dist/{esm/pseudo → pseudo}/helpers.js +1 -2
  47. package/dist/{esm/pseudo → pseudo}/host.d.ts +0 -1
  48. package/dist/{esm/pseudo → pseudo}/host.js +0 -1
  49. package/dist/pseudo/hostname.d.ts +11 -0
  50. package/dist/pseudo/hostname.js +140 -0
  51. package/dist/{esm/pseudo → pseudo}/license.d.ts +0 -1
  52. package/dist/{esm/pseudo → pseudo}/license.js +0 -1
  53. package/dist/{esm/pseudo → pseudo}/link.d.ts +0 -1
  54. package/dist/{esm/pseudo → pseudo}/link.js +0 -1
  55. package/dist/pseudo/malware.d.ts +10 -0
  56. package/dist/pseudo/malware.js +26 -0
  57. package/dist/{esm/pseudo → pseudo}/minified.d.ts +0 -1
  58. package/dist/{esm/pseudo → pseudo}/minified.js +0 -1
  59. package/dist/{esm/pseudo → pseudo}/missing.d.ts +0 -1
  60. package/dist/{esm/pseudo → pseudo}/missing.js +0 -1
  61. package/dist/{esm/pseudo → pseudo}/native.d.ts +0 -1
  62. package/dist/{esm/pseudo → pseudo}/native.js +0 -1
  63. package/dist/{esm/pseudo → pseudo}/network.d.ts +0 -1
  64. package/dist/{esm/pseudo → pseudo}/network.js +0 -1
  65. package/dist/{esm/pseudo → pseudo}/obfuscated.d.ts +0 -1
  66. package/dist/{esm/pseudo → pseudo}/obfuscated.js +0 -1
  67. package/dist/{esm/pseudo → pseudo}/optional.d.ts +0 -1
  68. package/dist/{esm/pseudo → pseudo}/optional.js +0 -1
  69. package/dist/{esm/pseudo → pseudo}/outdated.d.ts +0 -1
  70. package/dist/{esm/pseudo → pseudo}/outdated.js +0 -1
  71. package/dist/{esm/pseudo → pseudo}/overridden.d.ts +0 -1
  72. package/dist/{esm/pseudo → pseudo}/overridden.js +0 -1
  73. package/dist/{esm/pseudo → pseudo}/path.d.ts +0 -1
  74. package/dist/{esm/pseudo → pseudo}/path.js +1 -4
  75. package/dist/{esm/pseudo → pseudo}/peer.d.ts +0 -1
  76. package/dist/{esm/pseudo → pseudo}/peer.js +0 -1
  77. package/dist/{esm/pseudo → pseudo}/prerelease.d.ts +0 -1
  78. package/dist/{esm/pseudo → pseudo}/prerelease.js +0 -1
  79. package/dist/{esm/pseudo → pseudo}/private.d.ts +0 -1
  80. package/dist/{esm/pseudo → pseudo}/private.js +0 -1
  81. package/dist/{esm/pseudo → pseudo}/prod.d.ts +0 -1
  82. package/dist/{esm/pseudo → pseudo}/prod.js +0 -1
  83. package/dist/{esm/pseudo → pseudo}/published.d.ts +0 -1
  84. package/dist/{esm/pseudo → pseudo}/published.js +0 -1
  85. package/dist/pseudo/registry.d.ts +10 -0
  86. package/dist/pseudo/registry.js +24 -0
  87. package/dist/{esm/pseudo → pseudo}/root.d.ts +0 -1
  88. package/dist/{esm/pseudo → pseudo}/root.js +0 -1
  89. package/dist/{esm/pseudo → pseudo}/scanned.d.ts +0 -1
  90. package/dist/{esm/pseudo → pseudo}/scanned.js +0 -1
  91. package/dist/{esm/pseudo → pseudo}/score.d.ts +0 -1
  92. package/dist/{esm/pseudo → pseudo}/score.js +0 -1
  93. package/dist/{esm/pseudo → pseudo}/scripts.d.ts +0 -1
  94. package/dist/{esm/pseudo → pseudo}/scripts.js +1 -2
  95. package/dist/{esm/pseudo → pseudo}/semver.d.ts +3 -2
  96. package/dist/{esm/pseudo → pseudo}/semver.js +43 -7
  97. package/dist/{esm/pseudo → pseudo}/severity.d.ts +0 -1
  98. package/dist/{esm/pseudo → pseudo}/severity.js +0 -1
  99. package/dist/{esm/pseudo → pseudo}/shell.d.ts +0 -1
  100. package/dist/{esm/pseudo → pseudo}/shell.js +0 -1
  101. package/dist/{esm/pseudo → pseudo}/shrinkwrap.d.ts +0 -1
  102. package/dist/{esm/pseudo → pseudo}/shrinkwrap.js +0 -1
  103. package/dist/{esm/pseudo → pseudo}/spec.d.ts +0 -1
  104. package/dist/{esm/pseudo → pseudo}/spec.js +0 -1
  105. package/dist/{esm/pseudo → pseudo}/squat.d.ts +0 -1
  106. package/dist/{esm/pseudo → pseudo}/squat.js +0 -1
  107. package/dist/{esm/pseudo → pseudo}/suspicious.d.ts +0 -1
  108. package/dist/{esm/pseudo → pseudo}/suspicious.js +0 -1
  109. package/dist/{esm/pseudo → pseudo}/tracker.d.ts +0 -1
  110. package/dist/{esm/pseudo → pseudo}/tracker.js +0 -1
  111. package/dist/{esm/pseudo → pseudo}/trivial.d.ts +0 -1
  112. package/dist/{esm/pseudo → pseudo}/trivial.js +0 -1
  113. package/dist/{esm/pseudo → pseudo}/type.d.ts +0 -1
  114. package/dist/{esm/pseudo → pseudo}/type.js +0 -1
  115. package/dist/{esm/pseudo → pseudo}/undesirable.d.ts +0 -1
  116. package/dist/{esm/pseudo → pseudo}/undesirable.js +0 -1
  117. package/dist/{esm/pseudo → pseudo}/unknown.d.ts +0 -1
  118. package/dist/{esm/pseudo → pseudo}/unknown.js +0 -1
  119. package/dist/{esm/pseudo → pseudo}/unmaintained.d.ts +0 -1
  120. package/dist/{esm/pseudo → pseudo}/unmaintained.js +0 -1
  121. package/dist/{esm/pseudo → pseudo}/unpopular.d.ts +0 -1
  122. package/dist/{esm/pseudo → pseudo}/unpopular.js +0 -1
  123. package/dist/{esm/pseudo → pseudo}/unstable.d.ts +0 -1
  124. package/dist/{esm/pseudo → pseudo}/unstable.js +0 -1
  125. package/dist/pseudo/vuln.d.ts +22 -0
  126. package/dist/pseudo/vuln.js +220 -0
  127. package/dist/{esm/pseudo → pseudo}/workspace.d.ts +0 -1
  128. package/dist/{esm/pseudo → pseudo}/workspace.js +0 -1
  129. package/dist/{esm/pseudo.d.ts → pseudo.d.ts} +0 -1
  130. package/dist/{esm/pseudo.js → pseudo.js} +16 -1
  131. package/dist/{esm/types.d.ts → types.d.ts} +10 -3
  132. package/dist/types.js +1 -0
  133. package/package.json +46 -47
  134. package/skills/dss-query/REFERENCE.md +123 -0
  135. package/skills/dss-query/SKILL.md +190 -0
  136. package/skills/dss-query/evals/README.md +79 -0
  137. package/skills/dss-query/evals/evals.json +89 -0
  138. package/skills/dss-query/evals/grade.mjs +480 -0
  139. package/src/attribute.ts +186 -0
  140. package/src/combinator.ts +132 -0
  141. package/src/id.ts +46 -0
  142. package/src/index.ts +620 -0
  143. package/src/parser.ts +122 -0
  144. package/src/pseudo/abandoned.ts +9 -0
  145. package/src/pseudo/attr.ts +92 -0
  146. package/src/pseudo/built.ts +19 -0
  147. package/src/pseudo/confused.ts +29 -0
  148. package/src/pseudo/cve.ts +93 -0
  149. package/src/pseudo/cwe.ts +97 -0
  150. package/src/pseudo/debug.ts +9 -0
  151. package/src/pseudo/deprecated.ts +9 -0
  152. package/src/pseudo/dev.ts +18 -0
  153. package/src/pseudo/diff.ts +90 -0
  154. package/src/pseudo/dist.ts +144 -0
  155. package/src/pseudo/dynamic.ts +9 -0
  156. package/src/pseudo/empty.ts +15 -0
  157. package/src/pseudo/entropic.ts +9 -0
  158. package/src/pseudo/env.ts +6 -0
  159. package/src/pseudo/eval.ts +9 -0
  160. package/src/pseudo/fs.ts +9 -0
  161. package/src/pseudo/helpers.ts +106 -0
  162. package/src/pseudo/host.ts +111 -0
  163. package/src/pseudo/hostname.ts +156 -0
  164. package/src/pseudo/license.ts +134 -0
  165. package/src/pseudo/link.ts +30 -0
  166. package/src/pseudo/malware.ts +41 -0
  167. package/src/pseudo/minified.ts +9 -0
  168. package/src/pseudo/missing.ts +16 -0
  169. package/src/pseudo/native.ts +9 -0
  170. package/src/pseudo/network.ts +9 -0
  171. package/src/pseudo/obfuscated.ts +9 -0
  172. package/src/pseudo/optional.ts +18 -0
  173. package/src/pseudo/outdated.ts +305 -0
  174. package/src/pseudo/overridden.ts +20 -0
  175. package/src/pseudo/path.ts +146 -0
  176. package/src/pseudo/peer.ts +18 -0
  177. package/src/pseudo/prerelease.ts +47 -0
  178. package/src/pseudo/private.ts +19 -0
  179. package/src/pseudo/prod.ts +18 -0
  180. package/src/pseudo/published.ts +248 -0
  181. package/src/pseudo/registry.ts +29 -0
  182. package/src/pseudo/root.ts +19 -0
  183. package/src/pseudo/scanned.ts +20 -0
  184. package/src/pseudo/score.ts +186 -0
  185. package/src/pseudo/scripts.ts +54 -0
  186. package/src/pseudo/semver.ts +320 -0
  187. package/src/pseudo/severity.ts +231 -0
  188. package/src/pseudo/shell.ts +9 -0
  189. package/src/pseudo/shrinkwrap.ts +9 -0
  190. package/src/pseudo/spec.ts +131 -0
  191. package/src/pseudo/squat.ts +225 -0
  192. package/src/pseudo/suspicious.ts +9 -0
  193. package/src/pseudo/tracker.ts +9 -0
  194. package/src/pseudo/trivial.ts +9 -0
  195. package/src/pseudo/type.ts +26 -0
  196. package/src/pseudo/undesirable.ts +9 -0
  197. package/src/pseudo/unknown.ts +9 -0
  198. package/src/pseudo/unmaintained.ts +9 -0
  199. package/src/pseudo/unpopular.ts +9 -0
  200. package/src/pseudo/unstable.ts +9 -0
  201. package/src/pseudo/vuln.ts +273 -0
  202. package/src/pseudo/workspace.ts +22 -0
  203. package/src/pseudo.ts +413 -0
  204. package/src/types.ts +165 -0
  205. package/tap-snapshots/test/attribute.ts.test.cjs +304 -0
  206. package/tap-snapshots/test/combinator.ts.test.cjs +333 -0
  207. package/tap-snapshots/test/id.ts.test.cjs +118 -0
  208. package/tap-snapshots/test/parser.ts.test.cjs +344 -0
  209. package/tap-snapshots/test/pseudo/abandoned.ts.test.cjs +18 -0
  210. package/tap-snapshots/test/pseudo/attr.ts.test.cjs +161 -0
  211. package/tap-snapshots/test/pseudo/built.ts.test.cjs +70 -0
  212. package/tap-snapshots/test/pseudo/confused.ts.test.cjs +32 -0
  213. package/tap-snapshots/test/pseudo/cve.ts.test.cjs +49 -0
  214. package/tap-snapshots/test/pseudo/cwe.ts.test.cjs +49 -0
  215. package/tap-snapshots/test/pseudo/debug.ts.test.cjs +18 -0
  216. package/tap-snapshots/test/pseudo/deprecated.ts.test.cjs +18 -0
  217. package/tap-snapshots/test/pseudo/dist.ts.test.cjs +30 -0
  218. package/tap-snapshots/test/pseudo/dynamic.ts.test.cjs +18 -0
  219. package/tap-snapshots/test/pseudo/empty.ts.test.cjs +50 -0
  220. package/tap-snapshots/test/pseudo/entropic.ts.test.cjs +18 -0
  221. package/tap-snapshots/test/pseudo/env.ts.test.cjs +18 -0
  222. package/tap-snapshots/test/pseudo/eval.ts.test.cjs +18 -0
  223. package/tap-snapshots/test/pseudo/fs.ts.test.cjs +18 -0
  224. package/tap-snapshots/test/pseudo/helpers.ts.test.cjs +18 -0
  225. package/tap-snapshots/test/pseudo/hostname.ts.test.cjs +148 -0
  226. package/tap-snapshots/test/pseudo/license.ts.test.cjs +41 -0
  227. package/tap-snapshots/test/pseudo/link.ts.test.cjs +36 -0
  228. package/tap-snapshots/test/pseudo/malware.ts.test.cjs +22 -0
  229. package/tap-snapshots/test/pseudo/minified.ts.test.cjs +18 -0
  230. package/tap-snapshots/test/pseudo/missing.ts.test.cjs +30 -0
  231. package/tap-snapshots/test/pseudo/native.ts.test.cjs +18 -0
  232. package/tap-snapshots/test/pseudo/network.ts.test.cjs +18 -0
  233. package/tap-snapshots/test/pseudo/obfuscated.ts.test.cjs +18 -0
  234. package/tap-snapshots/test/pseudo/outdated.ts.test.cjs +130 -0
  235. package/tap-snapshots/test/pseudo/overridden.ts.test.cjs +75 -0
  236. package/tap-snapshots/test/pseudo/prerelease.ts.test.cjs +101 -0
  237. package/tap-snapshots/test/pseudo/private.ts.test.cjs +38 -0
  238. package/tap-snapshots/test/pseudo/published.ts.test.cjs +171 -0
  239. package/tap-snapshots/test/pseudo/registry.ts.test.cjs +68 -0
  240. package/tap-snapshots/test/pseudo/root.ts.test.cjs +24 -0
  241. package/tap-snapshots/test/pseudo/scanned.ts.test.cjs +18 -0
  242. package/tap-snapshots/test/pseudo/score.ts.test.cjs +239 -0
  243. package/tap-snapshots/test/pseudo/scripts.ts.test.cjs +61 -0
  244. package/tap-snapshots/test/pseudo/semver.ts.test.cjs +575 -0
  245. package/tap-snapshots/test/pseudo/severity.ts.test.cjs +95 -0
  246. package/tap-snapshots/test/pseudo/shell.ts.test.cjs +18 -0
  247. package/tap-snapshots/test/pseudo/shrinkwrap.ts.test.cjs +18 -0
  248. package/tap-snapshots/test/pseudo/spec.ts.test.cjs +148 -0
  249. package/tap-snapshots/test/pseudo/squat.ts.test.cjs +129 -0
  250. package/tap-snapshots/test/pseudo/suspicious.ts.test.cjs +18 -0
  251. package/tap-snapshots/test/pseudo/tracker.ts.test.cjs +18 -0
  252. package/tap-snapshots/test/pseudo/trivial.ts.test.cjs +18 -0
  253. package/tap-snapshots/test/pseudo/type.ts.test.cjs +51 -0
  254. package/tap-snapshots/test/pseudo/undesirable.ts.test.cjs +18 -0
  255. package/tap-snapshots/test/pseudo/unknown.ts.test.cjs +18 -0
  256. package/tap-snapshots/test/pseudo/unmaintained.ts.test.cjs +18 -0
  257. package/tap-snapshots/test/pseudo/unpopular.ts.test.cjs +18 -0
  258. package/tap-snapshots/test/pseudo/unstable.ts.test.cjs +18 -0
  259. package/tap-snapshots/test/pseudo/vuln.ts.test.cjs +208 -0
  260. package/tap-snapshots/test/pseudo/vulnerable.ts.test.cjs +20 -0
  261. package/tap-snapshots/test/pseudo/workspace.ts.test.cjs +19 -0
  262. package/tap-snapshots/test/pseudo.ts.test.cjs +1247 -0
  263. package/test/attribute.ts +266 -0
  264. package/test/combinator.ts +168 -0
  265. package/test/fixtures/graph.ts +999 -0
  266. package/test/fixtures/selector.ts +103 -0
  267. package/test/fixtures/types.ts +7 -0
  268. package/test/id.ts +102 -0
  269. package/test/index.ts +1000 -0
  270. package/test/parser.ts +117 -0
  271. package/test/pseudo/abandoned.ts +98 -0
  272. package/test/pseudo/attr.ts +298 -0
  273. package/test/pseudo/built.ts +214 -0
  274. package/test/pseudo/confused.ts +160 -0
  275. package/test/pseudo/cve.ts +249 -0
  276. package/test/pseudo/cwe.ts +255 -0
  277. package/test/pseudo/debug.ts +98 -0
  278. package/test/pseudo/deprecated.ts +98 -0
  279. package/test/pseudo/dev.ts +61 -0
  280. package/test/pseudo/diff.ts +417 -0
  281. package/test/pseudo/dist.ts +215 -0
  282. package/test/pseudo/dynamic.ts +98 -0
  283. package/test/pseudo/empty.ts +108 -0
  284. package/test/pseudo/entropic.ts +101 -0
  285. package/test/pseudo/env.ts +98 -0
  286. package/test/pseudo/eval.ts +98 -0
  287. package/test/pseudo/fs.ts +98 -0
  288. package/test/pseudo/helpers.ts +370 -0
  289. package/test/pseudo/host-context.ts +276 -0
  290. package/test/pseudo/hostname.ts +314 -0
  291. package/test/pseudo/license.ts +265 -0
  292. package/test/pseudo/link.ts +94 -0
  293. package/test/pseudo/malware.ts +184 -0
  294. package/test/pseudo/minified.ts +98 -0
  295. package/test/pseudo/missing.ts +111 -0
  296. package/test/pseudo/native.ts +98 -0
  297. package/test/pseudo/network.ts +98 -0
  298. package/test/pseudo/obfuscated.ts +98 -0
  299. package/test/pseudo/optional.ts +73 -0
  300. package/test/pseudo/outdated.ts +331 -0
  301. package/test/pseudo/overridden.ts +317 -0
  302. package/test/pseudo/path.ts +680 -0
  303. package/test/pseudo/peer.ts +101 -0
  304. package/test/pseudo/prerelease.ts +279 -0
  305. package/test/pseudo/private.ts +108 -0
  306. package/test/pseudo/prod.ts +61 -0
  307. package/test/pseudo/published.ts +557 -0
  308. package/test/pseudo/registry.ts +122 -0
  309. package/test/pseudo/root.ts +66 -0
  310. package/test/pseudo/scanned.ts +78 -0
  311. package/test/pseudo/score.ts +591 -0
  312. package/test/pseudo/scripts.ts +294 -0
  313. package/test/pseudo/semver.ts +822 -0
  314. package/test/pseudo/severity.ts +310 -0
  315. package/test/pseudo/shell.ts +98 -0
  316. package/test/pseudo/shrinkwrap.ts +98 -0
  317. package/test/pseudo/spec.ts +525 -0
  318. package/test/pseudo/squat.ts +565 -0
  319. package/test/pseudo/suspicious.ts +98 -0
  320. package/test/pseudo/tracker.ts +98 -0
  321. package/test/pseudo/trivial.ts +98 -0
  322. package/test/pseudo/type.ts +105 -0
  323. package/test/pseudo/undesirable.ts +98 -0
  324. package/test/pseudo/unknown.ts +98 -0
  325. package/test/pseudo/unmaintained.ts +98 -0
  326. package/test/pseudo/unpopular.ts +98 -0
  327. package/test/pseudo/unstable.ts +98 -0
  328. package/test/pseudo/vuln.ts +625 -0
  329. package/test/pseudo/vulnerable.ts +137 -0
  330. package/test/pseudo/workspace.ts +111 -0
  331. package/test/pseudo.ts +558 -0
  332. package/tsconfig.json +3 -0
  333. package/tsconfig.publish.json +19 -0
  334. package/tsconfig.publish.tsbuildinfo +1 -0
  335. package/typedoc.mjs +2 -0
  336. package/dist/esm/attribute.d.ts.map +0 -1
  337. package/dist/esm/attribute.js.map +0 -1
  338. package/dist/esm/combinator.d.ts.map +0 -1
  339. package/dist/esm/combinator.js.map +0 -1
  340. package/dist/esm/id.d.ts.map +0 -1
  341. package/dist/esm/id.js.map +0 -1
  342. package/dist/esm/index.d.ts.map +0 -1
  343. package/dist/esm/index.js.map +0 -1
  344. package/dist/esm/package.json +0 -3
  345. package/dist/esm/parser.d.ts.map +0 -1
  346. package/dist/esm/parser.js.map +0 -1
  347. package/dist/esm/pseudo/abandoned.d.ts.map +0 -1
  348. package/dist/esm/pseudo/abandoned.js.map +0 -1
  349. package/dist/esm/pseudo/attr.d.ts.map +0 -1
  350. package/dist/esm/pseudo/attr.js.map +0 -1
  351. package/dist/esm/pseudo/built.d.ts.map +0 -1
  352. package/dist/esm/pseudo/built.js.map +0 -1
  353. package/dist/esm/pseudo/confused.d.ts.map +0 -1
  354. package/dist/esm/pseudo/confused.js.map +0 -1
  355. package/dist/esm/pseudo/cve.d.ts.map +0 -1
  356. package/dist/esm/pseudo/cve.js +0 -44
  357. package/dist/esm/pseudo/cve.js.map +0 -1
  358. package/dist/esm/pseudo/cwe.d.ts.map +0 -1
  359. package/dist/esm/pseudo/cwe.js +0 -43
  360. package/dist/esm/pseudo/cwe.js.map +0 -1
  361. package/dist/esm/pseudo/debug.d.ts.map +0 -1
  362. package/dist/esm/pseudo/debug.js.map +0 -1
  363. package/dist/esm/pseudo/deprecated.d.ts.map +0 -1
  364. package/dist/esm/pseudo/deprecated.js.map +0 -1
  365. package/dist/esm/pseudo/dev.d.ts.map +0 -1
  366. package/dist/esm/pseudo/dev.js.map +0 -1
  367. package/dist/esm/pseudo/dynamic.d.ts.map +0 -1
  368. package/dist/esm/pseudo/dynamic.js.map +0 -1
  369. package/dist/esm/pseudo/empty.d.ts.map +0 -1
  370. package/dist/esm/pseudo/empty.js.map +0 -1
  371. package/dist/esm/pseudo/entropic.d.ts.map +0 -1
  372. package/dist/esm/pseudo/entropic.js.map +0 -1
  373. package/dist/esm/pseudo/env.d.ts.map +0 -1
  374. package/dist/esm/pseudo/env.js.map +0 -1
  375. package/dist/esm/pseudo/eval.d.ts.map +0 -1
  376. package/dist/esm/pseudo/eval.js.map +0 -1
  377. package/dist/esm/pseudo/fs.d.ts.map +0 -1
  378. package/dist/esm/pseudo/fs.js.map +0 -1
  379. package/dist/esm/pseudo/helpers.d.ts.map +0 -1
  380. package/dist/esm/pseudo/helpers.js.map +0 -1
  381. package/dist/esm/pseudo/host.d.ts.map +0 -1
  382. package/dist/esm/pseudo/host.js.map +0 -1
  383. package/dist/esm/pseudo/license.d.ts.map +0 -1
  384. package/dist/esm/pseudo/license.js.map +0 -1
  385. package/dist/esm/pseudo/link.d.ts.map +0 -1
  386. package/dist/esm/pseudo/link.js.map +0 -1
  387. package/dist/esm/pseudo/malware.d.ts +0 -24
  388. package/dist/esm/pseudo/malware.d.ts.map +0 -1
  389. package/dist/esm/pseudo/malware.js +0 -187
  390. package/dist/esm/pseudo/malware.js.map +0 -1
  391. package/dist/esm/pseudo/minified.d.ts.map +0 -1
  392. package/dist/esm/pseudo/minified.js.map +0 -1
  393. package/dist/esm/pseudo/missing.d.ts.map +0 -1
  394. package/dist/esm/pseudo/missing.js.map +0 -1
  395. package/dist/esm/pseudo/native.d.ts.map +0 -1
  396. package/dist/esm/pseudo/native.js.map +0 -1
  397. package/dist/esm/pseudo/network.d.ts.map +0 -1
  398. package/dist/esm/pseudo/network.js.map +0 -1
  399. package/dist/esm/pseudo/obfuscated.d.ts.map +0 -1
  400. package/dist/esm/pseudo/obfuscated.js.map +0 -1
  401. package/dist/esm/pseudo/optional.d.ts.map +0 -1
  402. package/dist/esm/pseudo/optional.js.map +0 -1
  403. package/dist/esm/pseudo/outdated.d.ts.map +0 -1
  404. package/dist/esm/pseudo/outdated.js.map +0 -1
  405. package/dist/esm/pseudo/overridden.d.ts.map +0 -1
  406. package/dist/esm/pseudo/overridden.js.map +0 -1
  407. package/dist/esm/pseudo/path.d.ts.map +0 -1
  408. package/dist/esm/pseudo/path.js.map +0 -1
  409. package/dist/esm/pseudo/peer.d.ts.map +0 -1
  410. package/dist/esm/pseudo/peer.js.map +0 -1
  411. package/dist/esm/pseudo/prerelease.d.ts.map +0 -1
  412. package/dist/esm/pseudo/prerelease.js.map +0 -1
  413. package/dist/esm/pseudo/private.d.ts.map +0 -1
  414. package/dist/esm/pseudo/private.js.map +0 -1
  415. package/dist/esm/pseudo/prod.d.ts.map +0 -1
  416. package/dist/esm/pseudo/prod.js.map +0 -1
  417. package/dist/esm/pseudo/published.d.ts.map +0 -1
  418. package/dist/esm/pseudo/published.js.map +0 -1
  419. package/dist/esm/pseudo/root.d.ts.map +0 -1
  420. package/dist/esm/pseudo/root.js.map +0 -1
  421. package/dist/esm/pseudo/scanned.d.ts.map +0 -1
  422. package/dist/esm/pseudo/scanned.js.map +0 -1
  423. package/dist/esm/pseudo/score.d.ts.map +0 -1
  424. package/dist/esm/pseudo/score.js.map +0 -1
  425. package/dist/esm/pseudo/scripts.d.ts.map +0 -1
  426. package/dist/esm/pseudo/scripts.js.map +0 -1
  427. package/dist/esm/pseudo/semver.d.ts.map +0 -1
  428. package/dist/esm/pseudo/semver.js.map +0 -1
  429. package/dist/esm/pseudo/severity.d.ts.map +0 -1
  430. package/dist/esm/pseudo/severity.js.map +0 -1
  431. package/dist/esm/pseudo/shell.d.ts.map +0 -1
  432. package/dist/esm/pseudo/shell.js.map +0 -1
  433. package/dist/esm/pseudo/shrinkwrap.d.ts.map +0 -1
  434. package/dist/esm/pseudo/shrinkwrap.js.map +0 -1
  435. package/dist/esm/pseudo/spec.d.ts.map +0 -1
  436. package/dist/esm/pseudo/spec.js.map +0 -1
  437. package/dist/esm/pseudo/squat.d.ts.map +0 -1
  438. package/dist/esm/pseudo/squat.js.map +0 -1
  439. package/dist/esm/pseudo/suspicious.d.ts.map +0 -1
  440. package/dist/esm/pseudo/suspicious.js.map +0 -1
  441. package/dist/esm/pseudo/tracker.d.ts.map +0 -1
  442. package/dist/esm/pseudo/tracker.js.map +0 -1
  443. package/dist/esm/pseudo/trivial.d.ts.map +0 -1
  444. package/dist/esm/pseudo/trivial.js.map +0 -1
  445. package/dist/esm/pseudo/type.d.ts.map +0 -1
  446. package/dist/esm/pseudo/type.js.map +0 -1
  447. package/dist/esm/pseudo/undesirable.d.ts.map +0 -1
  448. package/dist/esm/pseudo/undesirable.js.map +0 -1
  449. package/dist/esm/pseudo/unknown.d.ts.map +0 -1
  450. package/dist/esm/pseudo/unknown.js.map +0 -1
  451. package/dist/esm/pseudo/unmaintained.d.ts.map +0 -1
  452. package/dist/esm/pseudo/unmaintained.js.map +0 -1
  453. package/dist/esm/pseudo/unpopular.d.ts.map +0 -1
  454. package/dist/esm/pseudo/unpopular.js.map +0 -1
  455. package/dist/esm/pseudo/unstable.d.ts.map +0 -1
  456. package/dist/esm/pseudo/unstable.js.map +0 -1
  457. package/dist/esm/pseudo/workspace.d.ts.map +0 -1
  458. package/dist/esm/pseudo/workspace.js.map +0 -1
  459. package/dist/esm/pseudo.d.ts.map +0 -1
  460. package/dist/esm/pseudo.js.map +0 -1
  461. package/dist/esm/types.d.ts.map +0 -1
  462. package/dist/esm/types.js +0 -2
  463. package/dist/esm/types.js.map +0 -1
@@ -18,11 +18,18 @@ export type GraphSelectionState = {
18
18
  nodes: Set<NodeLike>;
19
19
  edges: Set<EdgeLike>;
20
20
  };
21
+ /**
22
+ * Callback that returns changed file paths for a given
23
+ * commitish reference. Used by the :diff() pseudo selector.
24
+ * The returned paths should be relative to the project root.
25
+ */
26
+ export type DiffFilesProvider = (commitish: string) => Set<string>;
21
27
  export type ParserState = {
22
28
  cancellable: () => Promise<void>;
23
29
  collect: GraphSelectionState;
24
30
  comment: string;
25
31
  current: PostcssNode;
32
+ diffFiles?: DiffFilesProvider;
26
33
  hostContexts?: HostContextsMap;
27
34
  importers: Set<NodeLike>;
28
35
  initial: GraphSelectionState;
@@ -68,7 +75,7 @@ export type Insights = {
68
75
  eval?: boolean;
69
76
  fs?: boolean;
70
77
  license?: LicenseInsights;
71
- malware?: MalwareInsights;
78
+ malware?: boolean;
72
79
  minified?: boolean;
73
80
  native?: boolean;
74
81
  network?: boolean;
@@ -88,6 +95,7 @@ export type Insights = {
88
95
  unmaintained?: boolean;
89
96
  unpopular?: boolean;
90
97
  unstable?: boolean;
98
+ vuln?: VulnInsights;
91
99
  };
92
100
  export type LicenseInsights = {
93
101
  unlicensed: boolean;
@@ -105,8 +113,8 @@ export type LeveledInsights = {
105
113
  high: boolean;
106
114
  critical: boolean;
107
115
  };
108
- export type MalwareInsights = LeveledInsights;
109
116
  export type SeverityInsights = LeveledInsights;
117
+ export type VulnInsights = LeveledInsights;
110
118
  export type SquatInsights = {
111
119
  medium: boolean;
112
120
  critical: boolean;
@@ -115,4 +123,3 @@ export type ParserFn = (opt: ParserState) => Promise<ParserState>;
115
123
  export type ParsedSelectorToken = PostcssNode & {
116
124
  token: string;
117
125
  };
118
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,79 +1,78 @@
1
1
  {
2
2
  "name": "@vltpkg/query",
3
3
  "description": "Query syntax parser that retrieves items from a graph",
4
- "version": "1.0.0-rc.8",
4
+ "version": "1.0.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
8
8
  "directory": "src/query"
9
9
  },
10
- "author": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
11
- "tshy": {
12
- "selfLink": false,
13
- "liveDev": true,
14
- "dialects": [
15
- "esm"
16
- ],
17
- "exports": {
18
- "./package.json": "./package.json",
19
- ".": "./src/index.ts"
20
- }
10
+ "author": {
11
+ "name": "vlt technology inc.",
12
+ "email": "support@vlt.sh",
13
+ "url": "http://vlt.sh"
21
14
  },
22
15
  "dependencies": {
23
- "minimatch": "^10.0.3",
24
- "p-retry": "^7.0.0",
25
- "postcss-selector-parser": "^7.1.0",
26
- "@vltpkg/dep-id": "1.0.0-rc.8",
27
- "@vltpkg/dss-parser": "1.0.0-rc.8",
28
- "@vltpkg/error-cause": "1.0.0-rc.8",
29
- "@vltpkg/graph": "1.0.0-rc.8",
30
- "@vltpkg/types": "1.0.0-rc.8",
31
- "@vltpkg/security-archive": "1.0.0-rc.8",
32
- "@vltpkg/semver": "1.0.0-rc.8"
16
+ "@vltpkg/dep-id": "1.0.1",
17
+ "@vltpkg/dss-parser": "1.0.1",
18
+ "@vltpkg/error-cause": "1.0.1",
19
+ "@vltpkg/security-archive": "1.0.1",
20
+ "@vltpkg/semver": "1.0.1",
21
+ "@vltpkg/types": "1.0.1",
22
+ "minimatch": "^10.1.1",
23
+ "p-retry": "^7.1.1",
24
+ "postcss-selector-parser": "^7.1.1"
33
25
  },
34
26
  "devDependencies": {
35
- "@eslint/js": "^9.34.0",
36
- "@types/node": "^22.17.2",
37
- "eslint": "^9.34.0",
38
- "prettier": "^3.6.2",
39
- "tap": "^21.1.0",
40
- "tshy": "^3.0.2",
27
+ "@eslint/js": "^9.39.1",
28
+ "@types/node": "^22.19.2",
29
+ "@vltpkg/spec": "1.0.1",
30
+ "eslint": "^9.39.1",
31
+ "prettier": "^3.7.4",
32
+ "tap": "^21.5.0",
41
33
  "typedoc": "~0.27.9",
42
34
  "typescript": "5.7.3",
43
- "typescript-eslint": "^8.40.0",
44
- "@vltpkg/spec": "1.0.0-rc.8"
35
+ "typescript-eslint": "^8.49.0"
45
36
  },
46
37
  "license": "BSD-2-Clause-Patent",
47
38
  "engines": {
48
- "node": ">=22"
39
+ "node": ">=22.22.0"
40
+ },
41
+ "scripts": {
42
+ "format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
43
+ "format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
44
+ "lint": "eslint . --fix",
45
+ "lint:check": "eslint .",
46
+ "prepack": "tsc -p tsconfig.publish.json && ../../scripts/update-dist-exports.ts",
47
+ "snap": "tap",
48
+ "test": "tap",
49
+ "posttest": "tsc --noEmit",
50
+ "typecheck": "tsc --noEmit"
49
51
  },
50
52
  "tap": {
51
53
  "extends": "../../tap-config.yaml"
52
54
  },
53
55
  "prettier": "../../.prettierrc.js",
54
- "module": "./dist/esm/index.js",
56
+ "module": "./dist/index.js",
55
57
  "type": "module",
56
58
  "exports": {
57
59
  "./package.json": "./package.json",
58
60
  ".": {
59
61
  "import": {
60
- "types": "./dist/esm/index.d.ts",
61
- "default": "./dist/esm/index.js"
62
+ "default": "./dist/index.js"
62
63
  }
63
64
  }
64
65
  },
65
66
  "files": [
66
- "dist"
67
+ "dist",
68
+ "skills",
69
+ "!skills/dss-query/evals"
67
70
  ],
68
- "scripts": {
69
- "format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
70
- "format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
71
- "lint": "eslint . --fix",
72
- "lint:check": "eslint .",
73
- "snap": "tap",
74
- "test": "tap",
75
- "posttest": "tsc --noEmit",
76
- "tshy": "tshy",
77
- "typecheck": "tsc --noEmit"
78
- }
79
- }
71
+ "bugs": [
72
+ {
73
+ "type": "link",
74
+ "url": "https://github.com/vltpkg/vltpkg/issues"
75
+ }
76
+ ],
77
+ "homepage": "https://github.com/vltpkg/vltpkg/tree/main/src/query#readme"
78
+ }
@@ -0,0 +1,123 @@
1
+ # DSS Reference
2
+
3
+ Compiled from https://docs.vlt.io/cli/selectors/ (source:
4
+ `www/docs/src/content/docs/cli/selectors/`). When in doubt, check
5
+ those docs — they are canonical.
6
+
7
+ ## Attribute selectors
8
+
9
+ Match against `package.json` fields.
10
+
11
+ | Selector | Meaning |
12
+ | ---------------- | ------------------------------------------------ |
13
+ | `[attr]` | has the property |
14
+ | `[attr=value]` | equals |
15
+ | `[attr^=value]` | starts with |
16
+ | `[attr$=value]` | ends with |
17
+ | `[attr*=value]` | contains |
18
+ | `[attr~=value]` | whitespace-separated list contains |
19
+ | `[attr\|=value]` | equals value or starts with `value-` |
20
+ | `[attr=value i]` | case-insensitive (`s` = case-sensitive, default) |
21
+
22
+ Nested fields (e.g. `engines.node`) need `:attr()`:
23
+ `:attr(engines, [node])`,
24
+ `:attr(peerDependenciesMeta, foo, [optional=true])`.
25
+
26
+ `#foo` is shorthand for `[name=foo]`.
27
+
28
+ ## Combinators
29
+
30
+ | Combinator | Meaning |
31
+ | ---------- | -------------------------------------------------------------------- |
32
+ | `A > B` | B is a **direct** dependency of A (chain for depth: `:root > * > *`) |
33
+ | `A B` | B is a direct **or transitive** dependency of A |
34
+ | `A ~ B` | B shares a parent with A (sibling) |
35
+
36
+ ## Pseudo-states (no arguments)
37
+
38
+ Graph structure:
39
+
40
+ | Selector | Matches |
41
+ | ------------ | --------------------------------------- |
42
+ | `:root` | top-level package.json node |
43
+ | `:project` | root + all workspaces ("your code") |
44
+ | `:workspace` | workspaces from vlt.json |
45
+ | `:scope` | current selector scope (with `--scope`) |
46
+
47
+ Dependency type:
48
+
49
+ | Selector | Matches |
50
+ | ---------------------------------------- | ------------------------------------------------------ |
51
+ | `:prod` / `:dev` / `:optional` / `:peer` | by dependency type |
52
+ | `:missing` | declared but not installed (**edges only, not nodes**) |
53
+ | `:overridden` | has an override applied |
54
+
55
+ Package properties:
56
+
57
+ | Selector | Matches |
58
+ | ------------- | -------------------------------------------- |
59
+ | `:private` | `"private": true` |
60
+ | `:empty` | no dependencies |
61
+ | `:link` | linked packages |
62
+ | `:prerelease` | version has prerelease part (`1.0.0-beta.1`) |
63
+ | `:built` | built during reify |
64
+ | `:scanned` | has Socket security metadata |
65
+
66
+ ## Pseudo-classes (take arguments)
67
+
68
+ | Selector | Meaning | Example |
69
+ | ------------------- | --------------------------------------- | ---------------------------------------------- |
70
+ | `:attr(...)` | nested package.json property | `:attr(engines, [node])` |
71
+ | `:dist(tag)` | registry dist-tag | `:dist(latest)` |
72
+ | `:has(sel)` | has matching descendant | `:has(.peer[name=react])` |
73
+ | `:host(name)` | switch graph context to another project | `:host(local) :malware` |
74
+ | `:is(a, b)` | any of (forgiving list) | `:is([name=a], [name=b])` |
75
+ | `:not(sel)` | negation | `:not([license=MIT])` |
76
+ | `:outdated(kind?)` | newer version exists | `:outdated(major)` |
77
+ | `:published(range)` | by publish date | `:published(">2024")` |
78
+ | `:semver(range)` | semver comparison on installed version | `:semver(^1.0.0)` |
79
+ | `:spec(spec)` | by declared specifier (edge) | `:spec(^1.0.0)` |
80
+ | `:path(glob)` | workspace/file packages by path | `:path("packages/**")` |
81
+ | `:type(kind)` | package type | `:type(git)`, `:type(registry)`, `:type(file)` |
82
+ | `:diff(ref)` | files changed vs git ref | `:diff(main)` |
83
+ | `:hostname(host)` | upstream hostname | `:hostname(github.com)` |
84
+ | `:registry(name)` | configured registry name | `:registry(npm)` |
85
+
86
+ ## Security insights (Socket-powered, network call)
87
+
88
+ Severity args accept names or numbers (`critical`/`0`, `high`/`1`,
89
+ `medium`/`2`, `low`/`3`) and comparators: `:severity(">=medium")`.
90
+
91
+ Threats: `:malware` (binary, no params), `:squat(sev?)`,
92
+ `:suspicious`, `:confused`.
93
+
94
+ Vulnerabilities: `:vuln(sev?)` (alias `:vulnerable`),
95
+ `:cve(CVE-2023-1234)`, `:cve(*)`, `:cwe(CWE-79)`, `:severity(level)`.
96
+ `:vuln` without params matches severity ≥ medium; `:vuln(critical)`
97
+ exact-matches; `:vuln(">=high")` uses comparators. Also matches alerts
98
+ carrying a `cveId` prop.
99
+
100
+ Licensing: `:license(type)` — types: `unlicensed`, `misc`,
101
+ `restricted`, `ambiguous`, `copyleft`, `unknown`, `none`, `exception`.
102
+
103
+ Code behavior: `:eval`, `:network`, `:fs`, `:env`, `:shell`,
104
+ `:scripts` (install scripts), `:debug`, `:dynamic`.
105
+
106
+ Obfuscation: `:obfuscated`, `:minified`, `:entropic`, `:native`,
107
+ `:shrinkwrap`.
108
+
109
+ Health: `:deprecated`, `:unmaintained` (5+ years stale), `:unpopular`,
110
+ `:trivial` (<10 LOC), `:abandoned`, `:unknown`, `:unstable`.
111
+
112
+ Other: `:tracker` (telemetry), `:undesirable`, `:score(rate, kind?)` —
113
+ kinds: `overall` (default), `license`, `maintenance`, `quality`,
114
+ `supplyChain`, `vulnerability`; e.g. `:score("<=0.5", "maintenance")`.
115
+
116
+ ## Audit query starters
117
+
118
+ ```bash
119
+ vlt query ':malware, :vuln(critical), :cve(*), :obfuscated' # critical issues
120
+ vlt query ':abandoned, :unmaintained, :unknown' # supply chain risk
121
+ vlt query ':license(copyleft), :license(unlicensed)' # license compliance
122
+ vlt query ':eval, :shell, :network, :fs' # behavior audit
123
+ ```
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: dss-query
3
+ description:
4
+ Explain and compose vlt Dependency Selector Syntax (DSS) queries —
5
+ CSS-selector-like strings for filtering packages in a dependency
6
+ graph, including Socket-powered security auditing. Use when the user
7
+ asks about DSS, `vlt query`, dependency selectors, wants to
8
+ find/filter packages (e.g. "find outdated deps", "select all
9
+ workspaces"), or wants to security-audit dependencies ("which
10
+ packages have CVEs", "check for malware/typosquats", "what can run
11
+ shell commands or hit the network").
12
+ allowed-tools: [Read, Grep]
13
+ context: fork
14
+ ---
15
+
16
+ # DSS Query Helper
17
+
18
+ Run DSS queries via `vlt query '<selector>'`.
19
+
20
+ ## Response style
21
+
22
+ **Be concise, but teach one thing.** Give the query first, then a
23
+ one-line explanation. No long preambles, no exhaustive alternatives —
24
+ but don't dead-end either: close with a short **Examples** tail of 1–2
25
+ adjacent queries (one step broader, narrower, or a sibling concept).
26
+ Users learn DSS through adjacent examples, and each answer is a chance
27
+ to build that intuition cheaply. Keep the tail bare — a query plus a
28
+ few-word label, no surrounding prose; the whole answer should still
29
+ read in seconds.
30
+
31
+ Two more rules:
32
+
33
+ - **Gloss jargon in place.** Readers may not know DSS terms — on first
34
+ use, give a 2–4 word parenthetical instead of assuming: "`:root`
35
+ anchors the match (starts it) at your project root", "`>` (direct
36
+ deps only)". Never a terminology lecture, just the aside.
37
+ - **End with a docs deep link** so the answer has a "learn more" exit.
38
+ Use the verified map in [Full reference](#full-reference) below —
39
+ link the section relevant to the query, not the docs homepage.
40
+
41
+ Example answer shape:
42
+
43
+ > ```
44
+ > vlt query ':root > :outdated(major)'
45
+ > ```
46
+ >
47
+ > Direct dependencies with a newer major version available.
48
+ >
49
+ > Examples:
50
+ >
51
+ > - `vlt query ':root > :outdated'` — any newer version, not just
52
+ > major
53
+ > - `vlt query ':outdated(major)'` — whole graph, not just direct
54
+ >
55
+ > Add `--view=json` for machine-readable output. More:
56
+ > <https://docs.vlt.io/cli/selectors/>
57
+
58
+ ## Workflow
59
+
60
+ 1. **Clarify intent first** if the goal is ambiguous — ask 1–2 short
61
+ questions, never a survey. Pin down:
62
+ - **What to match**: which packages? Whole graph or just direct
63
+ deps? Everywhere, or only under a specific workspace/package?
64
+ - **Expected outcome**: what does the result set look like if the
65
+ query works — a handful of known offenders, every workspace, one
66
+ package? What will they do with it (audit, remove, report)? Skip
67
+ this when the request is already specific — don't interrogate
68
+ someone who said "direct deps of root with an MIT license".
69
+ 2. **Compose the query** with the steps below. Then:
70
+ - Show the query.
71
+ - Explain each piece in one short sentence.
72
+ - State what the results should look like, so the user can tell
73
+ whether it worked.
74
+ - Close with the **Examples** tail (1–2 adjacent queries).
75
+ 3. **"What does this query do?"**: decompose left to right, one line
76
+ per segment. Offer 1–2 example queries the user could try next.
77
+ 4. **Correcting a mistaken query?** Add one line on _why_ it was
78
+ wrong, not just the fix — e.g. combinators point from dependent to
79
+ dependency (parent `>` child), so `#x > *` selects x's
80
+ dependencies, not its dependents. The rule transfers; the fix alone
81
+ doesn't.
82
+ 5. **Uncertain match?** Offer to run it: `vlt query '<selector>'`
83
+ (always single-quote the selector in the shell). Output format:
84
+ `--view=human|json|mermaid|svg|png|count` — defaults to human (json
85
+ when piped).
86
+ 6. **Iterate**: compare results against the expected outcome from step
87
+ 1 — too broad/narrow means refine one piece at a time (add a
88
+ combinator, a pseudo-state, or `:not()`).
89
+
90
+ ## Composing a query from a goal
91
+
92
+ Build left to right, in this order — each step is optional:
93
+
94
+ 1. **Anchor** — where in the graph? `:root` (top level), `:workspace`,
95
+ `:project`, `#pkg-name`, or nothing (whole graph).
96
+ 2. **Traverse** — what relationship? `>` direct deps, ` ` (space)
97
+ anything beneath, `~` siblings. Skip to filter the anchor itself.
98
+ 3. **Filter** — chain conditions with no space = AND: attribute
99
+ (`[license=MIT]`), state (`:dev`), functional (`:outdated(major)`),
100
+ negation (`:not(...)`).
101
+ 4. **Union** — need OR? Join complete selectors with commas.
102
+ 5. **Invert direction** — "what depends on X?" flips traversal: use
103
+ `:has(> #x)` (dependents of x), not `#x > *` (dependencies of x).
104
+
105
+ Worked example — "prod deps of my workspaces with a copyleft license":
106
+ `:workspace` (anchor) + `>` (direct) + `:prod:license(copyleft)`
107
+ (filters) → `vlt query ':workspace > :prod:license(copyleft)'`
108
+
109
+ ## Core syntax (mental model: CSS, but nodes are packages)
110
+
111
+ | Piece | Meaning | Example |
112
+ | ----------------------------------- | ------------------------------------------- | ------------------------ |
113
+ | `[name=foo]` / `#foo` | match by package.json field / name shortcut | `[version^=2]`, `#react` |
114
+ | `>` | direct dependency | `:root > *` |
115
+ | ` ` (space) | any transitive dependency | `:root [name=js-tokens]` |
116
+ | `~` | sibling (shares a parent) | `[name=react] ~ *` |
117
+ | `:root` `:project` `:workspace` | graph anchors | `:workspace > :dev` |
118
+ | `:prod` `:dev` `:optional` `:peer` | dependency type | `:dev:outdated` |
119
+ | `:has()` `:not()` `:is()` | structural filters | `:has(> :cve(*))` |
120
+ | `:outdated()` `:semver()` `:type()` | functional filters | `:outdated(major)` |
121
+ | `:malware` `:cve()` `:license()` | security (Socket data, network call) | `:license(copyleft)` |
122
+ | `,` | OR — union of selectors | `:dev, :optional` |
123
+
124
+ Chaining without spaces is AND: `:workspace:private` = workspace AND
125
+ private.
126
+
127
+ ## Common recipes
128
+
129
+ ```bash
130
+ vlt query ':root > *' # direct dependencies
131
+ vlt query ':workspace' # select all workspaces
132
+ vlt query ':root > :outdated' # outdated direct deps
133
+ vlt query '[name=react] *' # everything react pulls in
134
+ vlt query ':has(> #react)' # packages that directly depend on react
135
+ vlt query ':dev:eval' # dev deps using eval()
136
+ vlt query ':malware, :cve(*)' # malware or any CVE
137
+ ```
138
+
139
+ ## Security auditing (Socket-powered)
140
+
141
+ DSS's sharpest feature: nodes are enriched with Socket insight data,
142
+ so the dependency graph doubles as a security scanner. Selectors group
143
+ into four families — compose them with anchors and combinators like
144
+ any other filter:
145
+
146
+ | Family | Selectors | Ask |
147
+ | --------------- | -------------------------------------------------------------------------------- | -------------------------------------- |
148
+ | Threats | `:malware` `:squat` `:obfuscated` `:suspicious` | is anything actively hostile? |
149
+ | Vulnerabilities | `:vuln(critical)` `:cve(CVE-…)` `:cve(*)` `:cwe(CWE-79)` `:severity(">=medium")` | known CVEs / vulns, filter by severity |
150
+ | Capabilities | `:eval` `:network` `:fs` `:shell` `:env` | what _can_ this code do? |
151
+ | Hygiene | `:abandoned` `:unmaintained` `:deprecated` `:score("<=0.5", "maintenance")` | will this rot on us? |
152
+
153
+ Audit recipes:
154
+
155
+ ```bash
156
+ vlt query ':malware, :vuln(critical), :squat, :obfuscated' # supply-chain sweep
157
+ vlt query ':workspace > :prod:severity(">=high")' # release blockers
158
+ vlt query ':dev:shell, :dev:network' # dev deps that spawn/phone home
159
+ ```
160
+
161
+ All of these fetch Socket data over the network — expect latency on
162
+ first run.
163
+
164
+ ## Gotchas
165
+
166
+ - `:workspace` matches workspaces declared in `vlt.json` — yarn/pnpm/
167
+ bun-style workspace configs aren't read unless mirrored there.
168
+ - `:license(x)` takes a category (`copyleft`, `unlicensed`, `none`,
169
+ …), never a license ID — for a specific license use the attribute
170
+ form `[license=MIT]`.
171
+ - `:missing` matches edges (declarations), not nodes — no package
172
+ output.
173
+ - Quote values with special chars: `[name^="@vltpkg"]`.
174
+
175
+ ## Full reference
176
+
177
+ Selector-by-selector detail (all pseudo-classes, security insights,
178
+ operators): see [REFERENCE.md](REFERENCE.md).
179
+
180
+ Canonical docs — deep-link the section that matches the query
181
+ (verified anchors; don't invent others):
182
+
183
+ | Query topic | Link |
184
+ | ----------------------------------------- | ------------------------------------------------------------ |
185
+ | syntax, composition, anything structural | <https://docs.vlt.io/cli/selectors/> |
186
+ | malware / typosquats / obfuscation | <https://docs.vlt.io/cli/security#malware-detection> |
187
+ | CVEs / CWEs / severity | <https://docs.vlt.io/cli/security#vulnerability-detection> |
188
+ | capabilities (`:eval` `:network` `:fs` …) | <https://docs.vlt.io/cli/security#behavioral-security-risks> |
189
+ | license compliance | <https://docs.vlt.io/cli/security#license-compliance> |
190
+ | security scores | <https://docs.vlt.io/cli/security#security-scoring> |
@@ -0,0 +1,79 @@
1
+ # dss-query skill evals
2
+
3
+ How we evaluate the [dss-query](../SKILL.md) agent skill:
4
+
5
+ Claude's skill-creator plugin "Evaluate a skill" decomposes into three
6
+ different measurements with different levels of rigor
7
+
8
+ | Layer | Question | Method | LLM involved? | CI-gateable? |
9
+ | ---------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------- |
10
+ | 1. Content correctness | Are the skill's documented selectors valid and current? | Extract selectors from SKILL.md/REFERENCE.md, parse + execute against the real query engine | No | Yes — deterministic |
11
+ | 2. Content efficacy | Does the skill make model output measurably better? | With-skill vs baseline differential, graded deterministically | As subject, not judge | Not as a hard gate (single-sample variance) |
12
+ | 3. Trigger efficacy | Does the skill activate when it should? | Repeated trigger-rate sampling on the production model | Yes, unavoidably | No — probabilistic, monitor only |
13
+
14
+ Two principles behind this split, learned the hard way:
15
+
16
+ - **Never use an LLM as the judge of a skill written for that LLM** —
17
+ grade with deterministic checks (parse, execute, regex). The LLM may
18
+ be the _subject_ of an eval, never its grader.
19
+ - **A skill's value is its lift over baseline.** A strong model may
20
+ already know the domain (correctness lift ≈ 0) while the skill still
21
+ earns its keep on response style, concision, and latency. Only a
22
+ with/without differential reveals which.
23
+
24
+ ## Layer 2: the efficacy differential (primary loop)
25
+
26
+ Lives in [`../../dss-query-workspace/`](../../dss-query-workspace/)
27
+ (gitignored). Test prompts + deterministic assertions are defined in
28
+ [evals.json](evals.json). Each iteration:
29
+
30
+ 1. For every eval, spawn two subagents in the same turn: one told to
31
+ read and follow the live SKILL.md (**force-loaded** — this removes
32
+ the trigger confound, see below), one baseline (no skill, or a
33
+ snapshot of the pre-edit skill when iterating).
34
+ 2. Grade every answer with [grade.mjs](grade.mjs) (run from
35
+ `src/query`:
36
+ `node skills/dss-query/evals/grade.mjs <iteration-dir>`) — no LLM:
37
+ - extract selectors from the answer (`vlt query '…'` and bare
38
+ code-block selectors);
39
+ - every selector must **parse** via `@vltpkg/dss-parser`;
40
+ - structural selectors must **execute** via `Query.search()`
41
+ against the in-memory fixture graph
42
+ (`src/query/test/fixtures/graph.ts`). Selectors using `:outdated`
43
+ (registry fetch) or security pseudo-selectors (need the Socket
44
+ archive) are parse-checked only, so grading stays offline.
45
+ Comma-separated selectors are split at the top level first —
46
+ multi-selector lists enable the engine's loose mode, which
47
+ silently swallows invalid segments;
48
+ - per-eval regex assertions (expected shape, style contract,
49
+ required caveats).
50
+ 3. Aggregate with skill-creator's `aggregate_benchmark` and review
51
+ outputs in its eval viewer; human feedback drives the next skill
52
+ edit, then re-run with the pre-edit snapshot as baseline.
53
+
54
+ Read the benchmark honestly: pass-rate delta is the skill's
55
+ correctness lift; time/token deltas are its efficiency cost/benefit;
56
+ assertions that pass in **both** configs are non-discriminating — they
57
+ can't detect skill regressions on that model (but may on weaker ones).
58
+
59
+ ## Layer 1: doc-selector validation
60
+
61
+ Machinery exists in [grade.mjs](grade.mjs) (parse + offline execute);
62
+ a standalone sweep that extracts every selector from
63
+ SKILL.md/REFERENCE.md and validates it the same way is the natural CI
64
+ gate — it catches the regression that actually bites: the query engine
65
+ changes and the skill's documented examples silently go stale.
66
+
67
+ ## Adding cases
68
+
69
+ Add to [evals.json](evals.json). Prefer deterministic assertions
70
+ (selector parses, executes, matches shape) over prose matching; make
71
+ prompts realistic (casual phrasing, a wrong attempt to correct,
72
+ project context) rather than textbook questions; and verify any
73
+ factual claim an assertion encodes against the engine source first —
74
+ e.g. `:license()` takes only category kinds, so an eval expecting
75
+ `:license(mit)` would grade correct answers as failures.
76
+
77
+ This directory is excluded from the published `@vltpkg/query` package
78
+ (see the `files` field in `package.json`) — it's repo tooling, not
79
+ part of the skill consumers receive.