@socketsecurity/lib 6.0.0 → 6.0.2

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 (135) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/README.md +26 -17
  3. package/dist/ai/discover.js +2 -2
  4. package/dist/ai/spawn.js +3 -3
  5. package/dist/ai/worktree.js +3 -3
  6. package/dist/argv/parse-args-string.d.ts +30 -0
  7. package/dist/argv/parse-args-string.js +42 -0
  8. package/dist/bin/check-primordials.js +15 -10
  9. package/dist/bin/check.js +2 -2
  10. package/dist/bin/exec.d.ts +1 -1
  11. package/dist/bin/exec.js +2 -2
  12. package/dist/bin/socket-lib.js +2 -2
  13. package/dist/{ttl-cache/cache.js → cache/ttl/store.js} +15 -15
  14. package/dist/{ttl-cache → cache/ttl}/types.d.ts +1 -1
  15. package/dist/checks/primordials-defaults.d.ts +20 -0
  16. package/dist/checks/primordials-defaults.js +92 -0
  17. package/dist/colors/socket-palette.d.ts +69 -0
  18. package/dist/colors/socket-palette.js +91 -0
  19. package/dist/constants/socket.js +1 -1
  20. package/dist/cover/code.js +2 -2
  21. package/dist/cover/type.js +2 -2
  22. package/dist/debug/_internal.d.ts +1 -1
  23. package/dist/debug/_internal.js +2 -2
  24. package/dist/debug/output.js +5 -5
  25. package/dist/dlx/binary-types.d.ts +2 -2
  26. package/dist/dlx/binary.d.ts +2 -2
  27. package/dist/dlx/binary.js +3 -3
  28. package/dist/dlx/firewall.js +2 -2
  29. package/dist/dlx/manifest.js +2 -2
  30. package/dist/dlx/package.d.ts +2 -2
  31. package/dist/dlx/package.js +2 -2
  32. package/dist/dlx/types.d.ts +2 -2
  33. package/dist/eco/npm/npm/exec.d.ts +2 -2
  34. package/dist/eco/npm/npm/exec.js +2 -2
  35. package/dist/eco/npm/pnpm/exec.d.ts +1 -1
  36. package/dist/eco/npm/script.d.ts +1 -1
  37. package/dist/eco/npm/script.js +3 -3
  38. package/dist/eco/npm/yarnpkg/yarn/exec.d.ts +1 -1
  39. package/dist/{signal-exit → events/exit}/_internal.d.ts +1 -1
  40. package/dist/{signal-exit/register.js → events/exit/handler.js} +4 -4
  41. package/dist/{signal-exit → events/exit}/intercept.js +2 -2
  42. package/dist/{signal-exit → events/exit}/types.d.ts +1 -1
  43. package/dist/{warnings/event-target.d.ts → events/warning/handler.d.ts} +1 -1
  44. package/dist/{warnings/event-target.js → events/warning/handler.js} +4 -4
  45. package/dist/{warnings → events/warning}/suppress.d.ts +3 -3
  46. package/dist/{warnings → events/warning}/suppress.js +2 -2
  47. package/dist/external-tools/janus/asset-names.d.ts +7 -0
  48. package/dist/external-tools/janus/asset-names.js +5 -0
  49. package/dist/external-tools/janus/from-download.d.ts +1 -1
  50. package/dist/external-tools/janus/from-download.js +12 -4
  51. package/dist/fs/read-json-cache.d.ts +83 -0
  52. package/dist/fs/read-json-cache.js +156 -0
  53. package/dist/fs/read-json.d.ts +6 -1
  54. package/dist/fs/read-json.js +80 -8
  55. package/dist/fs/types.d.ts +14 -0
  56. package/dist/git/_internal.js +3 -3
  57. package/dist/github/refs-cache.d.ts +1 -1
  58. package/dist/github/refs-cache.js +2 -2
  59. package/dist/github/token.d.ts +1 -1
  60. package/dist/github/token.js +2 -2
  61. package/dist/globs/{glob.js → match.js} +3 -3
  62. package/dist/http-request/browser-fetch.d.ts +10 -0
  63. package/dist/http-request/browser-fetch.js +32 -0
  64. package/dist/http-request/browser.d.ts +190 -0
  65. package/dist/http-request/browser.js +224 -0
  66. package/dist/http-request/download-types.d.ts +2 -2
  67. package/dist/http-request/http-request.d.ts +12 -0
  68. package/dist/http-request/http-request.js +36 -0
  69. package/dist/http-request/node.d.ts +29 -0
  70. package/dist/http-request/{convenience.js → node.js} +9 -3
  71. package/dist/http-request/request-attempt.js +4 -0
  72. package/dist/http-request/request-types.d.ts +15 -0
  73. package/dist/http-request/request.js +5 -0
  74. package/dist/links/{link.d.ts → create.d.ts} +2 -2
  75. package/dist/links/{link.js → create.js} +3 -3
  76. package/dist/logger/_internal.d.ts +1 -1
  77. package/dist/logger/browser.d.ts +18 -0
  78. package/dist/logger/browser.js +58 -0
  79. package/dist/logger/console.js +3 -3
  80. package/dist/logger/default.d.ts +11 -0
  81. package/dist/logger/default.js +37 -0
  82. package/dist/logger/logger.d.ts +8 -403
  83. package/dist/logger/logger.js +3 -827
  84. package/dist/logger/node.d.ts +400 -0
  85. package/dist/logger/node.js +856 -0
  86. package/dist/logger/symbols-builder.d.ts +1 -1
  87. package/dist/logger/types.d.ts +1 -1
  88. package/dist/packages/isolation.js +3 -3
  89. package/dist/packages/provenance.d.ts +42 -0
  90. package/dist/packages/provenance.js +71 -0
  91. package/dist/packages/types.d.ts +2 -0
  92. package/dist/primordials/globals.d.ts +6 -3
  93. package/dist/primordials/globals.js +15 -9
  94. package/dist/primordials/map-set.d.ts +35 -0
  95. package/dist/primordials/map-set.js +43 -0
  96. package/dist/primordials/url.d.ts +1 -1
  97. package/dist/process/lock-manager.js +4 -4
  98. package/dist/{spawn → process/spawn}/_internal.js +3 -3
  99. package/dist/{spawn/spawn.js → process/spawn/child.js} +13 -13
  100. package/dist/{spawn → process/spawn}/errors.js +5 -5
  101. package/dist/{spawn → process/spawn}/stdio.js +1 -1
  102. package/dist/{spawn → process/spawn}/types.d.ts +3 -3
  103. package/dist/promises/types.d.ts +15 -2
  104. package/dist/releases/github-archives.js +2 -2
  105. package/dist/releases/github-downloads.js +4 -4
  106. package/dist/spinner/{registry.d.ts → default.d.ts} +1 -1
  107. package/dist/spinner/{registry.js → default.js} +3 -3
  108. package/dist/spinner/spinner.js +4 -4
  109. package/dist/spinner/with.d.ts +1 -1
  110. package/dist/stdio/divider.js +2 -2
  111. package/dist/stdio/footer.js +2 -2
  112. package/dist/stdio/header.js +2 -2
  113. package/dist/stdio/prompts.js +2 -2
  114. package/package.json +410 -132
  115. package/dist/http-request/convenience.d.ts +0 -104
  116. package/dist/promise-queue/types.d.ts +0 -10
  117. package/dist/ttl-cache/types.js +0 -18
  118. /package/dist/{ttl-cache/cache.d.ts → cache/ttl/store.d.ts} +0 -0
  119. /package/dist/{promise-queue → cache/ttl}/types.js +0 -0
  120. /package/dist/{signal-exit → events/exit}/_internal.js +0 -0
  121. /package/dist/{signal-exit/register.d.ts → events/exit/handler.d.ts} +0 -0
  122. /package/dist/{signal-exit → events/exit}/intercept.d.ts +0 -0
  123. /package/dist/{signal-exit → events/exit}/lifecycle.d.ts +0 -0
  124. /package/dist/{signal-exit → events/exit}/lifecycle.js +0 -0
  125. /package/dist/{signal-exit → events/exit}/signals.d.ts +0 -0
  126. /package/dist/{signal-exit → events/exit}/signals.js +0 -0
  127. /package/dist/{signal-exit → events/exit}/types.js +0 -0
  128. /package/dist/globs/{glob.d.ts → match.d.ts} +0 -0
  129. /package/dist/{spawn → process/spawn}/_internal.d.ts +0 -0
  130. /package/dist/{spawn/spawn.d.ts → process/spawn/child.d.ts} +0 -0
  131. /package/dist/{spawn → process/spawn}/errors.d.ts +0 -0
  132. /package/dist/{spawn → process/spawn}/stdio.d.ts +0 -0
  133. /package/dist/{spawn → process/spawn}/types.js +0 -0
  134. /package/dist/{promise-queue → promises}/queue.d.ts +0 -0
  135. /package/dist/{promise-queue → promises}/queue.js +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @file Free-function helpers for per-instance log-symbol construction + symbol
