@socketsecurity/lib 3.3.1 → 3.3.3

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 (64) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/agent.d.ts +0 -4
  3. package/dist/agent.js +3 -7
  4. package/dist/constants/packages.d.ts +7 -0
  5. package/dist/constants/packages.js +7 -0
  6. package/dist/dlx-package.js +27 -0
  7. package/dist/env/ci.d.ts +1 -0
  8. package/dist/env/ci.js +1 -0
  9. package/dist/env/debug.d.ts +1 -0
  10. package/dist/env/debug.js +1 -0
  11. package/dist/env/github.d.ts +8 -0
  12. package/dist/env/github.js +8 -0
  13. package/dist/env/helpers.d.ts +3 -0
  14. package/dist/env/helpers.js +3 -0
  15. package/dist/env/home.d.ts +1 -0
  16. package/dist/env/home.js +1 -0
  17. package/dist/env/locale.d.ts +3 -0
  18. package/dist/env/locale.js +3 -0
  19. package/dist/env/node-auth-token.d.ts +1 -0
  20. package/dist/env/node-auth-token.js +1 -0
  21. package/dist/env/node-env.d.ts +1 -0
  22. package/dist/env/node-env.js +1 -0
  23. package/dist/env/npm.d.ts +5 -0
  24. package/dist/env/npm.js +5 -0
  25. package/dist/env/package-manager.d.ts +3 -0
  26. package/dist/env/package-manager.js +5 -2
  27. package/dist/env/path.d.ts +1 -0
  28. package/dist/env/path.js +1 -0
  29. package/dist/env/pre-commit.d.ts +1 -0
  30. package/dist/env/pre-commit.js +1 -0
  31. package/dist/env/shell.d.ts +1 -0
  32. package/dist/env/shell.js +1 -0
  33. package/dist/env/socket-cli-shadow.d.ts +5 -0
  34. package/dist/env/socket-cli-shadow.js +5 -0
  35. package/dist/env/socket-cli.d.ts +14 -0
  36. package/dist/env/socket-cli.js +14 -0
  37. package/dist/env/socket.d.ts +15 -0
  38. package/dist/env/socket.js +15 -0
  39. package/dist/env/temp-dir.d.ts +3 -0
  40. package/dist/env/temp-dir.js +3 -0
  41. package/dist/env/term.d.ts +1 -0
  42. package/dist/env/term.js +1 -0
  43. package/dist/env/test.d.ts +3 -0
  44. package/dist/env/test.js +4 -1
  45. package/dist/env/windows.d.ts +4 -0
  46. package/dist/env/windows.js +4 -0
  47. package/dist/env/xdg.d.ts +3 -0
  48. package/dist/env/xdg.js +3 -0
  49. package/dist/external/@npmcli/arborist.js +5 -0
  50. package/dist/external/@yarnpkg/extensions.js +2 -2
  51. package/dist/external/cacache.js +4 -13036
  52. package/dist/external/libnpmpack.js +4 -67685
  53. package/dist/external/make-fetch-happen.js +4 -22639
  54. package/dist/external/normalize-package-data.js +4 -4478
  55. package/dist/external/npm-core.js +6588 -0
  56. package/dist/external/npm-pack.js +87518 -0
  57. package/dist/external/npm-package-arg.js +4 -4515
  58. package/dist/external/pacote.js +4 -50314
  59. package/dist/external/semver.js +4 -1934
  60. package/dist/fs.d.ts +0 -6
  61. package/dist/fs.js +0 -6
  62. package/dist/logger.d.ts +4 -0
  63. package/dist/logger.js +4 -1
  64. package/package.json +76 -74
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.3.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.3) - 2025-11-13
9
+
10
+ ### Fixed
11
+
12
+ - **build**: Break node-gyp string to prevent bundler issues with ESM/CJS interop
13
+
14
+ ## [3.3.2](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.2) - 2025-11-13
15
+
16
+ ### Changed
17
+
18
+ - **dlx**: Install package dependencies after download
19
+ - **external**: Optimize npm package bundle sizes (~3MB reduction)
20
+
8
21
  ## [3.3.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.1) - 2025-11-11
9
22
 
10
23
  ### Added
