@socketsecurity/lib 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/CHANGELOG.md +371 -1185
  2. package/README.md +1 -1
  3. package/dist/abort.js +7 -6
  4. package/dist/agent.js +16 -15
  5. package/dist/ansi.js +3 -2
  6. package/dist/archives.js +18 -17
  7. package/dist/argv/flags.js +29 -28
  8. package/dist/argv/parse.js +4 -3
  9. package/dist/arrays.js +3 -2
  10. package/dist/bin.js +12 -11
  11. package/dist/cacache.js +16 -11
  12. package/dist/cache-with-ttl.js +26 -21
  13. package/dist/colors.js +2 -1
  14. package/dist/constants/licenses.js +2 -1
  15. package/dist/constants/lifecycle-script-names.js +2 -1
  16. package/dist/constants/maintained-node-versions.js +2 -1
  17. package/dist/constants/node.js +4 -3
  18. package/dist/constants/package-default-socket-categories.js +2 -1
  19. package/dist/constants/packages.js +4 -3
  20. package/dist/constants/socket.js +1 -1
  21. package/dist/cover/code.js +9 -8
  22. package/dist/cover/formatters.js +12 -11
  23. package/dist/cover/type.js +5 -4
  24. package/dist/crypto.d.ts +36 -0
  25. package/dist/{effects/ultra.js → crypto.js} +26 -37
  26. package/dist/debug.js +12 -15
  27. package/dist/dlx/arborist.js +10 -9
  28. package/dist/dlx/binary.js +27 -24
  29. package/dist/dlx/cache.js +2 -10
  30. package/dist/dlx/detect.js +6 -5
  31. package/dist/dlx/integrity.js +13 -11
  32. package/dist/dlx/lockfile.js +7 -6
  33. package/dist/dlx/manifest.js +6 -5
  34. package/dist/dlx/package.js +17 -16
  35. package/dist/dlx/packages.js +6 -5
  36. package/dist/dlx/paths.d.ts +1 -1
  37. package/dist/dlx/paths.js +2 -1
  38. package/dist/effects/pulse-frames.js +4 -3
  39. package/dist/effects/shimmer-keyframes.d.ts +62 -0
  40. package/dist/effects/shimmer-keyframes.js +55 -0
  41. package/dist/effects/shimmer-terminal.d.ts +66 -0
  42. package/dist/effects/shimmer-terminal.js +57 -0
  43. package/dist/effects/shimmer.d.ts +293 -0
  44. package/dist/effects/shimmer.js +180 -0
  45. package/dist/env/rewire.js +4 -3
  46. package/dist/env.js +5 -4
  47. package/dist/errors.js +1 -1
  48. package/dist/external/@npmcli/package-json/lib/read-package.js +10 -10
  49. package/dist/external/@npmcli/package-json.js +372 -372
  50. package/dist/external/@npmcli/promise-spawn.js +24 -24
  51. package/dist/external/@socketregistry/packageurl-js.js +19 -18
  52. package/dist/external/@socketregistry/yocto-spinner.js +4 -3
  53. package/dist/external/@yarnpkg/extensions.js +2 -1
  54. package/dist/external/adm-zip.js +71 -71
  55. package/dist/external/debug.js +22 -22
  56. package/dist/external/external-pack.js +45 -45
  57. package/dist/external/fast-sort.js +5 -5
  58. package/dist/external/libnpmexec.js +4 -3
  59. package/dist/external/npm-pack.js +369 -369
  60. package/dist/external/p-map.js +9 -9
  61. package/dist/external/pico-pack.js +190 -190
  62. package/dist/external/pony-cause.js +2 -1
  63. package/dist/external/spdx-pack.js +11 -10
  64. package/dist/external/tar-fs.js +58 -58
  65. package/dist/external/which.js +13 -13
  66. package/dist/external/yargs-parser.js +71 -71
  67. package/dist/fs.js +50 -68
  68. package/dist/git.js +14 -13
  69. package/dist/github.d.ts +34 -0
  70. package/dist/github.js +248 -23
  71. package/dist/globs.d.ts +20 -0
  72. package/dist/globs.js +134 -25
  73. package/dist/http-request.d.ts +4 -3
  74. package/dist/http-request.js +39 -32
  75. package/dist/ipc-cli.js +2 -1
  76. package/dist/ipc.js +5 -4
  77. package/dist/json/edit.js +4 -3
  78. package/dist/json/format.js +3 -2
  79. package/dist/json/parse.js +7 -6
  80. package/dist/links.js +2 -1
  81. package/dist/logger.js +21 -14
  82. package/dist/memoization.js +16 -15
  83. package/dist/node/async-hooks.d.ts +6 -0
  84. package/dist/node/async-hooks.js +34 -0
  85. package/dist/node/child-process.d.ts +11 -0
  86. package/dist/node/child-process.js +34 -0
  87. package/dist/node/crypto.d.ts +6 -0
  88. package/dist/node/crypto.js +34 -0
  89. package/dist/node/events.d.ts +6 -0
  90. package/dist/node/events.js +34 -0
  91. package/dist/node/fs-promises.d.ts +6 -0
  92. package/dist/node/fs-promises.js +34 -0
  93. package/dist/node/fs.d.ts +14 -0
  94. package/dist/node/fs.js +34 -0
  95. package/dist/node/http.d.ts +6 -0
  96. package/dist/node/http.js +34 -0
  97. package/dist/node/https.d.ts +6 -0
  98. package/dist/node/https.js +34 -0
  99. package/dist/node/os.d.ts +6 -0
  100. package/dist/node/os.js +34 -0
  101. package/dist/node/path.d.ts +6 -0
  102. package/dist/node/path.js +34 -0
  103. package/dist/node/timers-promises.d.ts +6 -0
  104. package/dist/node/timers-promises.js +34 -0
  105. package/dist/node/url.d.ts +6 -0
  106. package/dist/node/url.js +34 -0
  107. package/dist/node/util.d.ts +6 -0
  108. package/dist/node/util.js +34 -0
  109. package/dist/objects.js +2 -2
  110. package/dist/packages/edit.js +8 -7
  111. package/dist/packages/exports.js +17 -16
  112. package/dist/packages/isolation.js +20 -13
  113. package/dist/packages/licenses.js +6 -3
  114. package/dist/packages/manifest.js +2 -1
  115. package/dist/packages/normalize.js +8 -4
  116. package/dist/packages/operations.js +5 -4
  117. package/dist/packages/provenance.js +7 -6
  118. package/dist/packages/specs.js +2 -1
  119. package/dist/packages/validation.js +2 -1
  120. package/dist/paths/normalize.js +32 -40
  121. package/dist/paths/packages.js +2 -1
  122. package/dist/paths/rewire.js +3 -2
  123. package/dist/performance.js +19 -18
  124. package/dist/primordials.d.ts +85 -2
  125. package/dist/primordials.js +311 -23
  126. package/dist/process-lock.js +14 -13
  127. package/dist/promise-queue.js +17 -9
  128. package/dist/promises.d.ts +29 -6
  129. package/dist/promises.js +19 -15
  130. package/dist/regexps.js +9 -8
  131. package/dist/releases/github-api.d.ts +56 -0
  132. package/dist/releases/github-api.js +275 -0
  133. package/dist/releases/github-archives.d.ts +60 -0
  134. package/dist/releases/github-archives.js +136 -0
  135. package/dist/releases/github-assets.d.ts +21 -0
  136. package/dist/releases/github-assets.js +52 -0
  137. package/dist/releases/github-auth.d.ts +16 -0
  138. package/dist/releases/github-auth.js +51 -0
  139. package/dist/releases/github-downloads.d.ts +42 -0
  140. package/dist/releases/github-downloads.js +155 -0
  141. package/dist/releases/github-types.d.ts +66 -0
  142. package/dist/{effects/types.js → releases/github-types.js} +2 -2
  143. package/dist/releases/socket-btm.d.ts +1 -1
  144. package/dist/releases/socket-btm.js +17 -17
  145. package/dist/schema/parse.js +2 -1
  146. package/dist/schema/validate.js +6 -5
  147. package/dist/sea/util.d.ts +43 -0
  148. package/dist/{sea.js → sea/util.js} +7 -7
  149. package/dist/shadow.js +2 -1
  150. package/dist/signal-exit.js +2 -2
  151. package/dist/smol/primordial.d.ts +80 -0
  152. package/dist/smol/primordial.js +46 -0
  153. package/dist/smol/util.d.ts +87 -0
  154. package/dist/smol/util.js +59 -0
  155. package/dist/smol/versions.d.ts +46 -0
  156. package/dist/smol/versions.js +46 -0
  157. package/dist/spawn.js +58 -63
  158. package/dist/spinner.d.ts +13 -6
  159. package/dist/spinner.js +75 -57
  160. package/dist/ssri.js +8 -7
  161. package/dist/stdio/footer.js +13 -12
  162. package/dist/stdio/header.js +5 -4
  163. package/dist/stdio/progress.js +13 -12
  164. package/dist/strings.js +19 -18
  165. package/dist/suppress-warnings.js +2 -2
  166. package/dist/tables.js +16 -13
  167. package/dist/temporary-executor.js +2 -1
  168. package/dist/themes/context.js +2 -1
  169. package/dist/themes/types.d.ts +1 -1
  170. package/dist/themes/utils.d.ts +8 -3
  171. package/dist/themes/utils.js +29 -5
  172. package/dist/url.js +4 -3
  173. package/dist/versions.js +27 -22
  174. package/package.json +120 -26
  175. package/dist/effects/text-shimmer.d.ts +0 -58
  176. package/dist/effects/text-shimmer.js +0 -192
  177. package/dist/effects/types.d.ts +0 -47
  178. package/dist/effects/ultra.d.ts +0 -22
  179. package/dist/releases/github.d.ts +0 -234
  180. package/dist/releases/github.js +0 -417
  181. package/dist/sea.d.ts +0 -30
  182. package/dist/themes/index.d.ts +0 -49
  183. package/dist/themes/index.js +0 -60