3
- * stripping. Extracted from `logger/logger.ts` (the `Logger` class) so the
3
+ * stripping. Extracted from `logger/node.ts` (the `Logger` class) so the
4
4
  * class stays under the 1000-line hard cap and so other callers (alt loggers,
5
5
  * format helpers) can reuse the same logic without instantiating a `Logger`.
6
6
  *
@@ -4,7 +4,7 @@
4
4
  * interface returned by `Logger.createTask`. Pure types; no runtime side
5
5
  * effects so this module stays cheap to import everywhere.
6
6
  */
7
- import type { Logger } from './logger';
7
+ import type { Logger } from './node';
8
8
  /**
9
9
  * Log symbols for terminal output with colored indicators.
10
10
  *
@@ -40,7 +40,7 @@ var import_platform = require("../constants/platform");
40
40
  var import_message = require("../errors/message");
41
41
  var import_normalize = require("../paths/normalize");
42
42
  var import_socket = require("../paths/socket");
43
- var import_spawn = require("../spawn/spawn");
43
+ var import_child = require("../process/spawn/child");
44
44
  var import_operations = require("./operations");
45
45
  var import_error = require("../primordials/error");
46
46
  var import_json = require("../primordials/json");
@@ -123,7 +123,7 @@ async function isolatePackage(packageSpec, options) {
123
123
  await install(packageTempDir);
124
124
  } else {
125
125
  const packageInstallSpec = (0, import_string.StringPrototypeStartsWith)(spec, "https://") ? spec : `${packageName}@${spec}`;
126
- await (0, import_spawn.spawn)("pnpm", ["add", packageInstallSpec], {
126
+ await (0, import_child.spawn)("pnpm", ["add", packageInstallSpec], {
127
127
  cwd: packageTempDir,
128
128
  shell: import_platform.WIN32,
129
129
  stdio: "pipe"
@@ -170,7 +170,7 @@ async function isolatePackage(packageSpec, options) {
170
170
  if (install) {
171
171
  await install(installedPath);
172
172
  } else {
173
- await (0, import_spawn.spawn)("pnpm", ["install"], {
173
+ await (0, import_child.spawn)("pnpm", ["install"], {
174
174
  cwd: installedPath,
175
175
  shell: import_platform.WIN32,
176
176
  stdio: "pipe"
@@ -2,6 +2,18 @@
2
2
  * @file Package provenance and attestation verification utilities.
3
3
  */
4
4
  import type { ProvenanceOptions } from './types';