package/dist/agent.d.ts CHANGED
@@ -5,7 +5,6 @@ import type { SpawnOptions } from './spawn';
5
5
  * SECURITY: Uses array-based arguments to prevent command injection. All elements
6
6
  * in the args array are properly escaped by Node.js when passed to spawn().
7
7
  */
8
- /*@__NO_SIDE_EFFECTS__*/
9
8
  export declare function execNpm(args: string[], options?: SpawnOptions | undefined): import("./spawn").PromiseSpawnResult;
10
9
  export interface PnpmOptions extends SpawnOptions {
11
10
  allowLockfileUpdate?: boolean;
@@ -16,7 +15,6 @@ export interface PnpmOptions extends SpawnOptions {
16
15
  * SECURITY: Uses array-based arguments to prevent command injection. All elements
17
16
  * in the args array are properly escaped by Node.js when passed to execBin().
18
17
  */
19
- /*@__NO_SIDE_EFFECTS__*/
20
18
  export declare function execPnpm(args: string[], options?: PnpmOptions | undefined): Promise<{
21
19
  cmd: string;
22
20
  args: string[] | readonly string[];
@@ -31,7 +29,6 @@ export declare function execPnpm(args: string[], options?: PnpmOptions | undefin
31
29
  * SECURITY: Uses array-based arguments to prevent command injection. All elements
32
30
  * in the args array are properly escaped by Node.js when passed to execBin().
33
31
  */
34
- /*@__NO_SIDE_EFFECTS__*/
35
32
  export declare function execYarn(args: string[], options?: import('./spawn').SpawnOptions): Promise<{
36
33
  cmd: string;
37
34
  args: string[] | readonly string[];
@@ -91,7 +88,6 @@ export declare const isPnpmLoglevelFlag: typeof isNpmLoglevelFlag;
91
88
  export interface ExecScriptOptions extends SpawnOptions {
92
89
  prepost?: boolean | undefined;
93
90
  }
94
- /*@__NO_SIDE_EFFECTS__*/
95
91
  export declare function execScript(scriptName: string, args?: string[] | readonly string[] | ExecScriptOptions | undefined, options?: ExecScriptOptions | undefined): Promise<{
96
92
  cmd: string;
97
93
  args: string[] | readonly string[];
package/dist/agent.js CHANGED
@@ -74,7 +74,6 @@ const yarnInstallLikeCommands = /* @__PURE__ */ new Set([
74
74
  "unlink",
75
75
  "import"
76
76
  ]);
77
- // @__NO_SIDE_EFFECTS__
78
77
  function execNpm(args, options) {
79
78
  const useDebug = (0, import_debug.isDebug)();
80
79
  const terminatorPos = args.indexOf("--");
@@ -113,7 +112,6 @@ function execNpm(args, options) {
113
112
  }
114
113
  );
115
114
  }
116
- // @__NO_SIDE_EFFECTS__
117
115
  function execPnpm(args, options) {
118
116
  const { allowLockfileUpdate, ...extBinOpts } = {
119
117
  __proto__: null,
@@ -147,7 +145,6 @@ function execPnpm(args, options) {
147
145
  extBinOpts
148
146
  );
149
147
  }
150
- // @__NO_SIDE_EFFECTS__
151
148
  function execYarn(args, options) {
152
149
  const useDebug = (0, import_debug.isDebug)();
153
150
  const terminatorPos = args.indexOf("--");
@@ -213,7 +210,6 @@ function isPnpmInstallCommand(cmdArg) {
213
210
  return pnpmInstallCommands.has(cmdArg);
214
211
  }
215
212
  const isPnpmLoglevelFlag = isNpmLoglevelFlag;
216
- // @__NO_SIDE_EFFECTS__
217
213
  function execScript(scriptName, args, options) {
218
214
  let resolvedOptions;
219
215
  let resolvedArgs;
@@ -239,7 +235,7 @@ function execScript(scriptName, args, options) {
239
235
  { cwd }
240
236
  );
241
237
  if (pnpmLockPath) {
242
- return /* @__PURE__ */ execPnpm(["run", scriptName, ...resolvedArgs], spawnOptions);
238
+ return execPnpm(["run", scriptName, ...resolvedArgs], spawnOptions);
243
239
  }
244
240
  const packageLockPath = (0, import_fs.findUpSync)(
245
241
  /*@__INLINE__*/
@@ -247,7 +243,7 @@ function execScript(scriptName, args, options) {
247
243
  { cwd }
248
244
  );
249
245
  if (packageLockPath) {
250
- return /* @__PURE__ */ execNpm(["run", scriptName, ...resolvedArgs], spawnOptions);
246
+ return execNpm(["run", scriptName, ...resolvedArgs], spawnOptions);
251
247
  }
252
248
  const yarnLockPath = (0, import_fs.findUpSync)(
253
249
  /*@__INLINE__*/
@@ -255,7 +251,7 @@ function execScript(scriptName, args, options) {
255
251
  { cwd }
256
252
  );
257
253
  if (yarnLockPath) {
258
- return /* @__PURE__ */ execYarn(["run", scriptName, ...resolvedArgs], spawnOptions);
254
+ return execYarn(["run", scriptName, ...resolvedArgs], spawnOptions);
259
255
  }
260
256
  return (0, import_spawn.spawn)(
261
257
  /* @__PURE__ */ require("#constants/node").getExecPath(),
@@ -4,16 +4,23 @@ export declare const AT_LATEST = "@latest";
4
4
  export declare const LATEST = "latest";
5
5
  export declare const PACKAGE_DEFAULT_VERSION = "1.0.0";
6
6
  // Package default Node range.
7
+ /*@__NO_SIDE_EFFECTS__*/
7
8
  export declare function getPackageDefaultNodeRange(): string | undefined;
8
9
  // Package default Socket categories.
10
+ /*@__NO_SIDE_EFFECTS__*/
9
11
  export declare function getPackageDefaultSocketCategories(): readonly string[];
10
12
  // Package extensions.
13
+ /*@__NO_SIDE_EFFECTS__*/
11
14
  export declare function getPackageExtensions(): Iterable<[string, unknown]>;
12
15
  // NPM lifecycle event.
16
+ /*@__NO_SIDE_EFFECTS__*/
13
17
  export declare function getNpmLifecycleEvent(): string | undefined;
14
18
  // Lifecycle script names.
19
+ /*@__NO_SIDE_EFFECTS__*/
15
20
  export declare function getLifecycleScriptNames(): string[];
16
21
  // Packument cache.
22
+ /*@__NO_SIDE_EFFECTS__*/
17
23
  export declare function getPackumentCache(): Map<string, unknown>;
18
24
  // Pacote cache path.
25
+ /*@__NO_SIDE_EFFECTS__*/
19
26
  export declare function getPacoteCachePath(): string;
@@ -43,18 +43,21 @@ const PACKAGE = "package";
43
43
  const AT_LATEST = "@latest";
44
44
  const LATEST = "latest";
45
45
  const PACKAGE_DEFAULT_VERSION = "1.0.0";
46
+ // @__NO_SIDE_EFFECTS__
46
47
  function getPackageDefaultNodeRange() {
47
48
  if (_packageDefaultNodeRange === void 0) {
48
49
  _packageDefaultNodeRange = require("#lib/package-default-node-range").packageDefaultNodeRange;
49
50
  }
50
51
  return _packageDefaultNodeRange;
51
52
  }
53
+ // @__NO_SIDE_EFFECTS__
52
54
  function getPackageDefaultSocketCategories() {
53
55
  if (_packageDefaultSocketCategories === void 0) {
54
56
  _packageDefaultSocketCategories = require("#lib/package-default-socket-categories").packageDefaultSocketCategories;
55
57
  }
56
58
  return _packageDefaultSocketCategories;
57
59
  }
60
+ // @__NO_SIDE_EFFECTS__
58
61
  function getPackageExtensions() {
59
62
  if (_packageExtensions === void 0) {
60
63
  const { packageExtensions } = require("#lib/package-extensions");
@@ -62,9 +65,11 @@ function getPackageExtensions() {
62
65
  }
63
66
  return _packageExtensions;
64
67
  }
68
+ // @__NO_SIDE_EFFECTS__
65
69
  function getNpmLifecycleEvent() {
66
70
  return (0, import_npm.getNpmLifecycleEvent)();
67
71
  }
72
+ // @__NO_SIDE_EFFECTS__
68
73
  function getLifecycleScriptNames() {
69
74
  if (_lifecycleScriptNames === void 0) {
70
75
  const { lifecycleScriptNames } = require("#lib/lifecycle-script-names");
@@ -72,12 +77,14 @@ function getLifecycleScriptNames() {
72
77
  }
73
78
  return _lifecycleScriptNames;
74
79
  }
80
+ // @__NO_SIDE_EFFECTS__
75
81
  function getPackumentCache() {
76
82
  if (_packumentCache === void 0) {
77
83
  _packumentCache = /* @__PURE__ */ new Map();
78
84
  }
79
85
  return _packumentCache;
80
86
  }
87
+ // @__NO_SIDE_EFFECTS__
81
88
  function getPacoteCachePath() {
82
89
  if (_pacoteCachePath === void 0) {
83
90
  try {
@@ -75,6 +75,14 @@ function getPacote() {
75
75
  }
76
76
  return _pacote;
77
77
  }
78
+ let _arborist;
79
+ // @__NO_SIDE_EFFECTS__
80
+ function getArborist() {
81
+ if (_arborist === void 0) {
82
+ _arborist = require("./external/@npmcli/arborist");
83
+ }
84
+ return _arborist;
85
+ }
78
86
  const rangeOperatorsRegExp = /[~^><=xX* ]|\|\|/;
79
87
  function parsePackageSpec(spec) {
80
88
  try {
@@ -141,6 +149,25 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
141
149
  // Use consistent pacote cache path (respects npm cache locations when available).
142
150
  cache: pacoteCachePath || import_path.default.join(packageDir, ".cache")
143
151
  });
152
+ const Arborist = /* @__PURE__ */ getArborist();
153
+ const arb = new Arborist({
154
+ path: installedDir,
155
+ cache: pacoteCachePath || import_path.default.join(packageDir, ".cache"),
156
+ // Skip devDependencies (production-only like npx).
157
+ omit: ["dev"],
158
+ // Security: Skip install/preinstall/postinstall scripts to prevent arbitrary code execution.
159
+ ignoreScripts: true,
160
+ // Security: Enable binary links (needed for dlx to execute the package binary).
161
+ binLinks: true,
162
+ // Suppress funding messages (unneeded for ephemeral dlx installs).
163
+ fund: false,
164
+ // Skip audit (unneeded for ephemeral dlx installs).
165
+ audit: false,
166
+ // Suppress output (unneeded for ephemeral dlx installs).
167
+ silent: true
168
+ });
169
+ await arb.buildIdealTree();
170
+ await arb.reify({ save: false });
144
171
  } catch (e) {
145
172
  const code = e.code;
146
173
  if (code === "E404" || code === "ETARGET") {
package/dist/env/ci.d.ts CHANGED
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getCI(): boolean;
package/dist/env/ci.js CHANGED
@@ -24,6 +24,7 @@ __export(ci_exports, {
24
24
  module.exports = __toCommonJS(ci_exports);
25
25
  var import_helpers = require("#env/helpers");
26
26
  var import_rewire = require("#env/rewire");
27
+ // @__NO_SIDE_EFFECTS__
27
28
  function getCI() {
28
29
  return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("CI"));
29
30
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getDebug(): string | undefined;
package/dist/env/debug.js CHANGED
@@ -23,6 +23,7 @@ __export(debug_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(debug_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getDebug() {
27
28
  return (0, import_rewire.getEnvValue)("DEBUG");
28
29
  }
@@ -2,39 +2,47 @@
2
2
  * GITHUB_API_URL environment variable.
3
3
  * GitHub API URL (e.g., https://api.github.com).
4
4
  */
5
+ /*@__NO_SIDE_EFFECTS__*/
5
6
  export declare function getGithubApiUrl(): string | undefined;
6
7
  /**
7
8
  * GITHUB_BASE_REF environment variable.
8
9
  * GitHub pull request base branch.
9
10
  */
11
+ /*@__NO_SIDE_EFFECTS__*/
10
12
  export declare function getGithubBaseRef(): string | undefined;
11
13
  /**
12
14
  * GITHUB_REF_NAME environment variable.
13
15
  * GitHub branch or tag name.
14
16
  */
17
+ /*@__NO_SIDE_EFFECTS__*/
15
18
  export declare function getGithubRefName(): string | undefined;
16
19
  /**
17
20
  * GITHUB_REF_TYPE environment variable.
18
21
  * GitHub ref type (branch or tag).
19
22
  */
23
+ /*@__NO_SIDE_EFFECTS__*/
20
24
  export declare function getGithubRefType(): string | undefined;
21
25
  /**
22
26
  * GITHUB_REPOSITORY environment variable.
23
27
  * GitHub repository name in owner/repo format.
24
28
  */
29
+ /*@__NO_SIDE_EFFECTS__*/
25
30
  export declare function getGithubRepository(): string | undefined;
26
31
  /**
27
32
  * GITHUB_SERVER_URL environment variable.
28
33
  * GitHub server URL (e.g., https://github.com).
29
34
  */
35
+ /*@__NO_SIDE_EFFECTS__*/
30
36
  export declare function getGithubServerUrl(): string | undefined;
31
37
  /**
32
38
  * GITHUB_TOKEN environment variable.
33
39
  * GitHub authentication token for API access.
34
40
  */
41
+ /*@__NO_SIDE_EFFECTS__*/
35
42
  export declare function getGithubToken(): string | undefined;
36
43
  /**
37
44
  * GH_TOKEN environment variable.
38
45
  * Alternative GitHub authentication token for API access (used by GitHub CLI).
39
46
  */
47
+ /*@__NO_SIDE_EFFECTS__*/
40
48
  export declare function getGhToken(): string | undefined;
@@ -30,27 +30,35 @@ __export(github_exports, {
30
30
  });
31
31
  module.exports = __toCommonJS(github_exports);
32
32
  var import_rewire = require("#env/rewire");
33
+ // @__NO_SIDE_EFFECTS__
33
34
  function getGithubApiUrl() {
34
35
  return (0, import_rewire.getEnvValue)("GITHUB_API_URL");
35
36
  }
37
+ // @__NO_SIDE_EFFECTS__
36
38
  function getGithubBaseRef() {
37
39
  return (0, import_rewire.getEnvValue)("GITHUB_BASE_REF");
38
40
  }
41
+ // @__NO_SIDE_EFFECTS__
39
42
  function getGithubRefName() {
40
43
  return (0, import_rewire.getEnvValue)("GITHUB_REF_NAME");
41
44
  }
45
+ // @__NO_SIDE_EFFECTS__
42
46
  function getGithubRefType() {
43
47
  return (0, import_rewire.getEnvValue)("GITHUB_REF_TYPE");
44
48
  }
49
+ // @__NO_SIDE_EFFECTS__
45
50
  function getGithubRepository() {
46
51
  return (0, import_rewire.getEnvValue)("GITHUB_REPOSITORY");
47
52
  }
53
+ // @__NO_SIDE_EFFECTS__
48
54
  function getGithubServerUrl() {
49
55
  return (0, import_rewire.getEnvValue)("GITHUB_SERVER_URL");
50
56
  }
57
+ // @__NO_SIDE_EFFECTS__
51
58
  function getGithubToken() {
52
59
  return (0, import_rewire.getEnvValue)("GITHUB_TOKEN");
53
60
  }
61
+ // @__NO_SIDE_EFFECTS__
54
62
  function getGhToken() {
55
63
  return (0, import_rewire.getEnvValue)("GH_TOKEN");
56
64
  }
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * @fileoverview Environment variable type conversion helpers.
3
3
  */
4
+ /*@__NO_SIDE_EFFECTS__*/
4
5
  export declare function envAsBoolean(value: string | undefined): boolean;
6
+ /*@__NO_SIDE_EFFECTS__*/
5
7
  export declare function envAsNumber(value: string | undefined): number;
8
+ /*@__NO_SIDE_EFFECTS__*/
6
9
  export declare function envAsString(value: string | undefined): string;
@@ -24,6 +24,7 @@ __export(helpers_exports, {
24
24
  envAsString: () => envAsString
25
25
  });
26
26
  module.exports = __toCommonJS(helpers_exports);
27
+ // @__NO_SIDE_EFFECTS__
27
28
  function envAsBoolean(value) {
28
29
  if (!value) {
29
30
  return false;
@@ -31,6 +32,7 @@ function envAsBoolean(value) {
31
32
  const lower = value.toLowerCase();
32
33
  return lower === "true" || lower === "1" || lower === "yes";
33
34
  }
35
+ // @__NO_SIDE_EFFECTS__
34
36
  function envAsNumber(value) {
35
37
  if (!value) {
36
38
  return 0;
@@ -38,6 +40,7 @@ function envAsNumber(value) {
38
40
  const num = Number(value);
39
41
  return Number.isNaN(num) ? 0 : num;
40
42
  }
43
+ // @__NO_SIDE_EFFECTS__
41
44
  function envAsString(value) {
42
45
  return value || "";
43
46
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getHome(): string | undefined;
package/dist/env/home.js CHANGED
@@ -23,6 +23,7 @@ __export(home_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(home_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getHome() {
27
28
  return (0, import_rewire.getEnvValue)("HOME");
28
29
  }
@@ -2,14 +2,17 @@
2
2
  * LANG environment variable.
3
3
  * System locale and language settings.
4
4
  */
5
+ /*@__NO_SIDE_EFFECTS__*/
5
6
  export declare function getLang(): string | undefined;
6
7
  /**
7
8
  * LC_ALL environment variable.
8
9
  * Override for all locale settings.
9
10
  */
11
+ /*@__NO_SIDE_EFFECTS__*/
10
12
  export declare function getLcAll(): string | undefined;
11
13
  /**
12
14
  * LC_MESSAGES environment variable.
13
15
  * Locale setting for message translations.
14
16
  */
17
+ /*@__NO_SIDE_EFFECTS__*/
15
18
  export declare function getLcMessages(): string | undefined;
@@ -25,12 +25,15 @@ __export(locale_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(locale_exports);
27
27
  var import_rewire = require("#env/rewire");
28
+ // @__NO_SIDE_EFFECTS__
28
29
  function getLang() {
29
30
  return (0, import_rewire.getEnvValue)("LANG");
30
31
  }
32
+ // @__NO_SIDE_EFFECTS__
31
33
  function getLcAll() {
32
34
  return (0, import_rewire.getEnvValue)("LC_ALL");
33
35
  }
36
+ // @__NO_SIDE_EFFECTS__
34
37
  function getLcMessages() {
35
38
  return (0, import_rewire.getEnvValue)("LC_MESSAGES");
36
39
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getNodeAuthToken(): string | undefined;
@@ -23,6 +23,7 @@ __export(node_auth_token_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(node_auth_token_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getNodeAuthToken() {
27
28
  return (0, import_rewire.getEnvValue)("NODE_AUTH_TOKEN");
28
29
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getNodeEnv(): string | undefined;
@@ -23,6 +23,7 @@ __export(node_env_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(node_env_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getNodeEnv() {
27
28
  return (0, import_rewire.getEnvValue)("NODE_ENV");
28
29
  }
package/dist/env/npm.d.ts CHANGED
@@ -2,24 +2,29 @@
2
2
  * npm_config_registry environment variable.
3
3
  * NPM registry URL configured by package managers.
4
4
  */
5
+ /*@__NO_SIDE_EFFECTS__*/
5
6
  export declare function getNpmConfigRegistry(): string | undefined;
6
7
  /**
7
8
  * npm_config_user_agent environment variable.
8
9
  * User agent string set by npm/pnpm/yarn package managers.
9
10
  */
11
+ /*@__NO_SIDE_EFFECTS__*/
10
12
  export declare function getNpmConfigUserAgent(): string | undefined;
11
13
  /**
12
14
  * npm_lifecycle_event environment variable.
13
15
  * The name of the npm lifecycle event that's currently running.
14
16
  */
17
+ /*@__NO_SIDE_EFFECTS__*/
15
18
  export declare function getNpmLifecycleEvent(): string | undefined;
16
19
  /**
17
20
  * NPM_REGISTRY environment variable.
18
21
  * NPM registry URL override.
19
22
  */
23
+ /*@__NO_SIDE_EFFECTS__*/
20
24
  export declare function getNpmRegistry(): string | undefined;
21
25
  /**
22
26
  * NPM_TOKEN environment variable.
23
27
  * Authentication token for NPM registry access.
24
28
  */
29
+ /*@__NO_SIDE_EFFECTS__*/
25
30
  export declare function getNpmToken(): string | undefined;
package/dist/env/npm.js CHANGED
@@ -27,18 +27,23 @@ __export(npm_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(npm_exports);
29
29
  var import_rewire = require("#env/rewire");
30
+ // @__NO_SIDE_EFFECTS__
30
31
  function getNpmConfigRegistry() {
31
32
  return (0, import_rewire.getEnvValue)("npm_config_registry");
32
33
  }
34
+ // @__NO_SIDE_EFFECTS__
33
35
  function getNpmConfigUserAgent() {
34
36
  return (0, import_rewire.getEnvValue)("npm_config_user_agent");
35
37
  }
38
+ // @__NO_SIDE_EFFECTS__
36
39
  function getNpmLifecycleEvent() {
37
40
  return (0, import_rewire.getEnvValue)("npm_lifecycle_event");
38
41
  }
42
+ // @__NO_SIDE_EFFECTS__
39
43
  function getNpmRegistry() {
40
44
  return (0, import_rewire.getEnvValue)("NPM_REGISTRY");
41
45
  }
46
+ // @__NO_SIDE_EFFECTS__
42
47
  function getNpmToken() {
43
48
  return (0, import_rewire.getEnvValue)("NPM_TOKEN");
44
49
  }
@@ -27,6 +27,7 @@ export type PackageManagerType = 'npm' | 'pnpm' | 'yarn' | 'bun' | null;
27
27
  * detectPackageManager() // null
28
28
  * ```
29
29
  */
30
+ /*@__NO_SIDE_EFFECTS__*/
30
31
  export declare function detectPackageManager(): PackageManagerType;
31
32
  /**
32
33
  * Get the package manager name and version from user agent.
@@ -38,6 +39,7 @@ export declare function detectPackageManager(): PackageManagerType;
38
39
  * // { name: 'pnpm', version: '8.15.1' }
39
40
  * ```
40
41
  */
42
+ /*@__NO_SIDE_EFFECTS__*/
41
43
  export declare function getPackageManagerInfo(): {
42
44
  name: string;
43
45
  version: string;
@@ -55,4 +57,5 @@ export declare function getPackageManagerInfo(): {
55
57
  * // yarn: "yarn/1.22.19 npm/? node/v20.11.0 darwin arm64"
56
58
  * ```
57
59
  */
60
+ /*@__NO_SIDE_EFFECTS__*/
58
61
  export declare function getPackageManagerUserAgent(): string | undefined;
@@ -25,8 +25,9 @@ __export(package_manager_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(package_manager_exports);
27
27
  var import_rewire = require("#env/rewire");
28
+ // @__NO_SIDE_EFFECTS__
28
29
  function detectPackageManager() {
29
- const userAgent = getPackageManagerUserAgent();
30
+ const userAgent = /* @__PURE__ */ getPackageManagerUserAgent();
30
31
  if (userAgent) {
31
32
  const match = userAgent.match(/^(npm|pnpm|yarn|bun)\//);
32
33
  if (match) {
@@ -50,8 +51,9 @@ function detectPackageManager() {
50
51
  }
51
52
  return null;
52
53
  }
54
+ // @__NO_SIDE_EFFECTS__
53
55
  function getPackageManagerInfo() {
54
- const userAgent = getPackageManagerUserAgent();
56
+ const userAgent = /* @__PURE__ */ getPackageManagerUserAgent();
55
57
  if (!userAgent) {
56
58
  return null;
57
59
  }
@@ -64,6 +66,7 @@ function getPackageManagerInfo() {
64
66
  }
65
67
  return null;
66
68
  }
69
+ // @__NO_SIDE_EFFECTS__
67
70
  function getPackageManagerUserAgent() {
68
71
  return (0, import_rewire.getEnvValue)("npm_config_user_agent");
69
72
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getPath(): string | undefined;
package/dist/env/path.js CHANGED
@@ -23,6 +23,7 @@ __export(path_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(path_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getPath() {
27
28
  return (0, import_rewire.getEnvValue)("PATH");
28
29
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getPreCommit(): boolean;
@@ -24,6 +24,7 @@ __export(pre_commit_exports, {
24
24
  module.exports = __toCommonJS(pre_commit_exports);
25
25
  var import_helpers = require("#env/helpers");
26
26
  var import_rewire = require("#env/rewire");
27
+ // @__NO_SIDE_EFFECTS__
27
28
  function getPreCommit() {
28
29
  return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("PRE_COMMIT"));
29
30
  }
@@ -1 +1,2 @@
1
+ /*@__NO_SIDE_EFFECTS__*/
1
2
  export declare function getShell(): string | undefined;
package/dist/env/shell.js CHANGED
@@ -23,6 +23,7 @@ __export(shell_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(shell_exports);
25
25
  var import_rewire = require("#env/rewire");
26
+ // @__NO_SIDE_EFFECTS__
26
27
  function getShell() {
27
28
  return (0, import_rewire.getEnvValue)("SHELL");
28
29
  }
@@ -3,28 +3,33 @@
3
3
  *
4
4
  * @returns Whether to accept all risks in shadow mode
5
5
  */
6
+ /*@__NO_SIDE_EFFECTS__*/
6
7
  export declare function getSocketCliShadowAcceptRisks(): boolean;
7
8
  /**
8
9
  * API token for Socket CLI shadow mode.
9
10
  *
10
11
  * @returns Shadow mode API token or undefined
11
12
  */
13
+ /*@__NO_SIDE_EFFECTS__*/
12
14
  export declare function getSocketCliShadowApiToken(): string | undefined;
13
15
  /**
14
16
  * Binary path for Socket CLI shadow mode.
15
17
  *
16
18
  * @returns Shadow mode binary path or undefined
17
19
  */
20
+ /*@__NO_SIDE_EFFECTS__*/
18
21
  export declare function getSocketCliShadowBin(): string | undefined;
19
22
  /**
20
23
  * Controls Socket CLI shadow mode progress display.
21
24
  *
22
25
  * @returns Whether to show progress in shadow mode
23
26
  */
27
+ /*@__NO_SIDE_EFFECTS__*/
24
28
  export declare function getSocketCliShadowProgress(): boolean;
25
29
  /**
26
30
  * Controls Socket CLI shadow mode silent operation.
27
31
  *
28
32
  * @returns Whether shadow mode should operate silently
29
33
  */
34
+ /*@__NO_SIDE_EFFECTS__*/
30
35
  export declare function getSocketCliShadowSilent(): boolean;
@@ -28,18 +28,23 @@ __export(socket_cli_shadow_exports, {
28
28
  module.exports = __toCommonJS(socket_cli_shadow_exports);
29
29
  var import_helpers = require("#env/helpers");
30
30
  var import_rewire = require("#env/rewire");
31
+ // @__NO_SIDE_EFFECTS__
31
32
  function getSocketCliShadowAcceptRisks() {
32
33
  return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_SHADOW_ACCEPT_RISKS"));
33
34
  }
35
+ // @__NO_SIDE_EFFECTS__
34
36
  function getSocketCliShadowApiToken() {
35
37
  return (0, import_rewire.getEnvValue)("SOCKET_CLI_SHADOW_API_TOKEN");
36
38
  }
39
+ // @__NO_SIDE_EFFECTS__
37
40
  function getSocketCliShadowBin() {
38
41
  return (0, import_rewire.getEnvValue)("SOCKET_CLI_SHADOW_BIN");
39
42
  }
43
+ // @__NO_SIDE_EFFECTS__
40
44
  function getSocketCliShadowProgress() {
41
45
  return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_SHADOW_PROGRESS"));
42
46
  }
47
+ // @__NO_SIDE_EFFECTS__
43
48
  function getSocketCliShadowSilent() {
44
49
  return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_SHADOW_SILENT"));
45
50
  }