@socketsecurity/lib 6.0.4 → 6.0.6

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 (211) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ai/discover.js +3 -2
  3. package/dist/ai/spawn.js +8 -5
  4. package/dist/ai/worktree.js +11 -6
  5. package/dist/ansi/strip.js +2 -2
  6. package/dist/archives/_internal.js +4 -4
  7. package/dist/archives/zip.js +1 -1
  8. package/dist/arrays/_internal.js +2 -2
  9. package/dist/arrays/chunk.js +1 -1
  10. package/dist/arrays/join.js +2 -2
  11. package/dist/arrays/unique.js +1 -1
  12. package/dist/bin/acorn-bindgen.cjs +769 -0
  13. package/dist/bin/acorn.wasm +0 -0
  14. package/dist/bin/check-primordials.js +3 -2
  15. package/dist/bin/check.js +3 -2
  16. package/dist/bin/exec.js +1 -1
  17. package/dist/bin/prim.cjs +39064 -0
  18. package/dist/bin/resolve.js +1 -1
  19. package/dist/colors/socket-palette.js +2 -2
  20. package/dist/compression/_internal.js +3 -2
  21. package/dist/compression/brotli.js +5 -12
  22. package/dist/compression/gzip.js +5 -13
  23. package/dist/constants/agents.js +4 -4
  24. package/dist/constants/packages.js +6 -6
  25. package/dist/constants/socket.js +1 -1
  26. package/dist/crypto/hash.js +2 -2
  27. package/dist/debug/_internal.js +2 -2
  28. package/dist/debug/caller-info.js +1 -1
  29. package/dist/debug/namespace.js +5 -5
  30. package/dist/debug/output.js +3 -3
  31. package/dist/dlx/binary-download.js +3 -2
  32. package/dist/eco/npm/npm/flags.js +5 -5
  33. package/dist/eco/npm/pnpm/flags.js +3 -3
  34. package/dist/env/boolean.js +1 -1
  35. package/dist/env/ci.js +1 -1
  36. package/dist/env/debug.js +1 -1
  37. package/dist/env/github.js +8 -8
  38. package/dist/env/home.js +1 -1
  39. package/dist/env/locale.js +3 -3
  40. package/dist/env/node-auth-token.js +1 -1
  41. package/dist/env/node-env.js +1 -1
  42. package/dist/env/npm.js +5 -5
  43. package/dist/env/number.js +1 -1
  44. package/dist/env/package-manager.js +3 -3
  45. package/dist/env/path.js +1 -1
  46. package/dist/env/pre-commit.js +1 -1
  47. package/dist/env/rewire.js +2 -2
  48. package/dist/env/shell.js +1 -1
  49. package/dist/env/socket-cli.js +13 -13
  50. package/dist/env/socket.js +33 -32
  51. package/dist/env/string.js +1 -1
  52. package/dist/env/temp-dir.js +3 -3
  53. package/dist/env/term.js +1 -1
  54. package/dist/env/test.js +3 -3
  55. package/dist/env/windows.js +4 -4
  56. package/dist/env/xdg.js +3 -3
  57. package/dist/events/exit/_internal.js +5 -5
  58. package/dist/events/exit/handler.js +1 -1
  59. package/dist/events/exit/intercept.js +2 -2
  60. package/dist/events/exit/lifecycle.js +3 -3
  61. package/dist/events/exit/signals.js +1 -1
  62. package/dist/external/@sinclair/typebox/value.js +5 -1
  63. package/dist/external/@sinclair/typebox.js +5 -1
  64. package/dist/external/@socketregistry/packageurl-js.js +27 -0
  65. package/dist/external-tools/bazel/resolve.js +2 -1
  66. package/dist/external-tools/cdxgen/resolve.js +2 -1
  67. package/dist/external-tools/from-pip-venv.d.ts +73 -0
  68. package/dist/external-tools/from-pip-venv.js +98 -0
  69. package/dist/external-tools/janus/asset-names.js +1 -1
  70. package/dist/external-tools/janus/from-download.js +3 -5
  71. package/dist/external-tools/janus/resolve.js +2 -1
  72. package/dist/external-tools/jre/from-download.js +2 -1
  73. package/dist/external-tools/jre/resolve.js +2 -1
  74. package/dist/external-tools/manifest.js +7 -5
  75. package/dist/external-tools/opengrep/resolve.js +2 -1
  76. package/dist/external-tools/sbt/resolve.js +2 -1
  77. package/dist/external-tools/skillspector/from-dlx.d.ts +24 -0
  78. package/dist/external-tools/skillspector/from-dlx.js +41 -0
  79. package/dist/external-tools/skillspector/from-path.d.ts +8 -0
  80. package/dist/external-tools/skillspector/from-path.js +32 -0
  81. package/dist/external-tools/skillspector/from-vfs.d.ts +8 -0
  82. package/dist/external-tools/skillspector/from-vfs.js +27 -0
  83. package/dist/external-tools/skillspector/resolve.d.ts +34 -0
  84. package/dist/external-tools/skillspector/resolve.js +53 -0
  85. package/dist/external-tools/skillspector/types.d.ts +24 -0
  86. package/dist/external-tools/skillspector/types.js +2 -0
  87. package/dist/external-tools/synp/resolve.js +2 -1
  88. package/dist/external-tools/trivy/resolve.js +2 -1
  89. package/dist/external-tools/trufflehog/resolve.js +2 -1
  90. package/dist/external-tools/uv/resolve.js +2 -1
  91. package/dist/fs/access.js +4 -4
  92. package/dist/fs/encoding.js +2 -2
  93. package/dist/fs/find-up.js +2 -2
  94. package/dist/fs/inspect.js +6 -6
  95. package/dist/fs/read-dir.js +3 -3
  96. package/dist/fs/read-file.js +6 -6
  97. package/dist/fs/read-json.js +2 -2
  98. package/dist/fs/safe.js +2 -2
  99. package/dist/fs/unique.js +1 -1
  100. package/dist/fs/validate.js +1 -1
  101. package/dist/fs/write-json.js +1 -1
  102. package/dist/git/_internal.js +2 -1
  103. package/dist/globs/_internal.js +4 -4
  104. package/dist/globs/match.js +4 -3
  105. package/dist/globs/matcher.js +3 -3
  106. package/dist/globs/stream.js +1 -1
  107. package/dist/http-request/browser.js +17 -11
  108. package/dist/http-request/download.js +1 -1
  109. package/dist/http-request/headers.d.ts +32 -3
  110. package/dist/http-request/headers.js +42 -13
  111. package/dist/http-request/request-attempt.js +1 -0
  112. package/dist/http-request/request-types.d.ts +5 -0
  113. package/dist/http-request/request.js +32 -15
  114. package/dist/http-request/response-reader.d.ts +12 -1
  115. package/dist/http-request/response-reader.js +22 -2
  116. package/dist/http-request/user-agent.js +1 -1
  117. package/dist/json/edit.js +1 -1
  118. package/dist/json/parse.js +4 -4
  119. package/dist/logger/colors.js +2 -2
  120. package/dist/logger/console.js +1 -1
  121. package/dist/logger/node.js +0 -1
  122. package/dist/logger/symbols.js +1 -1
  123. package/dist/node/async-hooks.js +2 -2
  124. package/dist/node/child-process.js +2 -2
  125. package/dist/node/crypto.js +2 -2
  126. package/dist/node/events.js +2 -2
  127. package/dist/node/fs-promises.js +2 -2
  128. package/dist/node/fs.js +2 -2
  129. package/dist/node/http.js +2 -2
  130. package/dist/node/https.js +2 -2
  131. package/dist/node/module.js +3 -3
  132. package/dist/node/os.js +2 -2
  133. package/dist/node/path.js +2 -2
  134. package/dist/node/timers-promises.js +2 -2
  135. package/dist/node/url.js +2 -2
  136. package/dist/node/util.js +2 -2
  137. package/dist/objects/getters.js +2 -2
  138. package/dist/objects/inspect.js +3 -3
  139. package/dist/objects/mutate.js +1 -1
  140. package/dist/objects/predicates.js +4 -4
  141. package/dist/objects/sort.js +4 -4
  142. package/dist/packages/edit-class.js +1 -1
  143. package/dist/packages/edit.js +2 -2
  144. package/dist/packages/exports.js +6 -6
  145. package/dist/packages/licenses.js +8 -8
  146. package/dist/packages/manifest.js +3 -3
  147. package/dist/packages/normalize.js +4 -4
  148. package/dist/packages/operations.js +11 -11
  149. package/dist/packages/provenance.d.ts +6 -0
  150. package/dist/packages/provenance.js +12 -3
  151. package/dist/packages/specs.js +5 -5
  152. package/dist/packages/validation.js +3 -3
  153. package/dist/paths/_internal.js +3 -3
  154. package/dist/paths/conversion.js +4 -4
  155. package/dist/paths/normalize.js +3 -1
  156. package/dist/paths/packages.js +3 -3
  157. package/dist/paths/predicates.js +7 -7
  158. package/dist/paths/resolve.js +3 -3
  159. package/dist/process/spawn/_internal.js +3 -3
  160. package/dist/process/spawn/errors.js +2 -2
  161. package/dist/process/spawn/stdio.js +1 -1
  162. package/dist/promises/_internal.js +1 -1
  163. package/dist/promises/iterate.js +5 -5
  164. package/dist/promises/options.js +3 -3
  165. package/dist/promises/retry.js +1 -1
  166. package/dist/secrets/_internal.js +3 -2
  167. package/dist/secrets/keychain.js +5 -4
  168. package/dist/secrets/linux.js +6 -4
  169. package/dist/secrets/macos.js +5 -3
  170. package/dist/secrets/rc.js +9 -6
  171. package/dist/secrets/windows.js +7 -4
  172. package/dist/shell/parse.d.ts +108 -1
  173. package/dist/shell/parse.js +168 -2
  174. package/dist/smol/detect.js +1 -1
  175. package/dist/smol/http.js +1 -1
  176. package/dist/smol/https.js +1 -1
  177. package/dist/smol/manifest.js +1 -1
  178. package/dist/smol/path.js +1 -1
  179. package/dist/smol/primordial.js +1 -1
  180. package/dist/smol/purl.js +1 -1
  181. package/dist/smol/versions.js +1 -1
  182. package/dist/smol/vfs.js +1 -1
  183. package/dist/sorts/_internal.js +4 -4
  184. package/dist/sorts/natural.js +3 -3
  185. package/dist/sorts/semver.js +1 -1
  186. package/dist/sorts/strings.js +1 -1
  187. package/dist/spinner/default.js +1 -1
  188. package/dist/spinner/spinner.js +1 -1
  189. package/dist/ssri/convert.js +2 -2
  190. package/dist/ssri/parse.js +1 -1
  191. package/dist/ssri/validate.js +2 -2
  192. package/dist/stdio/prompts.js +1 -1
  193. package/dist/streams/parallel.js +2 -2
  194. package/dist/streams/transform.js +1 -1
  195. package/dist/strings/format.js +4 -4
  196. package/dist/strings/predicates.js +2 -2
  197. package/dist/strings/search.js +1 -1
  198. package/dist/strings/transform.js +3 -3
  199. package/dist/strings/width.js +3 -3
  200. package/dist/temporal/instant.js +4 -2
  201. package/dist/temporal/slots.js +3 -2
  202. package/dist/themes/context.js +2 -2
  203. package/dist/url/parse.js +2 -2
  204. package/dist/url/predicates.js +1 -1
  205. package/dist/url/search-params.js +6 -6
  206. package/dist/words/article.js +1 -1
  207. package/dist/words/capitalize.js +1 -1
  208. package/dist/words/pluralize.d.ts +24 -2
  209. package/dist/words/pluralize.js +37 -2
  210. package/dist/words/types.d.ts +25 -2
  211. package/package.json +45 -5