5
+ /**
6
+ * Comparator ordering two trust statuses by ascending trust level. Sorts an
7
+ * array of statuses lowest-trust-first; negate for highest-first.
8
+ */
9
+ export declare function compareTrust(a: TrustStatus, b: TrustStatus): -1 | 0 | 1;
10
+ /**
11
+ * Whether `next` sits at a lower trust level than `prev` — i.e. a release
12
+ * regressed its supply-chain posture. Drives the post-publish provenance
13
+ * reminder: a version that drops from trustedPublisher back to bare provenance
14
+ * is a red flag worth surfacing.
15
+ */
16
+ export declare function didTrustDecrease(prev: TrustStatus, next: TrustStatus): boolean;
5
17
  /**
6
18
  * Fetch package provenance information from npm registry.
7
19
  *
@@ -30,7 +42,37 @@ export declare function getFetcher(): import("../external/make-fetch-happen").Ma
30
42
  * ```
31
43
  */
32
44
  export declare function getProvenanceDetails(attestationData: unknown): unknown;
45
+ /**
46
+ * Map a trust status to its 0..3 ladder level.
47
+ */
48
+ export declare function getTrustLevel(status: TrustStatus): TrustLevel;
49
+ /**
50
+ * Map a trust status to its human-readable level name.
51
+ */
52
+ export declare function getTrustLevelName(status: TrustStatus): TrustLevelName;
53
+ /**
54
+ * Extract provenance / trusted-publisher / staged-publish flags from a registry
55
+ * version document.
56
+ */
57
+ export declare function getTrustStatus(meta: unknown): TrustStatus;
33
58
  /**
34
59
  * Check if a value indicates a trusted publisher (GitHub or GitLab).
35
60
  */
36
61
  export declare function isTrustedPublisher(value: unknown): boolean;
62
+ /**
63
+ * Trust signals derived from a registry version document.
64
+ */
65
+ export interface TrustStatus {
66
+ provenance: boolean;
67
+ trustedPublisher: boolean;
68
+ stagedPublish: boolean;
69
+ }
70
+ /**
71
+ * Trust ladder, low → high. The index IS the level (0..3), so a single array
72
+ * maps both directions: `TRUST_LEVELS[level]` → name, and
73
+ * `TRUST_LEVELS.indexOf(name)` → level. One source of truth, no parallel Record
74
+ * to keep in sync.
75
+ */
76
+ export declare const TRUST_LEVELS: readonly ['none', 'provenance', 'trustedPublisher', 'stagedPublish'];
77
+ export type TrustLevel = 0 | 1 | 2 | 3;
78
+ export type TrustLevelName = (typeof TRUST_LEVELS)[number];
@@ -30,11 +30,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
  var provenance_exports = {};
32
32
  __export(provenance_exports, {
33
+ TRUST_LEVELS: () => TRUST_LEVELS,
34
+ compareTrust: () => compareTrust,
35
+ didTrustDecrease: () => didTrustDecrease,
33
36
  fetchPackageProvenance: () => fetchPackageProvenance,
34
37
  findProvenance: () => findProvenance,
35
38
  getAttestations: () => getAttestations,
36
39
  getFetcher: () => getFetcher,
37
40
  getProvenanceDetails: () => getProvenanceDetails,
41
+ getTrustLevel: () => getTrustLevel,
42
+ getTrustLevelName: () => getTrustLevelName,
43
+ getTrustStatus: () => getTrustStatus,
38
44
  isTrustedPublisher: () => isTrustedPublisher
39
45
  });
40
46
  module.exports = __toCommonJS(provenance_exports);
@@ -43,13 +49,29 @@ var import_packages = require("../constants/packages");
43
49
  var import_make_fetch_happen = __toESM(require("../external/make-fetch-happen"));
44
50
  var import_signal = require("../abort/signal");
45
51
  var import_parse = require("../url/parse");
52
+ var import_predicates = require("../objects/predicates");
46
53
  var import_array = require("../primordials/array");
47
54
  var import_buffer = require("../primordials/buffer");
48
55
  var import_json = require("../primordials/json");
56
+ var import_object = require("../primordials/object");
49
57
  var import_string = require("../primordials/string");
50
58
  const SLSA_PROVENANCE_V0_2 = "https://slsa.dev/provenance/v0.2";
51
59
  const SLSA_PROVENANCE_V1_0 = "https://slsa.dev/provenance/v1";
52
60
  let _fetcher;
61
+ function compareTrust(a, b) {
62
+ const levelA = getTrustLevel(a);
63
+ const levelB = getTrustLevel(b);
64
+ if (levelA < levelB) {
65
+ return -1;
66
+ }
67
+ if (levelA > levelB) {
68
+ return 1;
69
+ }
70
+ return 0;
71
+ }
72
+ function didTrustDecrease(prev, next) {
73
+ return getTrustLevel(next) < getTrustLevel(prev);
74
+ }
53
75
  // @__NO_SIDE_EFFECTS__
