@socketsecurity/lib 5.26.0 → 5.26.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 (147) hide show
  1. package/CHANGELOG.md +345 -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} +33 -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 +70 -70
  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 +19 -23
  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/objects.js +2 -2
  84. package/dist/packages/edit.js +8 -7
  85. package/dist/packages/exports.js +17 -16
  86. package/dist/packages/isolation.js +20 -13
  87. package/dist/packages/licenses.js +6 -3
  88. package/dist/packages/manifest.js +2 -1
  89. package/dist/packages/normalize.js +8 -4
  90. package/dist/packages/operations.js +5 -4
  91. package/dist/packages/provenance.js +7 -6
  92. package/dist/packages/specs.js +2 -1
  93. package/dist/packages/validation.js +2 -1
  94. package/dist/paths/normalize.js +32 -40
  95. package/dist/paths/packages.js +2 -1
  96. package/dist/paths/rewire.js +3 -2
  97. package/dist/performance.js +19 -18
  98. package/dist/primordials.d.ts +9 -0
  99. package/dist/primordials.js +17 -0
  100. package/dist/process-lock.js +14 -13
  101. package/dist/promise-queue.js +17 -9
  102. package/dist/promises.d.ts +29 -6
  103. package/dist/promises.js +19 -15
  104. package/dist/regexps.js +9 -8
  105. package/dist/releases/github-api.d.ts +56 -0
  106. package/dist/releases/github-api.js +275 -0
  107. package/dist/releases/github-archives.d.ts +60 -0
  108. package/dist/releases/github-archives.js +136 -0
  109. package/dist/releases/github-assets.d.ts +21 -0
  110. package/dist/releases/github-assets.js +52 -0
  111. package/dist/releases/github-auth.d.ts +16 -0
  112. package/dist/releases/github-auth.js +51 -0
  113. package/dist/releases/github-downloads.d.ts +42 -0
  114. package/dist/releases/github-downloads.js +155 -0
  115. package/dist/releases/github-types.d.ts +66 -0
  116. package/dist/{effects/types.js → releases/github-types.js} +2 -2
  117. package/dist/releases/socket-btm.d.ts +1 -1
  118. package/dist/releases/socket-btm.js +17 -17
  119. package/dist/schema/parse.js +2 -1
  120. package/dist/schema/validate.js +6 -5
  121. package/dist/shadow.js +2 -1
  122. package/dist/signal-exit.js +2 -2
  123. package/dist/spawn.js +45 -35
  124. package/dist/spinner.d.ts +13 -6
  125. package/dist/spinner.js +75 -57
  126. package/dist/ssri.js +8 -7
  127. package/dist/stdio/footer.js +13 -12
  128. package/dist/stdio/header.js +5 -4
  129. package/dist/stdio/progress.js +13 -12
  130. package/dist/strings.js +19 -18
  131. package/dist/suppress-warnings.js +2 -2
  132. package/dist/tables.js +16 -13
  133. package/dist/temporary-executor.js +2 -1
  134. package/dist/themes/context.js +2 -1
  135. package/dist/themes/types.d.ts +1 -1
  136. package/dist/themes/utils.d.ts +8 -3
  137. package/dist/themes/utils.js +29 -5
  138. package/dist/url.js +4 -3
  139. package/package.json +44 -20
  140. package/dist/effects/text-shimmer.d.ts +0 -58
  141. package/dist/effects/text-shimmer.js +0 -192
  142. package/dist/effects/types.d.ts +0 -47
  143. package/dist/effects/ultra.d.ts +0 -22
  144. package/dist/releases/github.d.ts +0 -234
  145. package/dist/releases/github.js +0 -417
  146. package/dist/themes/index.d.ts +0 -49
  147. 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/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.26.1",
4
+ "packageManager": "pnpm@11.0.3",
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",
@@ -539,9 +547,29 @@
539
547
  "types": "./dist/regexps.d.ts",
540
548
  "default": "./dist/regexps.js"
541
549
  },