package/dist/node/path.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  //#region src/node/path.ts
6
6
  let _path;
7
- /* @__NO_SIDE_EFFECTS__ */
7
+ /*@__NO_SIDE_EFFECTS__*/
8
8
  function getNodePath() {
9
- return _path ??= /* @__PURE__ */ require("node:path");
9
+ return _path ??= /*@__PURE__*/ require("node:path");
10
10
  }
11
11
 
12
12
  //#endregion
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  //#region src/node/timers-promises.ts
6
6
  let _timersPromises;
7
- /* @__NO_SIDE_EFFECTS__ */
7
+ /*@__NO_SIDE_EFFECTS__*/
8
8
  function getNodeTimersPromises() {
9
- return _timersPromises ??= /* @__PURE__ */ require("node:timers/promises");
9
+ return _timersPromises ??= /*@__PURE__*/ require("node:timers/promises");
10
10
  }
11
11
 
12
12
  //#endregion
package/dist/node/url.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  //#region src/node/url.ts
6
6
  let _url;
7
- /* @__NO_SIDE_EFFECTS__ */
7
+ /*@__NO_SIDE_EFFECTS__*/
8
8
  function getNodeUrl() {
9
- return _url ??= /* @__PURE__ */ require("node:url");
9
+ return _url ??= /*@__PURE__*/ require("node:url");
10
10
  }