54
76
  async function fetchPackageProvenance(pkgName, pkgVersion, options) {
55
77
  const { signal, timeout = 1e4 } = {
@@ -165,6 +187,43 @@ function getProvenanceDetails(attestationData) {
165
187
  workflowRunId
166
188
  };
167
189
  }
190
+ function getTrustLevel(status) {
191
+ if (status.stagedPublish) {
192
+ return 3;
193
+ }
194
+ if (status.trustedPublisher && status.provenance) {
195
+ return 2;
196
+ }
197
+ if (status.provenance) {
198
+ return 1;
199
+ }
200
+ return 0;
201
+ }
202
+ function getTrustLevelName(status) {
203
+ return TRUST_LEVELS[getTrustLevel(status)];
204
+ }
205
+ function getTrustStatus(meta) {
206
+ const status = {
207
+ provenance: false,
208
+ trustedPublisher: false,
209
+ // Reserved: the npm registry does not yet expose a staged-publish flag, so
210
+ // this stays false until a registry signal exists to set it.
211
+ stagedPublish: false
212
+ };
213
+ if (!(0, import_predicates.isObject)(meta)) {
214
+ return status;
215
+ }
216
+ const npmUser = (0, import_object.ObjectHasOwn)(meta, "_npmUser") ? meta["_npmUser"] : void 0;
217
+ if ((0, import_predicates.isObject)(npmUser) && (0, import_object.ObjectHasOwn)(npmUser, "trustedPublisher") && npmUser["trustedPublisher"]) {
218
+ status.trustedPublisher = true;
219
+ }
220
+ const dist = (0, import_object.ObjectHasOwn)(meta, "dist") ? meta["dist"] : void 0;
221
+ const attestations = (0, import_predicates.isObject)(dist) && (0, import_object.ObjectHasOwn)(dist, "attestations") ? dist["attestations"] : void 0;
222
+ if ((0, import_predicates.isObject)(attestations) && (0, import_object.ObjectHasOwn)(attestations, "provenance") && attestations["provenance"]) {
223
+ status.provenance = true;
224
+ }
225
+ return status;
226
+ }
168
227
  function isTrustedPublisher(value) {
169
228
  if (typeof value !== "string" || !value) {
170
229
  return false;
@@ -191,12 +250,24 @@ function isTrustedPublisher(value) {
191
250
  }
192
251
  return (0, import_string.StringPrototypeIncludes)(value, "github") || (0, import_string.StringPrototypeIncludes)(value, "gitlab");
193
252
  }
253
+ const TRUST_LEVELS = [
254
+ "none",
255
+ "provenance",
256
+ "trustedPublisher",
257
+ "stagedPublish"
258
+ ];
194
259
  // Annotate the CommonJS export names for ESM import in node:
195
260
  0 && (module.exports = {
261
+ TRUST_LEVELS,
262
+ compareTrust,
263
+ didTrustDecrease,
196
264
  fetchPackageProvenance,
197
265
  findProvenance,
198
266
  getAttestations,
199
267
  getFetcher,
200
268
  getProvenanceDetails,
269
+ getTrustLevel,
270
+ getTrustLevelName,
271
+ getTrustStatus,
201
272
  isTrustedPublisher
202
273
  });
@@ -73,6 +73,8 @@ export type PackageJson = {
73
73
  private?: boolean | undefined;
74
74
  publishConfig?: Record<string, unknown> | undefined;
75
75
  files?: string[] | undefined;
76
+ keywords?: string[] | undefined;
77
+ sideEffects?: boolean | string[] | undefined;
76
78
  engines?: Record<string, string> | undefined;
77
79
  os?: string[] | undefined;
78
80
  cpu?: string[] | undefined;
@@ -12,6 +12,9 @@ export declare const ProxyCtor: ProxyConstructor;
12
12
  export declare const SharedArrayBufferCtor: SharedArrayBufferConstructor;
13
13
  export declare const InfinityValue: number;
14
14
  export declare const NaNValue: number;
15
- export declare const globalThisRef: typeof globalThis;
16
- export declare const decodeComponent: typeof decodeURIComponent;
17
- export declare const encodeComponent: typeof encodeURIComponent;
15
+ declare const capturedGlobalThis: typeof globalThis;
16
+ export { capturedGlobalThis as globalThis };
17
+ export declare const atob: typeof globalThis.atob;
18
+ export declare const btoa: typeof globalThis.btoa;
19
+ export declare const decodeURIComponent: typeof globalThis.decodeURIComponent;
20
+ export declare const encodeURIComponent: typeof globalThis.encodeURIComponent;
@@ -26,9 +26,11 @@ __export(globals_exports, {
26
26
  NaNValue: () => NaNValue,
27
27
  ProxyCtor: () => ProxyCtor,
28
28
  SharedArrayBufferCtor: () => SharedArrayBufferCtor,
29
- decodeComponent: () => decodeComponent,
30
- encodeComponent: () => encodeComponent,
31
- globalThisRef: () => globalThisRef
29
+ atob: () => atob,
30
+ btoa: () => btoa,
31
+ decodeURIComponent: () => decodeURIComponent,
32
+ encodeURIComponent: () => encodeURIComponent,
33
+ globalThis: () => capturedGlobalThis
32
34
  });
33
35
  module.exports = __toCommonJS(globals_exports);
34
36
  const BigIntCtor = BigInt;
@@ -37,9 +39,11 @@ const ProxyCtor = Proxy;
37
39
  const SharedArrayBufferCtor = SharedArrayBuffer;
38
40
  const InfinityValue = Infinity;
39
41
  const NaNValue = NaN;
40
- const globalThisRef = globalThis;
41
- const decodeComponent = globalThis.decodeURIComponent;
42
- const encodeComponent = globalThis.encodeURIComponent;
42
+ const capturedGlobalThis = globalThis;
43
+ const atob = globalThis.atob;
44
+ const btoa = globalThis.btoa;
45
+ const decodeURIComponent = globalThis.decodeURIComponent;
46
+ const encodeURIComponent = globalThis.encodeURIComponent;
43
47
  // Annotate the CommonJS export names for ESM import in node:
44
48
  0 && (module.exports = {
45
49
  BigIntCtor,
@@ -48,7 +52,9 @@ const encodeComponent = globalThis.encodeURIComponent;
48
52
  NaNValue,
49
53
  ProxyCtor,
50
54
  SharedArrayBufferCtor,
51
- decodeComponent,
52
- encodeComponent,
53
- globalThisRef
55
+ atob,
56
+ btoa,
57
+ decodeURIComponent,
58
+ encodeURIComponent,
59
+ globalThis
54
60
  });
@@ -4,6 +4,30 @@
4
4
  * constructor — there's a separate `weakRefSafe` wrapper in `./uncurry` for
5
5
  * the throws-on-non-Object case.
6
6
  */
7
+ declare global {
8
+ interface Map<K, V> {
9
+ getOrInsert(key: K, value: V): V;
10
+ getOrInsertComputed(key: K, callbackfn: (key: K) => V): V;
11
+ }
12
+ interface WeakMap<K extends WeakKey, V> {
13
+ getOrInsert(key: K, value: V): V;
14
+ getOrInsertComputed(key: K, callbackfn: (key: K) => V): V;
15
+ }
16
+ interface ReadonlySetLike<T> {
17
+ has(value: T): boolean;
18
+ keys(): IterableIterator<T>;
19
+ readonly size: number;
20
+ }
21
+ interface Set<T> {
22
+ difference<U>(other: ReadonlySetLike<U>): Set<T>;
23
+ intersection<U>(other: ReadonlySetLike<U>): Set<T & U>;
24
+ isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
25
+ isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
26
+ isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
27
+ symmetricDifference<U>(other: ReadonlySetLike<U>): Set<T | U>;
28
+ union<U>(other: ReadonlySetLike<U>): Set<T | U>;
29
+ }
30
+ }
7
31
  export declare const MapCtor: MapConstructor;
8
32
  export declare const SetCtor: SetConstructor;
9
33
  export declare const WeakMapCtor: WeakMapConstructor;
@@ -14,6 +38,8 @@ export declare const MapPrototypeDelete: (self: unknown, key: any) => boolean;
14
38
  export declare const MapPrototypeEntries: (self: unknown) => MapIterator<[any, any]>;
15
39
  export declare const MapPrototypeForEach: (self: unknown, callbackfn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any) => void;
16
40
  export declare const MapPrototypeGet: (self: unknown, key: any) => any;
41
+ export declare const MapPrototypeGetOrInsert: (self: unknown, key: any, value: any) => any;
42
+ export declare const MapPrototypeGetOrInsertComputed: (self: unknown, key: any, callbackfn: (key: any) => any) => any;
17
43
  export declare const MapPrototypeHas: (self: unknown, key: any) => boolean;
18
44
  export declare const MapPrototypeKeys: (self: unknown) => MapIterator<any>;
19
45
  export declare const MapPrototypeSet: (self: unknown, key: any, value: any) => Map<any, any>;
@@ -21,13 +47,22 @@ export declare const MapPrototypeValues: (self: unknown) => MapIterator<any>;
21
47
  export declare const SetPrototypeAdd: (self: unknown, value: any) => Set<any>;
22
48
  export declare const SetPrototypeClear: (self: unknown) => void;
23
49
  export declare const SetPrototypeDelete: (self: unknown, value: any) => boolean;
50
+ export declare const SetPrototypeDifference: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
24
51
  export declare const SetPrototypeEntries: (self: unknown) => SetIterator<[any, any]>;
25
52
  export declare const SetPrototypeForEach: (self: unknown, callbackfn: (value: any, value2: any, set: Set<any>) => void, thisArg?: any) => void;
26
53
  export declare const SetPrototypeHas: (self: unknown, value: any) => boolean;
54
+ export declare const SetPrototypeIntersection: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
55
+ export declare const SetPrototypeIsDisjointFrom: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
56
+ export declare const SetPrototypeIsSubsetOf: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
57
+ export declare const SetPrototypeIsSupersetOf: (self: unknown, other: ReadonlySetLike<unknown>) => boolean;
27
58
  export declare const SetPrototypeKeys: (self: unknown) => SetIterator<any>;
59
+ export declare const SetPrototypeSymmetricDifference: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
60
+ export declare const SetPrototypeUnion: <U>(self: unknown, other: ReadonlySetLike<U>) => Set<any>;
28
61
  export declare const SetPrototypeValues: (self: unknown) => SetIterator<any>;
29
62
  export declare const WeakMapPrototypeDelete: (self: unknown, key: WeakKey) => boolean;
30
63
  export declare const WeakMapPrototypeGet: (self: unknown, key: WeakKey) => any;
64
+ export declare const WeakMapPrototypeGetOrInsert: (self: unknown, key: WeakKey, value: any) => any;
65
+ export declare const WeakMapPrototypeGetOrInsertComputed: (self: unknown, key: WeakKey, callbackfn: (key: WeakKey) => any) => any;
31
66
  export declare const WeakMapPrototypeHas: (self: unknown, key: WeakKey) => boolean;
32
67
  export declare const WeakMapPrototypeSet: (self: unknown, key: WeakKey, value: any) => WeakMap<WeakKey, any>;
33
68
  export declare const WeakSetPrototypeAdd: (self: unknown, value: WeakKey) => WeakSet<WeakKey>;
@@ -26,6 +26,8 @@ __export(map_set_exports, {
26
26
  MapPrototypeEntries: () => MapPrototypeEntries,
27
27
  MapPrototypeForEach: () => MapPrototypeForEach,
28
28
  MapPrototypeGet: () => MapPrototypeGet,
29
+ MapPrototypeGetOrInsert: () => MapPrototypeGetOrInsert,
30
+ MapPrototypeGetOrInsertComputed: () => MapPrototypeGetOrInsertComputed,
29
31
  MapPrototypeHas: () => MapPrototypeHas,
30
32
  MapPrototypeKeys: () => MapPrototypeKeys,
31
33
  MapPrototypeSet: () => MapPrototypeSet,
@@ -34,14 +36,23 @@ __export(map_set_exports, {
34
36
  SetPrototypeAdd: () => SetPrototypeAdd,
35
37
  SetPrototypeClear: () => SetPrototypeClear,
36
38
  SetPrototypeDelete: () => SetPrototypeDelete,
39
+ SetPrototypeDifference: () => SetPrototypeDifference,
37
40
  SetPrototypeEntries: () => SetPrototypeEntries,
38
41
  SetPrototypeForEach: () => SetPrototypeForEach,
39
42
  SetPrototypeHas: () => SetPrototypeHas,
43
+ SetPrototypeIntersection: () => SetPrototypeIntersection,
44
+ SetPrototypeIsDisjointFrom: () => SetPrototypeIsDisjointFrom,
45
+ SetPrototypeIsSubsetOf: () => SetPrototypeIsSubsetOf,
46
+ SetPrototypeIsSupersetOf: () => SetPrototypeIsSupersetOf,
40
47
  SetPrototypeKeys: () => SetPrototypeKeys,
48
+ SetPrototypeSymmetricDifference: () => SetPrototypeSymmetricDifference,
49
+ SetPrototypeUnion: () => SetPrototypeUnion,
41
50
  SetPrototypeValues: () => SetPrototypeValues,
42
51
  WeakMapCtor: () => WeakMapCtor,
43
52
  WeakMapPrototypeDelete: () => WeakMapPrototypeDelete,
44
53
  WeakMapPrototypeGet: () => WeakMapPrototypeGet,
54
+ WeakMapPrototypeGetOrInsert: () => WeakMapPrototypeGetOrInsert,
55
+ WeakMapPrototypeGetOrInsertComputed: () => WeakMapPrototypeGetOrInsertComputed,
45
56
  WeakMapPrototypeHas: () => WeakMapPrototypeHas,
46
57
  WeakMapPrototypeSet: () => WeakMapPrototypeSet,
47
58
  WeakRefCtor: () => WeakRefCtor,
@@ -62,6 +73,10 @@ const MapPrototypeDelete = (0, import_uncurry.uncurryThis)(Map.prototype.delete)
62
73
  const MapPrototypeEntries = (0, import_uncurry.uncurryThis)(Map.prototype.entries);
63
74
  const MapPrototypeForEach = (0, import_uncurry.uncurryThis)(Map.prototype.forEach);
64
75
  const MapPrototypeGet = (0, import_uncurry.uncurryThis)(Map.prototype.get);
76
+ const MapPrototypeGetOrInsert = (0, import_uncurry.uncurryThis)(Map.prototype.getOrInsert);
77
+ const MapPrototypeGetOrInsertComputed = (0, import_uncurry.uncurryThis)(
78
+ Map.prototype.getOrInsertComputed
79
+ );
65
80
  const MapPrototypeHas = (0, import_uncurry.uncurryThis)(Map.prototype.has);
66
81
  const MapPrototypeKeys = (0, import_uncurry.uncurryThis)(Map.prototype.keys);
67
82
  const MapPrototypeSet = (0, import_uncurry.uncurryThis)(Map.prototype.set);
@@ -69,13 +84,30 @@ const MapPrototypeValues = (0, import_uncurry.uncurryThis)(Map.prototype.values)
69
84
  const SetPrototypeAdd = (0, import_uncurry.uncurryThis)(Set.prototype.add);
70
85
  const SetPrototypeClear = (0, import_uncurry.uncurryThis)(Set.prototype.clear);
71
86
  const SetPrototypeDelete = (0, import_uncurry.uncurryThis)(Set.prototype.delete);
87
+ const SetPrototypeDifference = (0, import_uncurry.uncurryThis)(Set.prototype.difference);
72
88
  const SetPrototypeEntries = (0, import_uncurry.uncurryThis)(Set.prototype.entries);
73
89
  const SetPrototypeForEach = (0, import_uncurry.uncurryThis)(Set.prototype.forEach);
74
90
  const SetPrototypeHas = (0, import_uncurry.uncurryThis)(Set.prototype.has);
91
+ const SetPrototypeIntersection = (0, import_uncurry.uncurryThis)(Set.prototype.intersection);
92
+ const SetPrototypeIsDisjointFrom = (0, import_uncurry.uncurryThis)(
93
+ Set.prototype.isDisjointFrom
94
+ );
95
+ const SetPrototypeIsSubsetOf = (0, import_uncurry.uncurryThis)(Set.prototype.isSubsetOf);
96
+ const SetPrototypeIsSupersetOf = (0, import_uncurry.uncurryThis)(Set.prototype.isSupersetOf);
75
97
  const SetPrototypeKeys = (0, import_uncurry.uncurryThis)(Set.prototype.keys);
98
+ const SetPrototypeSymmetricDifference = (0, import_uncurry.uncurryThis)(
99
+ Set.prototype.symmetricDifference
100
+ );
101
+ const SetPrototypeUnion = (0, import_uncurry.uncurryThis)(Set.prototype.union);
76
102
  const SetPrototypeValues = (0, import_uncurry.uncurryThis)(Set.prototype.values);
77
103
  const WeakMapPrototypeDelete = (0, import_uncurry.uncurryThis)(WeakMap.prototype.delete);
78
104
  const WeakMapPrototypeGet = (0, import_uncurry.uncurryThis)(WeakMap.prototype.get);
105
+ const WeakMapPrototypeGetOrInsert = (0, import_uncurry.uncurryThis)(
106
+ WeakMap.prototype.getOrInsert
107
+ );
108
+ const WeakMapPrototypeGetOrInsertComputed = (0, import_uncurry.uncurryThis)(
109
+ WeakMap.prototype.getOrInsertComputed
110
+ );
79
111
  const WeakMapPrototypeHas = (0, import_uncurry.uncurryThis)(WeakMap.prototype.has);
80
112
  const WeakMapPrototypeSet = (0, import_uncurry.uncurryThis)(WeakMap.prototype.set);
81
113
  const WeakSetPrototypeAdd = (0, import_uncurry.uncurryThis)(WeakSet.prototype.add);
@@ -89,6 +121,8 @@ const WeakSetPrototypeHas = (0, import_uncurry.uncurryThis)(WeakSet.prototype.ha
89
121
  MapPrototypeEntries,
90
122
  MapPrototypeForEach,
91
123
  MapPrototypeGet,
124
+ MapPrototypeGetOrInsert,
125
+ MapPrototypeGetOrInsertComputed,
92
126
  MapPrototypeHas,
93
127
  MapPrototypeKeys,
94
128
  MapPrototypeSet,
@@ -97,14 +131,23 @@ const WeakSetPrototypeHas = (0, import_uncurry.uncurryThis)(WeakSet.prototype.ha
97
131
  SetPrototypeAdd,
98
132
  SetPrototypeClear,
99
133
  SetPrototypeDelete,
134
+ SetPrototypeDifference,
100
135
  SetPrototypeEntries,
101
136
  SetPrototypeForEach,
102
137
  SetPrototypeHas,
138
+ SetPrototypeIntersection,
139
+ SetPrototypeIsDisjointFrom,
140
+ SetPrototypeIsSubsetOf,
141
+ SetPrototypeIsSupersetOf,
103
142
  SetPrototypeKeys,
143
+ SetPrototypeSymmetricDifference,
144
+ SetPrototypeUnion,
104
145
  SetPrototypeValues,
105
146
  WeakMapCtor,
106
147
  WeakMapPrototypeDelete,
107
148
  WeakMapPrototypeGet,
149
+ WeakMapPrototypeGetOrInsert,
150
+ WeakMapPrototypeGetOrInsertComputed,
108
151
  WeakMapPrototypeHas,
109
152
  WeakMapPrototypeSet,
110
153
  WeakRefCtor,
@@ -6,7 +6,7 @@ export declare const URLCtor: typeof URL;
6
6
  export declare const URLSearchParamsCtor: typeof URLSearchParams;
7
7
  export declare const URLSearchParamsPrototypeAppend: (self: unknown, name: string, value: string) => void;
8
8
  export declare const URLSearchParamsPrototypeDelete: (self: unknown, name: string, value?: string | undefined) => void;
9
- export declare const URLSearchParamsPrototypeForEach: <TThis = import("url").URLSearchParams>(self: unknown, fn: (this: TThis, value: string, name: string, searchParams: import("url").URLSearchParams) => void, thisArg?: TThis | undefined) => void;
9
+ export declare const URLSearchParamsPrototypeForEach: (self: unknown, callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
10
10
  export declare const URLSearchParamsPrototypeGet: (self: unknown, name: string) => string | null;
11
11
  export declare const URLSearchParamsPrototypeGetAll: (self: unknown, name: string) => string[];
12
12
  export declare const URLSearchParamsPrototypeHas: (self: unknown, name: string, value?: string | undefined) => boolean;
@@ -25,15 +25,15 @@ __export(lock_manager_exports, {
25
25
  module.exports = __toCommonJS(lock_manager_exports);
26
26
  var import_message = require("../errors/message");
27
27
  var import_safe = require("../fs/safe");
28
- var import_logger = require("../logger/logger");
28
+ var import_default = require("../logger/default");
29
29
  var import_date = require("../primordials/date");
30
30
  var import_error = require("../primordials/error");
31
31
  var import_map_set = require("../primordials/map-set");
32
32
  var import_math = require("../primordials/math");
33
33
  var import_retry = require("../promises/retry");
34
- var import_register = require("../signal-exit/register");
34
+ var import_handler = require("../events/exit/handler");
35
35
  var import_internal = require("./_internal");
36
- const logger = (0, import_logger.getDefaultLogger)();
36
+ const logger = (0, import_default.getDefaultLogger)();
37
37
  class ProcessLockManager {
38
38
  activeLocks = new import_map_set.SetCtor();
39
39
  touchTimers = new import_map_set.MapCtor();
@@ -46,7 +46,7 @@ class ProcessLockManager {
46
46
  if (this.exitHandlerRegistered) {
47
47
  return;
48
48
  }
49
- (0, import_register.onExit)(() => {
49
+ (0, import_handler.onExit)(() => {
50
50
  for (const timer of this.touchTimers.values()) {
51
51
  clearInterval(timer);
52
52
  }
@@ -27,8 +27,8 @@ __export(internal_exports, {
27
27
  windowsScriptExtRegExp: () => windowsScriptExtRegExp
28
28
  });
29
29
  module.exports = __toCommonJS(internal_exports);
30
- var import_strip = require("../ansi/strip");
31
- var import_map_set = require("../primordials/map-set");
30
+ var import_strip = require("../../ansi/strip");
31
+ var import_map_set = require("../../primordials/map-set");
32
32
  const stackCache = new import_map_set.WeakMapCtor();
33
33
  const spawnBinPathCache = new import_map_set.MapCtor();
34
34
  const windowsScriptExtRegExp = /\.(?:cmd|bat|ps1)$/i;
@@ -36,7 +36,7 @@ let _npmCliPromiseSpawn;
36
36
  // @__NO_SIDE_EFFECTS__
37
37
  function getNpmCliPromiseSpawn() {
38
38
  if (_npmCliPromiseSpawn === void 0) {
39
- _npmCliPromiseSpawn = require("../external/@npmcli/promise-spawn");
39
+ _npmCliPromiseSpawn = require("../../external/@npmcli/promise-spawn");
40
40
  }
41
41
  return _npmCliPromiseSpawn;
42
42
  }
@@ -28,27 +28,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  mod
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
- var spawn_exports = {};
32
- __export(spawn_exports, {
31
+ var child_exports = {};
32
+ __export(child_exports, {
33
33
  spawn: () => spawn,
34
34
  spawnSync: () => spawnSync
35
35
  });
36
- module.exports = __toCommonJS(spawn_exports);
36
+ module.exports = __toCommonJS(child_exports);
37
37
  var import_node_process = __toESM(require("node:process"));
38
- var import_which = require("../bin/which");
39
- var import_abort = require("../process/abort");
40
- var import_child_process = require("../node/child-process");
41
- var import_fs = require("../node/fs");
42
- var import_path = require("../node/path");
43
- var import_inspect = require("../objects/inspect");
44
- var import_normalize = require("../paths/normalize");
45
- var import_regexp = require("../primordials/regexp");
46
- var import_registry = require("../spinner/registry");
38
+ var import_which = require("../../bin/which");
39
+ var import_abort = require("../../process/abort");
40
+ var import_child_process = require("../../node/child-process");
41
+ var import_fs = require("../../node/fs");
42
+ var import_path = require("../../node/path");
43
+ var import_inspect = require("../../objects/inspect");
44
+ var import_normalize = require("../../paths/normalize");
45
+ var import_regexp = require("../../primordials/regexp");
46
+ var import_default = require("../../spinner/default");
47
47
  var import_internal = require("./_internal");
48
48
  var import_errors = require("./errors");
49
49
  var import_stdio = require("./stdio");
50
50
  const abortSignal = (0, import_abort.getAbortSignal)();
51
- const spinner = (0, import_registry.getDefaultSpinner)();
51
+ const spinner = (0, import_default.getDefaultSpinner)();
52
52
  function spawn(cmd, args, options, extra) {
53
53
  const {
54
54
  spinner: optionsSpinner = spinner,
@@ -24,11 +24,11 @@ __export(errors_exports, {
24
24
  isSpawnError: () => isSpawnError
25
25
  });
26
26
  module.exports = __toCommonJS(errors_exports);
27
- var import_stack = require("../errors/stack");
28
- var import_predicates = require("../objects/predicates");
29
- var import_error = require("../primordials/error");
30
- var import_object = require("../primordials/object");
31
- var import_reflect = require("../primordials/reflect");
27
+ var import_stack = require("../../errors/stack");
28
+ var import_predicates = require("../../objects/predicates");
29
+ var import_error = require("../../primordials/error");
30
+ var import_object = require("../../primordials/object");
31
+ var import_reflect = require("../../primordials/reflect");
32
32
  var import_internal = require("./_internal");
33
33
  // @__NO_SIDE_EFFECTS__
34
34
  function enhanceSpawnError(error) {
@@ -23,7 +23,7 @@ __export(stdio_exports, {
23
23
  isStdioType: () => isStdioType
24
24
  });
25
25
  module.exports = __toCommonJS(stdio_exports);
26
- var import_predicates = require("../arrays/predicates");
26
+ var import_predicates = require("../../arrays/predicates");
27
27
  // @__NO_SIDE_EFFECTS__
28
28
  function isStdioType(stdio, type) {
29
29
  if (arguments.length === 1) {
@@ -18,8 +18,8 @@
18
18
  */
19
19
  import type { SendHandle, Serializable, StdioOptions } from 'node:child_process';
20
20
  import type { EventEmitter } from 'node:events';
21
- import type { Remap } from '../objects/types';
22
- import type { SpinnerInstance } from '../spinner/types';
21
+ import type { Remap } from '../../objects/types';
22
+ import type { SpinnerInstance } from '../../spinner/types';
23
23
  export type BufferEncoding = globalThis.BufferEncoding;
24
24
  /**
25
25
  * Options for spawning a child process with promise-based completion.
@@ -270,7 +270,7 @@ export interface WritableStreamType {
270
270
  * @property {number | undefined} gid - Group identity (POSIX)
271
271
  * @property {boolean | string | undefined} shell - Run command in shell.
272
272
  * @property {AbortSignal | undefined} signal - Abort signal.
273
- * @property {import('../spinner/types').SpinnerInstance | undefined} spinner -
273
+ * @property {import('../../spinner/types').SpinnerInstance | undefined} spinner -
274
274
  * Spinner instance to pause during execution.
275
275
  * @property {StdioType | undefined} stdio - Stdio configuration.
276
276
  * @property {boolean | undefined} stdioString - Convert output to strings
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @file Public type surface for `promises/*` modules: `RetryOptions`,
3
- * `IterationOptions`, and `PromiseWithResolvers`. Pure types, no runtime side
4
- * effects.
3
+ * `IterationOptions`, `PromiseWithResolvers`, and the `QueuedTask` storage
4
+ * shape used by the bounded-concurrency `PromiseQueue`. Pure types, no
5
+ * runtime side effects.
5
6
  */
6
7
  /**
7
8
  * Configuration options for retry behavior with exponential backoff.
@@ -188,3 +189,15 @@ export interface PromiseWithResolvers<T> {
188
189
  */
189
190
  reject: (reason?: unknown) => void;
190
191
  }
192
+ /**
193
+ * Queued-task storage shape for the bounded-concurrency `PromiseQueue`.
194
+ *
195
+ * Each entry pairs a deferred task function with the resolver / rejecter for
196
+ * the promise returned to the caller, so the queue can run tasks under a
197
+ * concurrency cap and forward results when they settle.
198
+ */
199
+ export type QueuedTask<T> = {
200
+ fn: () => Promise<T>;
201
+ resolve: (value: T) => void;
202
+ reject: (error: unknown) => void;
203
+ };
@@ -27,11 +27,11 @@ module.exports = __toCommonJS(github_archives_exports);
27
27
  var import_detect = require("../archives/detect");
28
28
  var import_extract = require("../archives/extract");
29
29
  var import_safe = require("../fs/safe");
30
- var import_logger = require("../logger/logger");
30
+ var import_default = require("../logger/default");
31
31
  var import_error = require("../primordials/error");
32
32
  var import_github_downloads = require("./github-downloads");
33
33
  var import_path = require("../node/path");
34
- const logger = (0, import_logger.getDefaultLogger)();
34
+ const logger = (0, import_default.getDefaultLogger)();
35
35
  async function downloadAndExtractArchive(tag, assetPattern, outputDir, repoConfig, options = { __proto__: null }) {
36
36
  const { cleanup = true, format, quiet = false, strip } = options;
37
37
  const path = (0, import_path.getNodePath)();