542
- "./releases/github": {
543
- "types": "./dist/releases/github.d.ts",
544
- "default": "./dist/releases/github.js"
550
+ "./releases/github-api": {
551
+ "types": "./dist/releases/github-api.d.ts",
552
+ "default": "./dist/releases/github-api.js"
553
+ },
554
+ "./releases/github-archives": {
555
+ "types": "./dist/releases/github-archives.d.ts",
556
+ "default": "./dist/releases/github-archives.js"
557
+ },
558
+ "./releases/github-assets": {
559
+ "types": "./dist/releases/github-assets.d.ts",
560
+ "default": "./dist/releases/github-assets.js"
561
+ },
562
+ "./releases/github-auth": {
563
+ "types": "./dist/releases/github-auth.d.ts",
564
+ "default": "./dist/releases/github-auth.js"
565
+ },
566
+ "./releases/github-downloads": {
567
+ "types": "./dist/releases/github-downloads.d.ts",
568
+ "default": "./dist/releases/github-downloads.js"
569
+ },
570
+ "./releases/github-types": {
571
+ "types": "./dist/releases/github-types.d.ts",
572
+ "default": "./dist/releases/github-types.js"
545
573
  },
546
574
  "./releases/socket-btm": {
547
575
  "types": "./dist/releases/socket-btm.d.ts",
@@ -639,10 +667,6 @@
639
667
  "types": "./dist/temporary-executor.d.ts",
640
668
  "default": "./dist/temporary-executor.js"
641
669
  },
642
- "./themes": {
643
- "types": "./dist/themes/index.d.ts",
644
- "default": "./dist/themes/index.js"
645
- },
646
670
  "./themes/context": {
647
671
  "types": "./dist/themes/context.d.ts",
648
672
  "default": "./dist/themes/context.js"
@@ -725,9 +749,9 @@
725
749
  "@npmcli/promise-spawn": "8.0.3",
726
750
  "@sinclair/typebox": "0.34.49",
727
751
  "@socketregistry/is-unicode-supported": "1.0.5",
728
- "@socketregistry/packageurl-js": "1.4.2",
752
+ "@socketregistry/packageurl-js": "catalog:",
729
753
  "@socketregistry/yocto-spinner": "1.0.25",
730
- "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.25.0",
754
+ "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@5.25.1",
731
755
  "@types/node": "24.9.2",
732
756
  "@typescript/native-preview": "7.0.0-dev.20260415.1",
733
757
  "@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;
@@ -1,192 +0,0 @@
1
- "use strict";
2
- /* Socket Lib - Built with esbuild */
3
- "use strict";
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var text_shimmer_exports = {};
22
- __export(text_shimmer_exports, {
23
- COLOR_INHERIT: () => COLOR_INHERIT,
24
- DIR_LTR: () => DIR_LTR,
25
- DIR_NONE: () => DIR_NONE,
26
- DIR_RANDOM: () => DIR_RANDOM,
27
- DIR_RTL: () => DIR_RTL,
28
- MODE_BI: () => MODE_BI,
29
- applyShimmer: () => applyShimmer
30
- });
31
- module.exports = __toCommonJS(text_shimmer_exports);
32
- var import_ansi = require("../ansi");
33
- var import_arrays = require("../arrays");
34
- var import_ci = require("../env/ci");
35
- var import_themes = require("../themes/themes");
36
- var import_utils = require("../themes/utils");
37
- const COLOR_INHERIT = "inherit";
38
- const DIR_LTR = "ltr";
39
- const DIR_NONE = "none";
40
- const DIR_RANDOM = "random";
41
- const DIR_RTL = "rtl";
42
- const MODE_BI = "bi";
43
- function blendColors(color1, color2, factor) {
44
- const r = Math.round(color1[0] + (color2[0] - color1[0]) * factor);
45
- const g = Math.round(color1[1] + (color2[1] - color1[1]) * factor);
46
- const b = Math.round(color1[2] + (color2[2] - color1[2]) * factor);
47
- return [r, g, b];
48
- }
49
- function detectStyles(text) {
50
- return {
51
- __proto__: null,
52
- // biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequence detection.
53
- bold: /\x1b\[1m/.test(text),
54
- // biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequence detection.
55
- dim: /\x1b\[2m/.test(text),
56
- // biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequence detection.
57
- italic: /\x1b\[3m/.test(text),
58
- // biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequence detection.
59
- strikethrough: /\x1b\[9m/.test(text),
60
- // biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequence detection.
61
- underline: /\x1b\[4m/.test(text)
62
- };
63
- }
64
- function getShimmerPos(textLength, step, currentDir, shimmerWidth = 2.5) {
65
- const totalSteps = textLength + shimmerWidth + 2;
66
- if (currentDir === DIR_RTL) {
67
- return textLength - step % totalSteps;
68
- }
69
- return step % totalSteps;
70
- }
71
- function pickDirection(direction) {
72
- if (direction === DIR_RANDOM) {
73
- return Math.random() < 0.5 ? DIR_LTR : DIR_RTL;
74
- }
75
- if (direction === DIR_RTL) {
76
- return DIR_RTL;
77
- }
78
- return DIR_LTR;
79
- }
80
- function renderChar(char, index, shimmerPos, baseColor, styles) {
81
- const distance = Math.abs(index - shimmerPos);
82
- const intensity = shimmerIntensity(distance);
83
- const styleCode = stylesToAnsi(styles);
84
- const charColor = (0, import_arrays.isArray)(baseColor[0]) ? baseColor[index % baseColor.length] ?? [
85
- 140,
86
- 82,
87
- 255
88
- ] : baseColor;
89
- if (intensity === 0) {
90
- const base = `\x1B[38;2;${charColor[0]};${charColor[1]};${charColor[2]}m`;
91
- return `${styleCode}${base}${char}${import_ansi.ANSI_RESET}`;
92
- }
93
- const white = [255, 255, 255];
94
- const blended = blendColors(charColor, white, intensity);
95
- const color = `\x1B[38;2;${blended[0]};${blended[1]};${blended[2]}m`;
96
- return `${styleCode}${color}${char}${import_ansi.ANSI_RESET}`;
97
- }
98
- function shimmerIntensity(distance, shimmerWidth = 2.5) {
99
- if (distance > shimmerWidth) {
100
- return 0;
101
- }
102
- const normalized = distance / shimmerWidth;
103
- return (1 - normalized) ** 2.5;
104
- }
105
- function stylesToAnsi(styles) {
106
- let codes = "";
107
- if (styles.bold) {
108
- codes += "\x1B[1m";
109
- }
110
- if (styles.dim) {
111
- codes += "\x1B[2m";
112
- }
113
- if (styles.italic) {
114
- codes += "\x1B[3m";
115
- }
116
- if (styles.underline) {
117
- codes += "\x1B[4m";
118
- }
119
- if (styles.strikethrough) {
120
- codes += "\x1B[9m";
121
- }
122
- return codes;
123
- }
124
- function applyShimmer(text, state, options) {
125
- const opts = { __proto__: null, ...options };
126
- const direction = opts.direction ?? DIR_NONE;
127
- const shimmerWidth = opts.shimmerWidth ?? 2.5;
128
- let color;
129
- if (opts.theme) {
130
- const theme = typeof opts.theme === "string" ? import_themes.THEMES[opts.theme] : opts.theme;
131
- if (!theme) {
132
- throw new Error(`Unknown theme: ${opts.theme}`);
133
- }
134
- const themeColor = (0, import_utils.resolveColor)(
135
- theme.colors.primary,
136
- theme.colors
137
- );
138
- color = typeof themeColor === "string" ? [140, 82, 255] : themeColor;
139
- } else {
140
- color = opts.color ?? [140, 82, 255];
141
- }
142
- const styles = opts.styles ?? detectStyles(text);
143
- const plainText = (0, import_ansi.stripAnsi)(text);
144
- if ((0, import_ci.getCI)() || !plainText || direction === DIR_NONE) {
145
- const styleCode = stylesToAnsi(styles);
146
- const isGradient = (0, import_arrays.isArray)(color[0]);
147
- return plainText.split("").map((char, i) => {
148
- const charColor = isGradient ? color[i % color.length] ?? [
149
- 140,
150
- 82,
151
- 255
152
- ] : color;
153
- const base = `\x1B[38;2;${charColor[0]};${charColor[1]};${charColor[2]}m`;
154
- return `${styleCode}${base}${char}${import_ansi.ANSI_RESET}`;
155
- }).join("");
156
- }
157
- const shimmerPos = getShimmerPos(
158
- plainText.length,
159
- state.step,
160
- state.currentDir,
161
- shimmerWidth
162
- );
163
- const result = plainText.split("").map((char, i) => renderChar(char, i, shimmerPos, color, styles)).join("");
164
- state.step += state.speed;
165
- const totalSteps = plainText.length + shimmerWidth + 2;
166
- if (state.mode === MODE_BI) {
167
- if (state.step >= totalSteps) {
168
- state.step = 0;
169
- state.currentDir = state.currentDir === DIR_LTR ? DIR_RTL : DIR_LTR;
170
- }
171
- } else if (state.mode === DIR_RANDOM) {
172
- if (state.step >= totalSteps) {
173
- state.step = 0;
174
- state.currentDir = pickDirection(DIR_RANDOM);
175
- }
176
- } else {
177
- if (state.step >= totalSteps) {
178
- state.step = 0;
179
- }
180
- }
181
- return result;
182
- }
183
- // Annotate the CommonJS export names for ESM import in node:
184
- 0 && (module.exports = {
185
- COLOR_INHERIT,
186
- DIR_LTR,
187
- DIR_NONE,
188
- DIR_RANDOM,
189
- DIR_RTL,
190
- MODE_BI,
191
- applyShimmer
192
- });
@@ -1,47 +0,0 @@
1
- /**
2
- * @fileoverview Shared types for effects (shimmer, pulse, ultra, etc.).
3
- * Common type definitions used across multiple effect modules.
4
- */
5
- export type ShimmerColorInherit = 'inherit';
6
- export type ShimmerColorRgb = readonly [number, number, number];
7
- export type ShimmerColor = ShimmerColorInherit | ShimmerColorRgb;
8
- export type ShimmerColorGradient = readonly ShimmerColorRgb[];
9
- export type ShimmerDirection = 'ltr' | 'rtl' | 'bi' | 'random' | 'none';
10
- /**
11
- * Shimmer animation configuration.
12
- */
13
- export type ShimmerConfig = {
14
- readonly color?: ShimmerColor | ShimmerColorGradient | undefined;
15
- readonly dir?: ShimmerDirection | undefined;
16
- /**
17
- * Animation speed in steps per frame.
18
- * Lower values = slower shimmer (e.g., 0.33 = ~150ms per step).
19
- * Higher values = faster shimmer (e.g., 1.0 = 50ms per step).
20
- * Default: 1/3 (~0.33).
21
- */
22
- readonly speed?: number | undefined;
23
- /**
24
- * Theme to use for shimmer colors.
25
- * Can be a theme name ('socket', 'sunset', etc.) or a Theme object.
26
- * If provided, overrides the color option.
27
- */
28
- readonly theme?: import('../themes/types').Theme | import('../themes/themes').ThemeName | undefined;
29
- };
30
- /**
31
- * Internal shimmer animation state.
32
- * Tracks current animation position and direction.
33
- */
34
- export type ShimmerState = {
35
- currentDir: 'ltr' | 'rtl';
36
- mode: ShimmerDirection;
37
- /**
38
- * Animation speed in steps per frame.
39
- * The shimmer position advances by this amount every frame.
40
- */
41
- speed: number;
42
- /**
43
- * Current shimmer position.
44
- * Can be fractional for smooth sub-character movement.
45
- */
46
- step: number;
47
- };