11
11
 
12
12
  //#endregion
package/dist/node/util.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  //#region src/node/util.ts
6
6
  let _util;
7
- /* @__NO_SIDE_EFFECTS__ */
7
+ /*@__NO_SIDE_EFFECTS__*/
8
8
  function getNodeUtil() {
9
- return _util ??= /* @__PURE__ */ require("node:util");
9
+ return _util ??= /*@__PURE__*/ require("node:util");
10
10
  }
11
11
 
12
12
  //#endregion
@@ -49,7 +49,7 @@ const require_objects_sort = require('./sort.js');
49
49
  *
50
50
  * @returns A frozen object with all specified properties
51
51
  */
52
- /* @__NO_SIDE_EFFECTS__ */
52
+ /*@__NO_SIDE_EFFECTS__*/
53
53
  function createConstantsObject(props, options_) {
54
54
  const options = {
55
55
  __proto__: null,
@@ -107,7 +107,7 @@ function createConstantsObject(props, options_) {
107
107
  *
108
108
  * @returns A memoized getter function
109
109
  */
110
- /* @__NO_SIDE_EFFECTS__ */
110
+ /*@__NO_SIDE_EFFECTS__*/
111
111
  function createLazyGetter(name, getter, stats) {
112
112
  const UNCOMPUTED = {};
113
113
  let lazyValue = UNCOMPUTED;
@@ -28,7 +28,7 @@ const require_objects_predicates = require('./predicates.js');
28
28
  *
29
29
  * @returns Array of enumerable string keys, or empty array for non-objects
30
30
  */
31
- /* @__NO_SIDE_EFFECTS__ */
31
+ /*@__NO_SIDE_EFFECTS__*/
32
32
  function getKeys(obj) {
33
33
  return /* @__PURE__ */ require_objects_predicates.isObject(obj) ? require_primordials_object.ObjectKeys(obj) : [];
34
34
  }
@@ -54,7 +54,7 @@ function getKeys(obj) {
54
54
  * @returns The property value, or `undefined` if not found or obj is
55
55
  * null/undefined.
56
56
  */
57
- /* @__NO_SIDE_EFFECTS__ */
57
+ /*@__NO_SIDE_EFFECTS__*/
58
58
  function getOwn(obj, propKey) {
59
59
  if (obj === null || obj === void 0) return;
60
60
  return require_primordials_object.ObjectHasOwn(obj, propKey) ? obj[propKey] : void 0;
@@ -76,7 +76,7 @@ function getOwn(obj, propKey) {
76
76
  *
77
77
  * @returns Array of all own property values, or empty array for null/undefined
78
78
  */
79
- /* @__NO_SIDE_EFFECTS__ */
79
+ /*@__NO_SIDE_EFFECTS__*/
80
80
  function getOwnPropertyValues(obj) {
81
81
  if (obj === null || obj === void 0) return [];
82
82
  const keys = require_primordials_object.ObjectGetOwnPropertyNames(obj);
@@ -42,7 +42,7 @@ const require_objects_predicates = require('./predicates.js');
42
42
  *
43
43
  * @returns The modified target object
44
44
  */
45
- /* @__NO_SIDE_EFFECTS__ */
45
+ /*@__NO_SIDE_EFFECTS__*/
46
46
  function merge(target, source) {
47
47
  if (!/* @__PURE__ */ require_objects_predicates.isObject(target) || !/* @__PURE__ */ require_objects_predicates.isObject(source)) return target;
48
48
  const queue = [[target, source]];
@@ -31,7 +31,7 @@ const require_arrays_predicates = require('../arrays/predicates.js');
31
31
  *
32
32
  * @returns `true` if obj has enumerable own properties, `false` otherwise
33
33
  */
34
- /* @__NO_SIDE_EFFECTS__ */
34
+ /*@__NO_SIDE_EFFECTS__*/
35
35
  function hasKeys(obj) {
36
36
  if (obj === null || obj === void 0) return false;
37
37
  for (const key in obj) if (require_primordials_object.ObjectHasOwn(obj, key)) return true;
@@ -58,7 +58,7 @@ function hasKeys(obj) {
58
58
  *
59
59
  * @returns `true` if obj has the property as an own property, `false` otherwise
60
60
  */
61
- /* @__NO_SIDE_EFFECTS__ */
61
+ /*@__NO_SIDE_EFFECTS__*/
62
62
  function hasOwn(obj, propKey) {
63
63
  if (obj === null || obj === void 0) return false;
64
64
  return require_primordials_object.ObjectHasOwn(obj, propKey);
@@ -83,7 +83,7 @@ function hasOwn(obj, propKey) {
83
83
  *
84
84
  * @returns `true` if value is an object (including arrays), `false` otherwise
85
85
  */
86
- /* @__NO_SIDE_EFFECTS__ */
86
+ /*@__NO_SIDE_EFFECTS__*/
87
87
  function isObject(value) {
88
88
  return value !== null && typeof value === "object";
89
89
  }
@@ -107,7 +107,7 @@ function isObject(value) {
107
107
  *
108
108
  * @returns `true` if value is a plain object, `false` otherwise
109
109
  */
110
- /* @__NO_SIDE_EFFECTS__ */
110
+ /*@__NO_SIDE_EFFECTS__*/
111
111
  function isPlainObject(value) {
112
112
  if (value === null || typeof value !== "object" || require_arrays_predicates.isArray(value)) return false;
113
113
  const proto = require_primordials_object.ObjectGetPrototypeOf(value);
@@ -35,7 +35,7 @@ const require_sorts_natural = require('../sorts/natural.js');
35
35
  *
36
36
  * @returns Negative if a < b, positive if a > b, zero if equal
37
37
  */
38
- /* @__NO_SIDE_EFFECTS__ */
38
+ /*@__NO_SIDE_EFFECTS__*/
39
39
  function entryKeyComparator(a, b) {
40
40
  const keyA = a[0];
41
41
  const keyB = b[0];
@@ -58,7 +58,7 @@ function entryKeyComparator(a, b) {
58
58
  *
59
59
  * @returns Array of [key, value] tuples, or empty array for null/undefined
60
60
  */
61
- /* @__NO_SIDE_EFFECTS__ */
61
+ /*@__NO_SIDE_EFFECTS__*/
62
62
  function objectEntries(obj) {
63
63
  if (obj === null || obj === void 0) return [];
64
64
  const keys = require_primordials_reflect.ReflectOwnKeys(obj);
@@ -87,7 +87,7 @@ function objectEntries(obj) {
87
87
  *
88
88
  * @returns A new object with sorted keys
89
89
  */
90
- /* @__NO_SIDE_EFFECTS__ */
90
+ /*@__NO_SIDE_EFFECTS__*/
91
91
  function toSortedObject(obj) {
92
92
  return /* @__PURE__ */ toSortedObjectFromEntries(/* @__PURE__ */ objectEntries(obj));
93
93
  }
@@ -112,7 +112,7 @@ function toSortedObject(obj) {
112
112
  *
113
113
  * @returns A new object with sorted keys
114
114
  */
115
- /* @__NO_SIDE_EFFECTS__ */
115
+ /*@__NO_SIDE_EFFECTS__*/
116
116
  function toSortedObjectFromEntries(entries) {
117
117
  const otherEntries = [];
118
118
  const symbolEntries = [];
@@ -35,7 +35,7 @@ let _EditablePackageJsonClass;
35
35
  * console.log(pkg.content.name)
36
36
  * ```
37
37
  */
38
- /* @__NO_SIDE_EFFECTS__ */
38
+ /*@__NO_SIDE_EFFECTS__*/
39
39
  function getEditablePackageJsonClass() {
40
40
  if (_EditablePackageJsonClass === void 0) _EditablePackageJsonClass = class EditablePackageJson extends src_external__npmcli_package_json.default {
41
41
  static fixSteps = src_external__npmcli_package_json.default.fixSteps;
@@ -35,7 +35,7 @@ const require_packages_edit_class = require('./edit-class.js');
35
35
  * )
36
36
  * ```
37
37
  */
38
- /* @__NO_SIDE_EFFECTS__ */
38
+ /*@__NO_SIDE_EFFECTS__*/
39
39
  async function toEditablePackageJson(pkgJson, options) {
40
40
  const { path: filepath, ...restOptions } = {
41
41
  __proto__: null,
@@ -62,7 +62,7 @@ async function toEditablePackageJson(pkgJson, options) {
62
62
  * )
63
63
  * ```
64
64
  */
65
- /* @__NO_SIDE_EFFECTS__ */
65
+ /*@__NO_SIDE_EFFECTS__*/
66
66
  function toEditablePackageJsonSync(pkgJson, options) {
67
67
  const { path: filepath, ...restOptions } = {
68
68
  __proto__: null,
@@ -26,7 +26,7 @@ const require_objects_predicates = require('../objects/predicates.js');
26
26
  * // types === './dist/index.d.ts'
27
27
  * ```
28
28
  */
29
- /* @__NO_SIDE_EFFECTS__ */
29
+ /*@__NO_SIDE_EFFECTS__*/
30
30
  function findTypesForSubpath(entryExports, subpath) {
31
31
  const queue = [entryExports];
32
32
  let pos = 0;
@@ -57,7 +57,7 @@ function findTypesForSubpath(entryExports, subpath) {
57
57
  * getExportFilePaths(exports) // ['./dist/index.js', './dist/utils.js']
58
58
  * ```
59
59
  */
60
- /* @__NO_SIDE_EFFECTS__ */
60
+ /*@__NO_SIDE_EFFECTS__*/
61
61
  function getExportFilePaths(entryExports) {
62
62
  if (!/* @__PURE__ */ require_objects_predicates.isObject(entryExports)) return [];
63
63
  const paths = [];
@@ -88,7 +88,7 @@ function getExportFilePaths(entryExports) {
88
88
  * getSubpaths(exports) // ['.', './utils']
89
89
  * ```
90
90
  */
91
- /* @__NO_SIDE_EFFECTS__ */
91
+ /*@__NO_SIDE_EFFECTS__*/
92
92
  function getSubpaths(entryExports) {
93
93
  if (!/* @__PURE__ */ require_objects_predicates.isObject(entryExports)) return [];
94
94
  return require_primordials_object.ObjectGetOwnPropertyNames(entryExports).filter((key) => require_primordials_string.StringPrototypeStartsWith(key, "."));
@@ -102,7 +102,7 @@ function getSubpaths(entryExports) {
102
102
  * isConditionalExports({ '.': './index.js' }) // false
103
103
  * ```
104
104
  */
105
- /* @__NO_SIDE_EFFECTS__ */
105
+ /*@__NO_SIDE_EFFECTS__*/
106
106
  function isConditionalExports(entryExports) {
107
107
  if (!/* @__PURE__ */ require_objects_predicates.isPlainObject(entryExports)) return false;
108
108
  const keys = require_primordials_object.ObjectGetOwnPropertyNames(entryExports);
@@ -123,7 +123,7 @@ function isConditionalExports(entryExports) {
123
123
  * isSubpathExports({ import: './index.mjs' }) // false
124
124
  * ```
125
125
  */
126
- /* @__NO_SIDE_EFFECTS__ */
126
+ /*@__NO_SIDE_EFFECTS__*/
127
127
  function isSubpathExports(entryExports) {
128
128
  if (/* @__PURE__ */ require_objects_predicates.isPlainObject(entryExports)) {
129
129
  const keys = require_primordials_object.ObjectGetOwnPropertyNames(entryExports);
@@ -143,7 +143,7 @@ function isSubpathExports(entryExports) {
143
143
  * // { '.': './index.js' }
144
144
  * ```
145
145
  */
146
- /* @__NO_SIDE_EFFECTS__ */
146
+ /*@__NO_SIDE_EFFECTS__*/
147
147
  function resolvePackageJsonEntryExports(entryExports) {
148
148
  if (typeof entryExports === "string" || require_arrays_predicates.isArray(entryExports)) return { ".": entryExports };
149
149
  if (/* @__PURE__ */ isConditionalExports(entryExports)) return entryExports;
@@ -33,7 +33,7 @@ const fileReferenceRegExp = /^SEE LICEN[CS]E IN (.+)$/;
33
33
  * // incompatible contains only the GPL-3.0 node
34
34
  * ```
35
35
  */
36
- /* @__NO_SIDE_EFFECTS__ */
36
+ /*@__NO_SIDE_EFFECTS__*/
37
37
  function collectIncompatibleLicenses(licenseNodes) {
38
38
  const result = [];
39
39
  for (let i = 0, { length } = licenseNodes; i < length; i += 1) {
@@ -51,7 +51,7 @@ function collectIncompatibleLicenses(licenseNodes) {
51
51
  * collectLicenseWarnings(nodes) // ['Package is unlicensed']
52
52
  * ```
53
53
  */
54
- /* @__NO_SIDE_EFFECTS__ */
54
+ /*@__NO_SIDE_EFFECTS__*/
55
55
  function collectLicenseWarnings(licenseNodes) {
56
56
  const warnings = new require_primordials_map_set.MapCtor();
57
57
  for (let i = 0, { length } = licenseNodes; i < length; i += 1) {
@@ -73,7 +73,7 @@ function collectLicenseWarnings(licenseNodes) {
73
73
  * // node.type === 'License'
74
74
  * ```
75
75
  */
76
- /* @__NO_SIDE_EFFECTS__ */
76
+ /*@__NO_SIDE_EFFECTS__*/
77
77
  function createAstNode(rawNode) {
78
78
  return /* @__PURE__ */ require_objects_predicates.hasOwn(rawNode, "license") ? /* @__PURE__ */ createLicenseNode(rawNode) : /* @__PURE__ */ createBinaryOperationNode(rawNode);
79
79
  }
@@ -91,7 +91,7 @@ function createAstNode(rawNode) {
91
91
  * // node.type === 'BinaryOperation'
92
92
  * ```
93
93
  */
94
- /* @__NO_SIDE_EFFECTS__ */
94
+ /*@__NO_SIDE_EFFECTS__*/
95
95
  function createBinaryOperationNode(rawNodeParam) {
96
96
  let left;
97
97
  let right;
@@ -127,7 +127,7 @@ function createBinaryOperationNode(rawNodeParam) {
127
127
  * // node.type === 'License' && node.license === 'MIT'
128
128
  * ```
129
129
  */
130
- /* @__NO_SIDE_EFFECTS__ */
130
+ /*@__NO_SIDE_EFFECTS__*/
131
131
  function createLicenseNode(rawNode) {
132
132
  return {
133
133
  __proto__: null,
@@ -144,7 +144,7 @@ function createLicenseNode(rawNode) {
144
144
  * // ast is a BinaryOperation node with MIT and Apache-2.0 leaves
145
145
  * ```
146
146
  */
147
- /* @__NO_SIDE_EFFECTS__ */
147
+ /*@__NO_SIDE_EFFECTS__*/
148
148
  function parseSpdxExp(spdxExp) {
149
149
  try {
150
150
  return (0, src_external_spdx_expression_parse.default)(spdxExp);
@@ -161,7 +161,7 @@ function parseSpdxExp(spdxExp) {
161
161
  * // [{ license: 'MIT' }]
162
162
  * ```
163
163
  */
164
- /* @__NO_SIDE_EFFECTS__ */
164
+ /*@__NO_SIDE_EFFECTS__*/
165
165
  function resolvePackageLicenses(licenseFieldValue, where) {
166
166
  if (licenseFieldValue === "UNLICENSED" || licenseFieldValue === "UNLICENCED") return [{ license: "UNLICENSED" }];
167
167
  const match = require_primordials_regexp.RegExpPrototypeExec(fileReferenceRegExp, licenseFieldValue);
@@ -190,7 +190,7 @@ function resolvePackageLicenses(licenseFieldValue, where) {
190
190
  * // licenses === ['MIT', 'Apache-2.0']
191
191
  * ```
192
192
  */
193
- /* @__NO_SIDE_EFFECTS__ */
193
+ /*@__NO_SIDE_EFFECTS__*/
194
194
  function visitLicenses(ast, visitor) {
195
195
  const queue = [[/* @__PURE__ */ createAstNode(ast), void 0]];
196
196
  let pos = 0;
@@ -38,7 +38,7 @@ const pkgScopePrefixRegExp = /^@socketregistry\//;
38
38
  * })
39
39
  * ```
40
40
  */
41
- /* @__NO_SIDE_EFFECTS__ */
41
+ /*@__NO_SIDE_EFFECTS__*/
42
42
  function createPackageJson(sockRegPkgName, directory, options) {
43
43
  const { dependencies, description, engines, exports: entryExportsRaw, files, keywords, main, overrides, resolutions, sideEffects, socket, type, version } = {
44
44
  __proto__: null,
@@ -91,7 +91,7 @@ function createPackageJson(sockRegPkgName, directory, options) {
91
91
  * const manifest = await fetchPackageManifest('lodash@4.17.21')
92
92
  * ```
93
93
  */
94
- /* @__NO_SIDE_EFFECTS__ */
94
+ /*@__NO_SIDE_EFFECTS__*/
95
95
  async function fetchPackageManifest(pkgNameOrId, options) {
96
96
  const pacoteOptions = {
97
97
  __proto__: null,
@@ -123,7 +123,7 @@ async function fetchPackageManifest(pkgNameOrId, options) {
123
123
  * const packument = await fetchPackagePackument('lodash')
124
124
  * ```
125
125
  */
126
- /* @__NO_SIDE_EFFECTS__ */
126
+ /*@__NO_SIDE_EFFECTS__*/
127
127
  async function fetchPackagePackument(pkgNameOrId, options) {
128
128
  try {
129
129
  return await src_external_pacote.default.packument(pkgNameOrId, {
@@ -30,7 +30,7 @@ function getEscapedScopeRegExp() {
30
30
  * const normalized = normalizePackageJson(pkgJson)
31
31
  * ```
32
32
  */
33
- /* @__NO_SIDE_EFFECTS__ */
33
+ /*@__NO_SIDE_EFFECTS__*/
34
34
  function normalizePackageJson(pkgJson, options) {
35
35
  const { preserve } = {
36
36
  __proto__: null,
@@ -62,7 +62,7 @@ function normalizePackageJson(pkgJson, options) {
62
62
  * resolveEscapedScope('lodash') // undefined
63
63
  * ```
64
64
  */
65
- /* @__NO_SIDE_EFFECTS__ */
65
+ /*@__NO_SIDE_EFFECTS__*/
66
66
  function resolveEscapedScope(sockRegPkgName) {
67
67
  return require_primordials_regexp.RegExpPrototypeExec(getEscapedScopeRegExp(), sockRegPkgName)?.[0] || void 0;
68
68
  }
@@ -74,7 +74,7 @@ function resolveEscapedScope(sockRegPkgName) {
74
74
  * resolveOriginalPackageName('@socketregistry/is-number') // 'is-number'
75
75
  * ```
76
76
  */
77
- /* @__NO_SIDE_EFFECTS__ */
77
+ /*@__NO_SIDE_EFFECTS__*/
78
78
  function resolveOriginalPackageName(sockRegPkgName) {
79
79
  const name = require_primordials_string.StringPrototypeStartsWith(sockRegPkgName, `${"@socketregistry"}/`) ? sockRegPkgName.slice(require_constants_socket.SOCKET_REGISTRY_SCOPE.length + 1) : sockRegPkgName;
80
80
  const escapedScope = /* @__PURE__ */ resolveEscapedScope(name);
@@ -88,7 +88,7 @@ function resolveOriginalPackageName(sockRegPkgName) {
88
88
  * unescapeScope('babel__') // '@babel'
89
89
  * ```
90
90
  */
91
- /* @__NO_SIDE_EFFECTS__ */
91
+ /*@__NO_SIDE_EFFECTS__*/
92
92
  function unescapeScope(escapedScope) {
93
93
  if (escapedScope.length < "__".length) return `@${escapedScope}`;
94
94
  return `@${escapedScope.slice(0, -"__".length)}`;
@@ -45,7 +45,7 @@ let _fetcher;
45
45
  * await extractPackage('lodash@4.17.21', { dest: '/tmp/lodash' })
46
46
  * ```
47
47
  */
48
- /* @__NO_SIDE_EFFECTS__ */
48
+ /*@__NO_SIDE_EFFECTS__*/
49
49
  async function extractPackage(pkgNameOrId, options, callback) {
50
50
  let actualCallback = callback;
51
51
  let actualOptions = options;
@@ -80,7 +80,7 @@ async function extractPackage(pkgNameOrId, options, callback) {
80
80
  * const extensions = findPackageExtensions('my-pkg', '1.0.0')
81
81
  * ```
82
82
  */
83
- /* @__NO_SIDE_EFFECTS__ */
83
+ /*@__NO_SIDE_EFFECTS__*/
84
84
  function findPackageExtensions(pkgName, pkgVer) {
85
85
  let result;
86
86
  for (const entry of packageExtensions) {
@@ -114,7 +114,7 @@ function getFetcher() {
114
114
  * getReleaseTag('lodash') // ''
115
115
  * ```
116
116
  */
117
- /* @__NO_SIDE_EFFECTS__ */
117
+ /*@__NO_SIDE_EFFECTS__*/
118
118
  function getReleaseTag(spec) {
119
119
  if (!spec) return "";
120
120
  let atIndex = -1;
@@ -131,7 +131,7 @@ function getReleaseTag(spec) {
131
131
  * const tarball = await packPackage('lodash@4.17.21')
132
132
  * ```
133
133
  */
134
- /* @__NO_SIDE_EFFECTS__ */
134
+ /*@__NO_SIDE_EFFECTS__*/
135
135
  async function packPackage(spec, options) {
136
136
  /* c8 ignore start - External package registry packing */
137
137
  return await (0, src_external_libnpmpack.default)(spec, {
@@ -155,9 +155,9 @@ async function packPackage(spec, options) {
155
155
  * pkgNameToSlug('lodash') // 'lodash'
156
156
  * ```
157
157
  */
158
- /* @__NO_SIDE_EFFECTS__ */
158
+ /*@__NO_SIDE_EFFECTS__*/
159
159
  function pkgNameToSlug(pkgName) {
160
- return pkgName.charCodeAt(0) === 64 ? `${pkgName.slice(1).replace("/", "-")}` : pkgName;
160
+ return require_primordials_string.StringPrototypeCharCodeAt(pkgName, 0) === 64 ? `${pkgName.slice(1).replace("/", "-")}` : pkgName;
161
161
  }
162
162
  /**
163
163
  * Read and parse a package.json file asynchronously.
@@ -168,7 +168,7 @@ function pkgNameToSlug(pkgName) {
168
168
  * console.log(pkgJson?.name)
169
169
  * ```
170
170
  */
171
- /* @__NO_SIDE_EFFECTS__ */
171
+ /*@__NO_SIDE_EFFECTS__*/
172
172
  async function readPackageJson(filepath, options) {
173
173
  const { editable, normalize, throws, ...normalizeOptions } = {
174
174
  __proto__: null,
@@ -193,7 +193,7 @@ async function readPackageJson(filepath, options) {
193
193
  * console.log(pkgJson?.name)
194
194
  * ```
195
195
  */
196
- /* @__NO_SIDE_EFFECTS__ */
196
+ /*@__NO_SIDE_EFFECTS__*/
197
197
  function readPackageJsonSync(filepath, options) {
198
198
  const { editable, normalize, throws, ...normalizeOptions } = {
199
199
  __proto__: null,
@@ -217,7 +217,7 @@ function readPackageJsonSync(filepath, options) {
217
217
  * const url = await resolveGitHubTgzUrl('my-pkg@1.0.0', '/tmp/my-project')
218
218
  * ```
219
219
  */
220
- /* @__NO_SIDE_EFFECTS__ */
220
+ /*@__NO_SIDE_EFFECTS__*/
221
221
  async function resolveGitHubTgzUrl(pkgNameOrId, where) {
222
222
  const whereIsPkgJson = /* @__PURE__ */ require_objects_predicates.isPlainObject(where);
223
223
  const pkgJson = whereIsPkgJson ? where : await /* @__PURE__ */ readPackageJson(where, { normalize: true });
@@ -268,7 +268,7 @@ async function resolveGitHubTgzUrl(pkgNameOrId, where) {
268
268
  * resolvePackageName({ name: 'lodash' }) // 'lodash'
269
269
  * ```
270
270
  */
271
- /* @__NO_SIDE_EFFECTS__ */
271
+ /*@__NO_SIDE_EFFECTS__*/
272
272
  function resolvePackageName(purlObj, delimiter = "/") {
273
273
  const { name, namespace } = purlObj;
274
274
  return `${namespace ? `${namespace}${delimiter}` : ""}${name}`;
@@ -282,7 +282,7 @@ function resolvePackageName(purlObj, delimiter = "/") {
282
282
  * resolveRegistryPackageName('lodash') // 'lodash'
283
283
  * ```
284
284
  */
285
- /* @__NO_SIDE_EFFECTS__ */
285
+ /*@__NO_SIDE_EFFECTS__*/
286
286
  function resolveRegistryPackageName(pkgName) {
287
287
  const input = `pkg:npm/${pkgName}`;
288
288
  const smolPurl = /* @__PURE__ */ require_smol_purl.getSmolPurl();
@@ -53,6 +53,12 @@ export declare function getTrustLevelName(status: TrustStatus): TrustLevelName;
53
53
  /**
54
54
  * Extract provenance / trusted-publisher / staged-publish flags from a registry
55
55
  * version document.
56
+ *
57
+ * Staged-publish detection follows pnpm/pnpm#12056: `_npmUser.approver` is set
58
+ * by the registry when a package version was promoted out of staging via a
59
+ * 2FA-gated approve step. That signal ranks ABOVE both `trustedPublisher` and
60
+ * `provenance` in pnpm's trust-evidence ladder, because it adds a human
61
+ * approval gate on top of the OIDC publisher identity.
56
62
  */
57
63
  export declare function getTrustStatus(meta: unknown): TrustStatus;
58
64
  /**
@@ -50,7 +50,7 @@ function didTrustDecrease(prev, next) {
50
50
  * const provenance = await fetchPackageProvenance('lodash', '4.17.21')
51
51
  * ```
52
52
  */
53
- /* @__NO_SIDE_EFFECTS__ */
53
+ /*@__NO_SIDE_EFFECTS__*/
54
54
  async function fetchPackageProvenance(pkgName, pkgVersion, options) {
55
55
  const { signal, timeout = 1e4 } = {
56
56
  __proto__: null,
@@ -100,7 +100,7 @@ function getAttestations(attestationData) {
100
100
  return att.predicateType === SLSA_PROVENANCE_V0_2 || att.predicateType === SLSA_PROVENANCE_V1_0;
101
101
  });
102
102
  }
103
- /* @__NO_SIDE_EFFECTS__ */
103
+ /*@__NO_SIDE_EFFECTS__*/
104
104
  function getFetcher() {
105
105
  if (_fetcher === void 0) _fetcher = src_external_make_fetch_happen.default.defaults({
106
106
  cachePath: /* @__PURE__ */ require_constants_packages.getPacoteCachePath(),
@@ -161,6 +161,12 @@ function getTrustLevelName(status) {
161
161
  /**
162
162
  * Extract provenance / trusted-publisher / staged-publish flags from a registry
163
163
  * version document.
164
+ *
165
+ * Staged-publish detection follows pnpm/pnpm#12056: `_npmUser.approver` is set
166
+ * by the registry when a package version was promoted out of staging via a
167
+ * 2FA-gated approve step. That signal ranks ABOVE both `trustedPublisher` and
168
+ * `provenance` in pnpm's trust-evidence ladder, because it adds a human
169
+ * approval gate on top of the OIDC publisher identity.
164
170
  */
165
171
  function getTrustStatus(meta) {
166
172
  const status = {
@@ -170,7 +176,10 @@ function getTrustStatus(meta) {
170
176
  };
171
177
  if (!/* @__PURE__ */ require_objects_predicates.isObject(meta)) return status;
172
178
  const npmUser = require_primordials_object.ObjectHasOwn(meta, "_npmUser") ? meta["_npmUser"] : void 0;
173
- if (/* @__PURE__ */ require_objects_predicates.isObject(npmUser) && require_primordials_object.ObjectHasOwn(npmUser, "trustedPublisher") && npmUser["trustedPublisher"]) status.trustedPublisher = true;
179
+ if (/* @__PURE__ */ require_objects_predicates.isObject(npmUser)) {
180
+ if (require_primordials_object.ObjectHasOwn(npmUser, "approver") && npmUser["approver"]) status.stagedPublish = true;
181
+ if (require_primordials_object.ObjectHasOwn(npmUser, "trustedPublisher") && npmUser["trustedPublisher"]) status.trustedPublisher = true;
182
+ }
174
183
  const dist = require_primordials_object.ObjectHasOwn(meta, "dist") ? meta["dist"] : void 0;
175
184
  const attestations = /* @__PURE__ */ require_objects_predicates.isObject(dist) && require_primordials_object.ObjectHasOwn(dist, "attestations") ? dist["attestations"] : void 0;
176
185
  if (/* @__PURE__ */ require_objects_predicates.isObject(attestations) && require_primordials_object.ObjectHasOwn(attestations, "provenance") && attestations["provenance"]) status.provenance = true;
@@ -21,7 +21,7 @@ src_external_npm_package_arg = require_runtime.__toESM(src_external_npm_package_
21
21
  * // { user: 'lodash', project: 'lodash' }
22
22
  * ```
23
23
  */
24
- /* @__NO_SIDE_EFFECTS__ */
24
+ /*@__NO_SIDE_EFFECTS__*/
25
25
  function getRepoUrlDetails(repoUrl = "") {
26
26
  const match = /^(?:[a-z][a-z+]*:\/\/)(?:[^/@]+@)?github\.com\/([^?#]+)(?:[?#]|$)/i.exec(repoUrl);
27
27
  if (!match || !match[1]) return {
@@ -45,7 +45,7 @@ function getRepoUrlDetails(repoUrl = "") {
45
45
  * // 'https://api.github.com/repos/lodash/lodash/git/ref/tags/v4.17.21'
46
46
  * ```
47
47
  */
48
- /* @__NO_SIDE_EFFECTS__ */
48
+ /*@__NO_SIDE_EFFECTS__*/
49
49
  function gitHubTagRefUrl(user, project, tag) {
50
50
  return `https://api.github.com/repos/${user}/${project}/git/ref/tags/${tag}`;
51
51
  }
@@ -58,7 +58,7 @@ function gitHubTagRefUrl(user, project, tag) {
58
58
  * // 'https://github.com/lodash/lodash/archive/abc123.tar.gz'
59
59
  * ```
60
60
  */
61
- /* @__NO_SIDE_EFFECTS__ */
61
+ /*@__NO_SIDE_EFFECTS__*/
62
62
  function gitHubTgzUrl(user, project, sha) {
63
63
  return `https://github.com/${user}/${project}/archive/${sha}.tar.gz`;
64
64
  }
@@ -71,7 +71,7 @@ function gitHubTgzUrl(user, project, sha) {
71
71
  * isGitHubTgzSpec('lodash@4.17.21') // false
72
72
  * ```
73
73
  */
74
- /* @__NO_SIDE_EFFECTS__ */
74
+ /*@__NO_SIDE_EFFECTS__*/
75
75
  function isGitHubTgzSpec(spec, where) {
76
76
  let parsedSpec;
77
77
  if (/* @__PURE__ */ require_objects_predicates.isPlainObject(spec)) parsedSpec = spec;
@@ -88,7 +88,7 @@ function isGitHubTgzSpec(spec, where) {
88
88
  * isGitHubUrlSpec('lodash@4.17.21') // false
89
89
  * ```
90
90
  */
91
- /* @__NO_SIDE_EFFECTS__ */
91
+ /*@__NO_SIDE_EFFECTS__*/
92
92
  function isGitHubUrlSpec(spec, where) {
93
93
  let parsedSpec;
94
94
  if (/* @__PURE__ */ require_objects_predicates.isPlainObject(spec)) parsedSpec = spec;
@@ -19,7 +19,7 @@ src_external_validate_npm_package_name = require_runtime.__toESM(src_external_va
19
19
  * isBlessedPackageName('lodash') // false
20
20
  * ```
21
21
  */
22
- /* @__NO_SIDE_EFFECTS__ */
22
+ /*@__NO_SIDE_EFFECTS__*/
23
23
  function isBlessedPackageName(name) {
24
24
  return typeof name === "string" && (name === "sfw" || name === "socket" || require_primordials_string.StringPrototypeStartsWith(name, "@socketoverride/") || require_primordials_string.StringPrototypeStartsWith(name, "@socketregistry/") || require_primordials_string.StringPrototypeStartsWith(name, "@socketsecurity/"));
25
25
  }
@@ -32,7 +32,7 @@ function isBlessedPackageName(name) {
32
32
  * isRegistryFetcherType('git') // false
33
33
  * ```
34
34
  */
35
- /* @__NO_SIDE_EFFECTS__ */
35
+ /*@__NO_SIDE_EFFECTS__*/
36
36
  function isRegistryFetcherType(type) {
37
37
  return type === "alias" || type === "range" || type === "tag" || type === "version";
38
38
  }
@@ -45,7 +45,7 @@ function isRegistryFetcherType(type) {
45
45
  * isValidPackageName('.invalid') // false
46
46
  * ```
47
47
  */
48
- /* @__NO_SIDE_EFFECTS__ */
48
+ /*@__NO_SIDE_EFFECTS__*/
49
49
  function isValidPackageName(name) {
50
50
  return (0, src_external_validate_npm_package_name.default)(name).validForOldPackages;
51
51
  }
@@ -35,9 +35,9 @@ let _url;
35
35
  *
36
36
  * @private
37
37
  */
38
- /* @__NO_SIDE_EFFECTS__ */
38
+ /*@__NO_SIDE_EFFECTS__*/
39
39
  function getUrl() {
40
- if (_url === void 0) _url = /* @__PURE__ */ require("node:url");
40
+ if (_url === void 0) _url = /*@__PURE__*/ require("node:url");
41
41
  return _url;
42
42
  }
43
43
  /**
@@ -61,7 +61,7 @@ function getUrl() {
61
61
  * @returns {string} The string representation, or empty string for
62
62
  * null/undefined.
63
63
  */
64
- /* @__NO_SIDE_EFFECTS__ */
64
+ /*@__NO_SIDE_EFFECTS__*/
65
65
  function pathLikeToString(pathLike) {
66
66
  if (pathLike === null || pathLike === void 0) return "";
67
67
  if (typeof pathLike === "string") return pathLike;