package/dist/tables.js CHANGED
@@ -36,12 +36,13 @@ __export(tables_exports, {
36
36
  module.exports = __toCommonJS(tables_exports);
37
37
  var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
38
38
  var import_strings = require("./strings");
39
+ var import_primordials = require("./primordials");
39
40
  function displayWidth(text) {
40
41
  return (0, import_strings.stringWidth)(text);
41
42
  }
42
43
  function padText(text, width, align = "left") {
43
44
  const textWidth = displayWidth(text);
44
- const padding = Math.max(0, width - textWidth);
45
+ const padding = (0, import_primordials.MathMax)(0, width - textWidth);
45
46
  switch (align) {
46
47
  case "right":
47
48
  return " ".repeat(padding) + text;
@@ -60,18 +61,18 @@ function formatSimpleTable(data, columns) {
60
61
  }
61
62
  const widths = columns.map((col) => {
62
63
  const headerWidth = displayWidth(col.header);
63
- const maxDataWidth = Math.max(
64
+ const maxDataWidth = (0, import_primordials.MathMax)(
64
65
  ...data.map((row) => displayWidth(String(row[col.key] ?? "")))
65
66
  );
66
- return col.width ?? Math.max(headerWidth, maxDataWidth);
67
+ return col.width ?? (0, import_primordials.MathMax)(headerWidth, maxDataWidth);
67
68
  });
68
69
  const lines = [];
69
70
  const headerCells = columns.map(
70
71
  (col, i) => padText(import_yoctocolors_cjs.default.bold(col.header), widths[i], col.align)
71
72
  );
72
- lines.push(headerCells.join(" "));
73
+ (0, import_primordials.ArrayPrototypePush)(lines, headerCells.join(" "));
73
74
  const separators = widths.map((w) => import_yoctocolors_cjs.default.dim("\u2500".repeat(w)));
74
- lines.push(separators.join(" "));
75
+ (0, import_primordials.ArrayPrototypePush)(lines, separators.join(" "));
75
76
  for (const row of data) {
76
77
  const cells = columns.map((col, i) => {
77
78
  let value = String(row[col.key] ?? "");
@@ -80,7 +81,7 @@ function formatSimpleTable(data, columns) {
80
81
  }
81
82
  return padText(value, widths[i], col.align);
82
83
  });
83
- lines.push(cells.join(" "));
84
+ (0, import_primordials.ArrayPrototypePush)(lines, cells.join(" "));
84
85
  }
85
86
  return lines.join("\n");
86
87
  }
@@ -90,23 +91,24 @@ function formatTable(data, columns) {
90
91
  }
91
92
  const widths = columns.map((col) => {
92
93
  const headerWidth = displayWidth(col.header);
93
- const maxDataWidth = Math.max(
94
+ const maxDataWidth = (0, import_primordials.MathMax)(
94
95
  ...data.map((row) => displayWidth(String(row[col.key] ?? "")))
95
96
  );
96
- return col.width ?? Math.max(headerWidth, maxDataWidth);
97
+ return col.width ?? (0, import_primordials.MathMax)(headerWidth, maxDataWidth);
97
98
  });
98
99
  const lines = [];
99
100
  const topBorder = `\u250C\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u252C\u2500")}\u2500\u2510`;
100
- lines.push(import_yoctocolors_cjs.default.dim(topBorder));
101
+ (0, import_primordials.ArrayPrototypePush)(lines, import_yoctocolors_cjs.default.dim(topBorder));
101
102
  const headerCells = columns.map((col, i) => {
102
103
  const text = import_yoctocolors_cjs.default.bold(col.header);
103
104
  return padText(text, widths[i], col.align);
104
105
  });
105
- lines.push(
106
+ (0, import_primordials.ArrayPrototypePush)(
107
+ lines,
106
108
  import_yoctocolors_cjs.default.dim("\u2502 ") + headerCells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
107
109
  );
108
110
  const headerSep = `\u251C\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u253C\u2500")}\u2500\u2524`;
109
- lines.push(import_yoctocolors_cjs.default.dim(headerSep));
111
+ (0, import_primordials.ArrayPrototypePush)(lines, import_yoctocolors_cjs.default.dim(headerSep));
110
112
  for (const row of data) {
111
113
  const cells = columns.map((col, i) => {
112
114
  let value = String(row[col.key] ?? "");
@@ -115,12 +117,13 @@ function formatTable(data, columns) {
115
117
  }
116
118
  return padText(value, widths[i], col.align);
117
119
  });
118
- lines.push(
120
+ (0, import_primordials.ArrayPrototypePush)(
121
+ lines,
119
122
  import_yoctocolors_cjs.default.dim("\u2502 ") + cells.join(import_yoctocolors_cjs.default.dim(" \u2502 ")) + import_yoctocolors_cjs.default.dim(" \u2502")
120
123
  );
121
124
  }
122
125
  const bottomBorder = `\u2514\u2500${widths.map((w) => "\u2500".repeat(w)).join("\u2500\u2534\u2500")}\u2500\u2518`;
123
- lines.push(import_yoctocolors_cjs.default.dim(bottomBorder));
126
+ (0, import_primordials.ArrayPrototypePush)(lines, import_yoctocolors_cjs.default.dim(bottomBorder));
124
127
  return lines.join("\n");
125
128
  }
126
129
  // Annotate the CommonJS export names for ESM import in node:
@@ -38,7 +38,8 @@ var import_platform = require("./constants/platform");
38
38
  var import_normalize = require("./paths/normalize");
39
39
  function isRunningInTemporaryExecutor(cwd = import_node_process.default.cwd()) {
40
40
  const userAgent = import_node_process.default.env["npm_config_user_agent"];
41
- if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
41
+ if (userAgent?.includes("exec") || userAgent?.includes("npx") || // # socket-hook: allow npx
42
+ userAgent?.includes("dlx")) {
42
43
  return true;
43
44
  }
44
45
  const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
@@ -28,6 +28,7 @@ __export(context_exports, {
28
28
  });
29
29
  module.exports = __toCommonJS(context_exports);
30
30
  var import_themes = require("./themes");
31
+ var import_primordials = require("../primordials");
31
32
  let _async_hooks;
32
33
  function emitThemeChange(theme) {
33
34
  for (const listener of listeners) {
@@ -44,7 +45,7 @@ function getAsyncHooks() {
44
45
  const { AsyncLocalStorage } = /* @__PURE__ */ getAsyncHooks();
45
46
  const themeStorage = new AsyncLocalStorage();
46
47
  let fallbackTheme = import_themes.SOCKET_THEME;
47
- const listeners = /* @__PURE__ */ new Set();
48
+ const listeners = new import_primordials.SetCtor();
48
49
  function getTheme() {
49
50
  return themeStorage.getStore() ?? fallbackTheme;
50
51
  }
@@ -3,8 +3,8 @@
3
3
  * Type-safe theming for spinners, loggers, prompts, and links.
4
4
  */
5
5
  import type { ColorValue } from '../colors';
6
+ import type { ShimmerDirection } from '../effects/shimmer';
6
7
  import type { SpinnerStyle } from '../spinner';
7
- import type { ShimmerDirection } from '../effects/text-shimmer';
8
8
  /**
9
9
  * Color reference — direct value or semantic keyword.
10
10
  * Keywords: 'primary', 'secondary', 'inherit', 'rainbow'
@@ -2,8 +2,13 @@
2
2
  * @fileoverview Theme utilities — color resolution and composition.
3
3
  */
4
4
  import type { ColorValue } from '../colors';
5
- import type { ShimmerColorGradient } from '../effects/text-shimmer';
5
+ import type { Palette } from '../effects/shimmer';
6
6
  import type { ColorReference, Theme, ThemeColors } from './types';
7
+ /**
8
+ * Rainbow gradient colors used for the `'rainbow'` color keyword.
9
+ * 10 hues — cycles through the full color spectrum with smooth transitions.
10
+ */
11
+ export declare const RAINBOW_GRADIENT: Palette;
7
12
  /**
8
13
  * Create new theme from complete specification.
9
14
  *
@@ -64,7 +69,7 @@ export declare function extendTheme(base: Theme, overrides: Partial<Omit<Theme,
64
69
  * resolveColor([255, 0, 0], theme.colors)
65
70
  * ```
66
71
  */
67
- export declare function resolveColor(value: ColorReference | ColorValue, colors: ThemeColors): ColorValue | 'inherit' | ShimmerColorGradient;
72
+ export declare function resolveColor(value: ColorReference | ColorValue, colors: ThemeColors): ColorValue | 'inherit' | Palette;
68
73
  /**
69
74
  * Resolve shimmer color with gradient support.
70
75
  *
@@ -78,4 +83,4 @@ export declare function resolveColor(value: ColorReference | ColorValue, colors:
78
83
  * resolveShimmerColor('primary', theme)
79
84
  * ```
80
85
  */
81
- export declare function resolveShimmerColor(value: ColorReference | ColorValue[] | undefined, theme: Theme): ColorValue | ShimmerColorGradient | 'inherit';
86
+ export declare function resolveShimmerColor(value: ColorReference | ColorValue[] | undefined, theme: Theme): ColorValue | Palette | 'inherit';
@@ -20,13 +20,36 @@ var __copyProps = (to, from, except, desc) => {
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
  var utils_exports = {};
22
22
  __export(utils_exports, {
23
+ RAINBOW_GRADIENT: () => RAINBOW_GRADIENT,
23
24
  createTheme: () => createTheme,
24
25
  extendTheme: () => extendTheme,
25
26
  resolveColor: () => resolveColor,
26
27
  resolveShimmerColor: () => resolveShimmerColor
27
28
  });
28
29
  module.exports = __toCommonJS(utils_exports);
29
- var import_ultra = require("../effects/ultra");
30
+ var import_primordials = require("../primordials");
31
+ const RAINBOW_GRADIENT = [
32
+ // Red/pink.
33
+ [255, 100, 120],
34
+ // Orange.
35
+ [255, 140, 80],
36
+ // Yellow/gold.
37
+ [255, 180, 60],
38
+ // Yellow/green.
39
+ [220, 200, 80],
40
+ // Green.
41
+ [120, 200, 100],
42
+ // Cyan/turquoise.
43
+ [80, 200, 180],
44
+ // Blue.
45
+ [80, 160, 220],
46
+ // Purple/violet.
47
+ [140, 120, 220],
48
+ // Pink/magenta.
49
+ [200, 100, 200],
50
+ // Red/pink.
51
+ [255, 100, 140]
52
+ ];
30
53
  function createTheme(config) {
31
54
  return {
32
55
  __proto__: null,
@@ -86,7 +109,7 @@ function resolveColor(value, colors) {
86
109
  return "inherit";
87
110
  }
88
111
  if (value === "rainbow") {
89
- return import_ultra.RAINBOW_GRADIENT;
112
+ return RAINBOW_GRADIENT;
90
113
  }
91
114
  return value;
92
115
  }
@@ -97,13 +120,13 @@ function resolveShimmerColor(value, theme) {
97
120
  return "inherit";
98
121
  }
99
122
  if (value === "rainbow") {
100
- return import_ultra.RAINBOW_GRADIENT;
123
+ return RAINBOW_GRADIENT;
101
124
  }
102
125
  if (value === "inherit") {
103
126
  return "inherit";
104
127
  }
105
- if (Array.isArray(value)) {
106
- if (value.length > 0 && Array.isArray(value[0])) {
128
+ if ((0, import_primordials.ArrayIsArray)(value)) {
129
+ if (value.length > 0 && (0, import_primordials.ArrayIsArray)(value[0])) {
107
130
  return value;
108
131
  }
109
132
  return value;
@@ -112,6 +135,7 @@ function resolveShimmerColor(value, theme) {
112
135
  }
113
136
  // Annotate the CommonJS export names for ESM import in node:
114
137
  0 && (module.exports = {
138
+ RAINBOW_GRADIENT,
115
139
  createTheme,
116
140
  extendTheme,
117
141
  resolveColor,
package/dist/url.js CHANGED
@@ -31,6 +31,7 @@ __export(url_exports, {
31
31
  urlSearchParamsGetBoolean: () => urlSearchParamsGetBoolean
32
32
  });
33
33
  module.exports = __toCommonJS(url_exports);
34
+ var import_primordials = require("./primordials");
34
35
  const BooleanCtor = Boolean;
35
36
  const UrlCtor = URL;
36
37
  // @__NO_SIDE_EFFECTS__
@@ -39,10 +40,10 @@ function createRelativeUrl(path, options) {
39
40
  __proto__: null,
40
41
  ...options
41
42
  };
42
- const relativePath = path.replace(/^\//, "");
43
+ const relativePath = (0, import_primordials.StringPrototypeReplace)(path, /^\//, "");
43
44
  if (base) {
44
45
  let baseUrl = base;
45
- if (!baseUrl.endsWith("/")) {
46
+ if (!(0, import_primordials.StringPrototypeEndsWith)(baseUrl, "/")) {
46
47
  baseUrl += "/";
47
48
  }
48
49
  return baseUrl + relativePath;
@@ -94,7 +95,7 @@ function urlSearchParamAsNumber(params, key, options) {
94
95
  const value = params.get(key);
95
96
  if (value !== null) {
96
97
  const num = Number(value);
97
- return !Number.isNaN(num) ? num : defaultValue;
98
+ return !(0, import_primordials.NumberIsNaN)(num) ? num : defaultValue;
98
99
  }
99
100
  }
100
101
  return defaultValue;
package/dist/versions.js CHANGED
@@ -42,6 +42,8 @@ __export(versions_exports, {
42
42
  versionDiff: () => versionDiff
43
43
  });
44
44
  module.exports = __toCommonJS(versions_exports);
45
+ var import_versions = require("./smol/versions");
46
+ const _smolVersions = (0, import_versions.getSmolVersions)();
45
47
  let _semver;
46
48
  function getSemver() {
47
49
  if (_semver === void 0) {
@@ -49,6 +51,9 @@ function getSemver() {
49
51
  }
50
52
  return _semver;
51
53
  }
54
+ function getVersionsImpl() {
55
+ return _smolVersions ?? getSemver();
56
+ }
52
57
  function coerceVersion(version) {
53
58
  const semver = getSemver();
54
59
  const coerced = semver.coerce(version);
@@ -56,15 +61,15 @@ function coerceVersion(version) {
56
61
  }
57
62
  function compareVersions(v1, v2) {
58
63
  try {
59
- const semver = getSemver();
60
- return semver.compare(v1, v2);
64
+ const impl = getVersionsImpl();
65
+ return impl.compare(v1, v2);
61
66
  } catch {
62
67
  return void 0;
63
68
  }
64
69
  }
65
70
  function filterVersions(versions, range) {
66
- const semver = getSemver();
67
- return versions.filter((v) => semver.satisfies(v, range));
71
+ const impl = getVersionsImpl();
72
+ return versions.filter((v) => impl.satisfies(v, range));
68
73
  }
69
74
  function getMajorVersion(version) {
70
75
  const semver = getSemver();
@@ -86,28 +91,28 @@ function incrementVersion(version, release, identifier) {
86
91
  return semver.inc(version, release, identifier) || void 0;
87
92
  }
88
93
  function isEqual(version1, version2) {
89
- const semver = getSemver();
90
- return semver.eq(version1, version2);
94
+ const impl = getVersionsImpl();
95
+ return impl.eq(version1, version2);
91
96
  }
92
97
  function isGreaterThan(version1, version2) {
93
- const semver = getSemver();
94
- return semver.gt(version1, version2);
98
+ const impl = getVersionsImpl();
99
+ return impl.gt(version1, version2);
95
100
  }
96
101
  function isGreaterThanOrEqual(version1, version2) {
97
- const semver = getSemver();
98
- return semver.gte(version1, version2);
102
+ const impl = getVersionsImpl();
103
+ return impl.gte(version1, version2);
99
104
  }
100
105
  function isLessThan(version1, version2) {
101
- const semver = getSemver();
102
- return semver.lt(version1, version2);
106
+ const impl = getVersionsImpl();
107
+ return impl.lt(version1, version2);
103
108
  }
104
109
  function isLessThanOrEqual(version1, version2) {
105
- const semver = getSemver();
106
- return semver.lte(version1, version2);
110
+ const impl = getVersionsImpl();
111
+ return impl.lte(version1, version2);
107
112
  }
108
113
  function isValidVersion(version) {
109
- const semver = getSemver();
110
- return semver.valid(version) !== null;
114
+ const impl = getVersionsImpl();
115
+ return impl.valid(version) != null;
111
116
  }
112
117
  function maxVersion(versions) {
113
118
  const semver = getSemver();
@@ -132,16 +137,16 @@ function parseVersion(version) {
132
137
  };
133
138
  }
134
139
  function satisfiesVersion(version, range) {
135
- const semver = getSemver();
136
- return semver.satisfies(version, range);
140
+ const impl = getVersionsImpl();
141
+ return impl.satisfies(version, range);
137
142
  }
138
143
  function sortVersions(versions) {
139
- const semver = getSemver();
140
- return semver.sort([...versions]);
144
+ const impl = getVersionsImpl();
145
+ return impl.sort([...versions]);
141
146
  }
142
147
  function sortVersionsDesc(versions) {
143
- const semver = getSemver();
144
- return semver.rsort([...versions]);
148
+ const impl = getVersionsImpl();
149
+ return impl.rsort([...versions]);
145
150
  }
146
151
  function versionDiff(version1, version2) {
147
152
  try {
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@socketsecurity/lib",
3
- "version": "5.26.0",
4
- "packageManager": "pnpm@11.0.0-rc.5",
3
+ "version": "5.27.0",
4
+ "packageManager": "pnpm@11.0.6+sha512.97f906e1da2bedac3df83cadae04b4753a130092dd49d55cd36825ad3e623e9df3f97754f8f259e699172a360fac569acf2f908e7732bdae3eddb2dcf7e121fd",
5
5
  "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "provenance": true
9
+ },
6
10
  "description": "Core utilities and infrastructure for Socket.dev security tools",
7
11
  "keywords": [
8
12
  "Socket.dev",
@@ -219,6 +223,10 @@
219
223
  "types": "./dist/cover/types.d.ts",
220
224
  "default": "./dist/cover/types.js"
221
225
  },
226
+ "./crypto": {
227
+ "types": "./dist/crypto.d.ts",
228
+ "default": "./dist/crypto.js"
229
+ },
222
230
  "./debug": {
223
231
  "types": "./dist/debug.d.ts",
224
232
  "default": "./dist/debug.js"
@@ -271,17 +279,17 @@
271
279
  "types": "./dist/effects/pulse-frames.d.ts",
272
280
  "default": "./dist/effects/pulse-frames.js"
273
281
  },
274
- "./effects/text-shimmer": {
275
- "types": "./dist/effects/text-shimmer.d.ts",
276
- "default": "./dist/effects/text-shimmer.js"
282
+ "./effects/shimmer": {
283
+ "types": "./dist/effects/shimmer.d.ts",
284
+ "default": "./dist/effects/shimmer.js"
277
285
  },
278
- "./effects/types": {
279
- "types": "./dist/effects/types.d.ts",
280
- "default": "./dist/effects/types.js"
286
+ "./effects/shimmer-keyframes": {
287
+ "types": "./dist/effects/shimmer-keyframes.d.ts",
288
+ "default": "./dist/effects/shimmer-keyframes.js"
281
289
  },
282
- "./effects/ultra": {
283
- "types": "./dist/effects/ultra.d.ts",
284
- "default": "./dist/effects/ultra.js"
290
+ "./effects/shimmer-terminal": {
291
+ "types": "./dist/effects/shimmer-terminal.d.ts",
292
+ "default": "./dist/effects/shimmer-terminal.js"
285
293
  },
286
294
  "./env": {
287
295
  "types": "./dist/env.d.ts",
@@ -431,6 +439,58 @@
431
439
  "types": "./dist/memoization.d.ts",
432
440
  "default": "./dist/memoization.js"
433
441
  },
442
+ "./node/async-hooks": {
443
+ "types": "./dist/node/async-hooks.d.ts",
444
+ "default": "./dist/node/async-hooks.js"
445
+ },
446
+ "./node/child-process": {
447
+ "types": "./dist/node/child-process.d.ts",
448
+ "default": "./dist/node/child-process.js"
449
+ },
450
+ "./node/crypto": {
451
+ "types": "./dist/node/crypto.d.ts",
452
+ "default": "./dist/node/crypto.js"
453
+ },
454
+ "./node/events": {
455
+ "types": "./dist/node/events.d.ts",
456
+ "default": "./dist/node/events.js"
457
+ },
458
+ "./node/fs": {
459
+ "types": "./dist/node/fs.d.ts",
460
+ "default": "./dist/node/fs.js"
461
+ },
462
+ "./node/fs-promises": {
463
+ "types": "./dist/node/fs-promises.d.ts",
464
+ "default": "./dist/node/fs-promises.js"
465
+ },
466
+ "./node/http": {
467
+ "types": "./dist/node/http.d.ts",
468
+ "default": "./dist/node/http.js"
469
+ },
470
+ "./node/https": {
471
+ "types": "./dist/node/https.d.ts",
472
+ "default": "./dist/node/https.js"
473
+ },
474
+ "./node/os": {
475
+ "types": "./dist/node/os.d.ts",
476
+ "default": "./dist/node/os.js"
477
+ },
478
+ "./node/path": {
479
+ "types": "./dist/node/path.d.ts",
480
+ "default": "./dist/node/path.js"
481
+ },
482
+ "./node/timers-promises": {
483
+ "types": "./dist/node/timers-promises.d.ts",
484
+ "default": "./dist/node/timers-promises.js"
485
+ },
486
+ "./node/url": {
487
+ "types": "./dist/node/url.d.ts",
488
+ "default": "./dist/node/url.js"
489
+ },
490
+ "./node/util": {
491
+ "types": "./dist/node/util.d.ts",
492
+ "default": "./dist/node/util.js"
493
+ },
434
494
  "./objects": {
435
495
  "types": "./dist/objects.d.ts",
436
496
  "default": "./dist/objects.js"
@@ -539,9 +599,29 @@
539
599
  "types": "./dist/regexps.d.ts",
540
600
  "default": "./dist/regexps.js"
541
601
  },
542
- "./releases/github": {
543
- "types": "./dist/releases/github.d.ts",
544
- "default": "./dist/releases/github.js"
602
+ "./releases/github-api": {
603
+ "types": "./dist/releases/github-api.d.ts",
604
+ "default": "./dist/releases/github-api.js"
605
+ },
606
+ "./releases/github-archives": {
607
+ "types": "./dist/releases/github-archives.d.ts",
608
+ "default": "./dist/releases/github-archives.js"
609
+ },
610
+ "./releases/github-assets": {
611
+ "types": "./dist/releases/github-assets.d.ts",
612
+ "default": "./dist/releases/github-assets.js"
613
+ },
614
+ "./releases/github-auth": {
615
+ "types": "./dist/releases/github-auth.d.ts",
616
+ "default": "./dist/releases/github-auth.js"
617
+ },
618
+ "./releases/github-downloads": {
619
+ "types": "./dist/releases/github-downloads.d.ts",
620
+ "default": "./dist/releases/github-downloads.js"
621
+ },
622
+ "./releases/github-types": {
623
+ "types": "./dist/releases/github-types.d.ts",
624
+ "default": "./dist/releases/github-types.js"
545
625
  },
546
626
  "./releases/socket-btm": {
547
627
  "types": "./dist/releases/socket-btm.d.ts",
@@ -559,9 +639,9 @@
559
639
  "types": "./dist/schema/validate.d.ts",
560
640
  "default": "./dist/schema/validate.js"
561
641
  },
562
- "./sea": {
563
- "types": "./dist/sea.d.ts",
564
- "default": "./dist/sea.js"
642
+ "./sea/util": {
643
+ "types": "./dist/sea/util.d.ts",
644
+ "default": "./dist/sea/util.js"
565
645
  },
566
646
  "./shadow": {
567
647
  "types": "./dist/shadow.d.ts",
@@ -571,6 +651,18 @@
571
651
  "types": "./dist/signal-exit.d.ts",
572
652
  "default": "./dist/signal-exit.js"
573
653
  },
654
+ "./smol/primordial": {
655
+ "types": "./dist/smol/primordial.d.ts",
656
+ "default": "./dist/smol/primordial.js"
657
+ },
658
+ "./smol/util": {
659
+ "types": "./dist/smol/util.d.ts",
660
+ "default": "./dist/smol/util.js"
661
+ },
662
+ "./smol/versions": {
663
+ "types": "./dist/smol/versions.d.ts",
664
+ "default": "./dist/smol/versions.js"
665
+ },
574
666
  "./sorts": {
575
667
  "types": "./dist/sorts.d.ts",
576
668
  "default": "./dist/sorts.js"
@@ -639,10 +731,6 @@
639
731
  "types": "./dist/temporary-executor.d.ts",
640
732
  "default": "./dist/temporary-executor.js"
641
733
  },
642
- "./themes": {
643
- "types": "./dist/themes/index.d.ts",
644
- "default": "./dist/themes/index.js"
645
- },
646
734
  "./themes/context": {
647
735
  "types": "./dist/themes/context.d.ts",
648
736
  "default": "./dist/themes/context.js"
@@ -677,9 +765,11 @@
677
765
  },
678
766
  "./data/extensions.json": "./data/extensions.json",
679
767
  "./package.json": "./package.json",
768
+ "./socket-repo-template-schema.json": "./socket-repo-template-schema.json",
680
769
  "./tsconfig.dts.json": "./tsconfig.dts.json",
681
770
  "./tsconfig.json": "./tsconfig.json",
682
771
  "./tsconfig.test.json": "./tsconfig.test.json",
772
+ "./xport.json": "./xport.json",
683
773
  "./xport.schema.json": "./xport.schema.json"
684
774
  },
685
775
  "files": [
@@ -689,7 +779,7 @@
689
779
  ],
690
780
  "engines": {
691
781
  "node": ">=22",
692
- "pnpm": ">=11.0.0-rc.0"
782
+ "pnpm": ">=11.0.6"
693
783
  },
694
784
  "sideEffects": false,
695
785
  "scripts": {
@@ -700,13 +790,17 @@
700
790
  "cover": "node scripts/test/cover.mts",
701
791
  "dev": "node scripts/build/main.mts --watch",
702
792
  "fix": "node scripts/fix.mts",
793
+ "format": "oxfmt --write .",
794
+ "format:check": "oxfmt --check .",
703
795
  "lint": "node scripts/lint.mts",
704
796
  "prim": "node tools/prim/bin/prim.mts",
705
- "security": "agentshield scan && { command -v zizmor >/dev/null && zizmor .github/ || echo 'zizmor not installed — run pnpm run setup to install'; }",
797
+ "security": "node scripts/security.mts",
706
798
  "prepare": "husky && node scripts/build/main.mts --quiet",
707
799
  "prepublishOnly": "pnpm run build",
708
800
  "test": "node scripts/test/main.mts",
709
- "update": "node scripts/update.mts"
801
+ "update": "node scripts/update.mts",
802
+ "xport": "node scripts/xport.mts",
803
+ "xport:emit-schema": "node scripts/xport-emit-schema.mts"
710
804
  },
711
805
  "devDependencies": {
712
806
  "@anthropic-ai/claude-code": "2.1.92",
@@ -725,9 +819,9 @@
725
819
  "@npmcli/promise-spawn": "8.0.3",
726
820
  "@sinclair/typebox": "0.34.49",
727
821
  "@socketregistry/is-unicode-supported": "1.0.5",
728
- "@socketregistry/packageurl-js": "1.4.2",
822
+ "@socketregistry/packageurl-js": "catalog:",
729
823
  "@socketregistry/yocto-spinner": "1.0.25",
730
- "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.25.0",
824
+ "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.26.1",
731
825
  "@types/node": "24.9.2",
732
826
  "@typescript/native-preview": "7.0.0-dev.20260415.1",
733
827
  "@vitest/coverage-v8": "4.0.3",
@@ -1,58 +0,0 @@
1
- /**
2
- * @fileoverview Text shimmer animation utilities.
3
- * Provides animated highlight effects for spinner text with configurable directions:
4
- * - LTR (left-to-right): Shimmer wave moves from left to right
5
- * - RTL (right-to-left): Shimmer wave moves from right to left
6
- * - Bidirectional: Alternates between LTR and RTL each cycle
7
- * - Random: Picks a random direction each cycle
8
- * - None: No shimmer animation
9
- *
10
- * The shimmer effect creates a bright wave that travels across the text,
11
- * with characters near the wave appearing nearly white and fading to the
12
- * base color as they get further from the wave position.
13
- */
14
- import type { ShimmerColorGradient, ShimmerColorRgb, ShimmerDirection, ShimmerState } from './types';
15
- export type { ShimmerColor, ShimmerColorGradient, ShimmerColorInherit, ShimmerColorRgb, ShimmerConfig, ShimmerDirection, ShimmerState, } from './types';
16
- /**
17
- * Detected text formatting styles from ANSI codes.
18
- */
19
- type TextStyles = {
20
- bold: boolean;
21
- dim: boolean;
22
- italic: boolean;
23
- strikethrough: boolean;
24
- underline: boolean;
25
- };
26
- type ShimmerOptions = {
27
- readonly color?: ShimmerColorRgb | ShimmerColorGradient | undefined;
28
- readonly direction?: ShimmerDirection | undefined;
29
- readonly shimmerWidth?: number | undefined;
30
- readonly styles?: TextStyles | undefined;
31
- readonly theme?: import('../themes/types').Theme | import('../themes/themes').ThemeName | undefined;
32
- };
33
- export declare const COLOR_INHERIT = "inherit";
34
- export declare const DIR_LTR = "ltr";
35
- export declare const DIR_NONE = "none";
36
- export declare const DIR_RANDOM = "random";
37
- export declare const DIR_RTL = "rtl";
38
- export declare const MODE_BI = "bi";
39
- /**
40
- * Apply shimmer animation effect to text.
41
- * This is the main entry point for shimmer animations. It:
42
- * 1. Strips ANSI codes to get plain text for character positioning
43
- * 2. Detects any styling (bold, italic, underline, etc.) to preserve
44
- * 3. Calculates the current shimmer wave position based on animation step
45
- * 4. Renders each character with appropriate brightness based on distance from wave
46
- * 5. Updates the animation state for the next frame
47
- * 6. Handles direction changes for bidirectional and random modes
48
- *
49
- * @example
50
- * ```typescript
51
- * const state = { step: 0, speed: 0.33, currentDir: 'ltr', mode: 'ltr' }
52
- * const result = applyShimmer('Loading...', state, {
53
- * color: [140, 82, 255],
54
- * direction: 'ltr',
55
- * })
56
- * ```
57
- */
58
- export declare function applyShimmer(text: string, state: ShimmerState, options?: ShimmerOptions | undefined): string;