@socketsecurity/lib 6.0.7 → 6.0.8
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.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/ai/agent-context.d.mts +103 -0
- package/dist/ai/agent-context.js +157 -0
- package/dist/ai/backends.d.mts +83 -0
- package/dist/ai/backends.js +173 -0
- package/dist/ai/credentials.d.mts +49 -0
- package/dist/ai/credentials.js +82 -0
- package/dist/ai/discover.d.mts +4 -0
- package/dist/ai/discover.js +1 -1
- package/dist/ai/exec.d.mts +52 -0
- package/dist/ai/exec.js +92 -0
- package/dist/ai/http.d.mts +132 -0
- package/dist/ai/http.js +130 -0
- package/dist/ai/profiles.d.mts +41 -6
- package/dist/ai/profiles.js +52 -10
- package/dist/ai/route.d.mts +69 -0
- package/dist/ai/route.js +156 -0
- package/dist/ai/spawn.d.mts +10 -2
- package/dist/ai/spawn.js +55 -31
- package/dist/ai/subagent-status.d.mts +48 -0
- package/dist/ai/subagent-status.js +57 -0
- package/dist/ai/tier.d.mts +60 -0
- package/dist/ai/tier.js +53 -0
- package/dist/ai/types.d.mts +15 -2
- package/dist/ai/worktree.js +4 -0
- package/dist/archives/tar.js +1 -1
- package/dist/archives/zip.js +2 -2
- package/dist/argv/parse.d.ts +19 -2
- package/dist/argv/parse.js +1 -1
- package/dist/arrays/join.js +4 -0
- package/dist/bin/find.js +4 -4
- package/dist/bin/prim.cjs +3915 -3781
- package/dist/bin/resolve.js +1 -1
- package/dist/cache/ttl/store.js +1 -1
- package/dist/cli/check-primordials.d.ts +8 -3
- package/dist/cli/check-primordials.js +4 -4
- package/dist/compression/_internal.js +1 -1
- package/dist/compression/brotli.d.ts +1 -2
- package/dist/compression/brotli.js +6 -2
- package/dist/compression/gzip.js +6 -2
- package/dist/constants/packages.d.ts +3 -0
- package/dist/constants/packages.js +2 -1
- package/dist/constants/socket.d.ts +2 -6
- package/dist/constants/socket.js +12 -14
- package/dist/cover/code.js +2 -2
- package/dist/crypto/hash.d.ts +4 -1
- package/dist/crypto/hash.js +4 -1
- package/dist/debug/caller-info.js +1 -1
- package/dist/dlx/arborist.js +13 -3
- package/dist/dlx/binary-cache.js +1 -1
- package/dist/dlx/binary-resolution.js +1 -1
- package/dist/dlx/detect.d.ts +8 -0
- package/dist/dlx/firewall.d.ts +8 -0
- package/dist/dlx/firewall.js +1 -1
- package/dist/dlx/lockfile.js +4 -1
- package/dist/dlx/manifest.js +1 -1
- package/dist/dlx/package.js +4 -0
- package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
- package/dist/eco/cargo/parse-lockfile.js +3 -3
- package/dist/eco/manifest/detect-format.js +1 -1
- package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
- package/dist/eco/npm/npm/parse-lockfile.js +2 -2
- package/dist/eco/npm/parse-package-json.d.ts +11 -0
- package/dist/eco/npm/parse-package-json.js +1 -1
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
- package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +1 -1
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +1 -0
- package/dist/env/rewire.js +1 -1
- package/dist/env/socket.d.ts +7 -0
- package/dist/env/socket.js +10 -0
- package/dist/errors/predicates.js +1 -1
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/which.js +3 -1
- package/dist/external-tools/bazel/asset-names.d.ts +1 -1
- package/dist/external-tools/bazel/asset-names.js +5 -2
- package/dist/external-tools/bazel/from-download.d.ts +1 -1
- package/dist/external-tools/bazel/from-download.js +5 -2
- package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
- package/dist/external-tools/bazel/resolve.d.ts +3 -3
- package/dist/external-tools/bazel/resolve.js +16 -8
- package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
- package/dist/external-tools/cdxgen/asset-names.js +5 -2
- package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
- package/dist/external-tools/cdxgen/from-download.js +7 -4
- package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
- package/dist/external-tools/cdxgen/resolve.js +16 -8
- package/dist/external-tools/from-download.d.ts +2 -2
- package/dist/external-tools/from-download.js +11 -5
- package/dist/external-tools/from-pip-venv.d.ts +1 -1
- package/dist/external-tools/from-pip-venv.js +12 -5
- package/dist/external-tools/janus/asset-names.d.ts +1 -1
- package/dist/external-tools/janus/asset-names.js +5 -2
- package/dist/external-tools/janus/from-download.d.ts +1 -1
- package/dist/external-tools/janus/from-download.js +5 -2
- package/dist/external-tools/janus/resolve.d.ts +3 -3
- package/dist/external-tools/janus/resolve.js +16 -8
- package/dist/external-tools/jre/asset-names.d.ts +1 -1
- package/dist/external-tools/jre/asset-names.js +5 -2
- package/dist/external-tools/jre/from-download.d.ts +1 -1
- package/dist/external-tools/jre/from-download.js +7 -4
- package/dist/external-tools/jre/from-java-home.js +2 -2
- package/dist/external-tools/jre/from-vfs.js +2 -2
- package/dist/external-tools/jre/resolve.d.ts +3 -3
- package/dist/external-tools/jre/resolve.js +16 -8
- package/dist/external-tools/manifest.d.ts +18 -0
- package/dist/external-tools/manifest.js +1 -1
- package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
- package/dist/external-tools/opengrep/asset-names.js +5 -2
- package/dist/external-tools/opengrep/from-download.d.ts +1 -1
- package/dist/external-tools/opengrep/from-download.js +5 -2
- package/dist/external-tools/opengrep/resolve.d.ts +3 -3
- package/dist/external-tools/opengrep/resolve.js +16 -8
- package/dist/external-tools/python/asset-names.d.ts +1 -1
- package/dist/external-tools/python/asset-names.js +10 -3
- package/dist/external-tools/python/dlx.d.ts +3 -3
- package/dist/external-tools/python/dlx.js +20 -9
- package/dist/external-tools/python/from-download.d.ts +1 -1
- package/dist/external-tools/python/from-download.js +12 -5
- package/dist/external-tools/python/pin.js +6 -3
- package/dist/external-tools/python/pip-install.js +6 -3
- package/dist/external-tools/python/resolve.d.ts +3 -3
- package/dist/external-tools/python/resolve.js +19 -11
- package/dist/external-tools/sbt/asset-names.d.ts +1 -1
- package/dist/external-tools/sbt/asset-names.js +5 -2
- package/dist/external-tools/sbt/from-download.d.ts +1 -1
- package/dist/external-tools/sbt/from-download.js +5 -2
- package/dist/external-tools/sbt/resolve.d.ts +3 -3
- package/dist/external-tools/sbt/resolve.js +16 -8
- package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.js +10 -3
- package/dist/external-tools/skillspector/resolve.d.ts +2 -2
- package/dist/external-tools/skillspector/resolve.js +14 -6
- package/dist/external-tools/synp/asset-names.d.ts +1 -1
- package/dist/external-tools/synp/asset-names.js +6 -2
- package/dist/external-tools/synp/from-download.d.ts +1 -1
- package/dist/external-tools/synp/from-download.js +5 -2
- package/dist/external-tools/synp/resolve.d.ts +3 -3
- package/dist/external-tools/synp/resolve.js +16 -8
- package/dist/external-tools/trivy/asset-names.d.ts +1 -1
- package/dist/external-tools/trivy/asset-names.js +5 -2
- package/dist/external-tools/trivy/from-download.d.ts +1 -1
- package/dist/external-tools/trivy/from-download.js +7 -4
- package/dist/external-tools/trivy/resolve.d.ts +3 -3
- package/dist/external-tools/trivy/resolve.js +16 -8
- package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
- package/dist/external-tools/trufflehog/asset-names.js +5 -2
- package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
- package/dist/external-tools/trufflehog/from-download.js +7 -4
- package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
- package/dist/external-tools/trufflehog/resolve.js +16 -8
- package/dist/fs/allowed-dirs-cache.d.ts +27 -1
- package/dist/fs/allowed-dirs-cache.js +38 -3
- package/dist/fs/find.js +1 -1
- package/dist/fs/read-json-cache.d.ts +7 -0
- package/dist/fs/resolve-module.js +6 -2
- package/dist/fs/safe.js +1 -1
- package/dist/git/_internal.js +2 -2
- package/dist/git/repo.js +2 -4
- package/dist/git/staged.js +8 -0
- package/dist/git/tracked.d.ts +84 -0
- package/dist/git/tracked.js +163 -0
- package/dist/git/unstaged.js +8 -0
- package/dist/github/refs-graphql.js +4 -0
- package/dist/github/refs-rest.js +4 -0
- package/dist/github/refs.js +15 -10
- package/dist/globs/_internal.js +1 -1
- package/dist/globs/match.js +9 -1
- package/dist/globs/matcher.js +5 -1
- package/dist/http-request/browser.js +6 -2
- package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
- package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
- package/dist/http-request/headers.js +1 -1
- package/dist/http-request/request-attempt.js +2 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/integrity.d.ts +10 -4
- package/dist/integrity.js +10 -4
- package/dist/json/edit.js +38 -30
- package/dist/json/format.js +1 -1
- package/dist/native-messaging/install.d.ts +1 -1
- package/dist/native-messaging/install.js +7 -4
- package/dist/native-messaging/rate-limit.d.ts +7 -0
- package/dist/native-messaging/rate-limit.js +4 -0
- package/dist/node/async-hooks.js +1 -1
- package/dist/node/child-process.js +1 -1
- package/dist/node/crypto.js +1 -1
- package/dist/node/events.js +1 -1
- package/dist/node/fs-promises.js +1 -1
- package/dist/node/fs.d.ts +22 -6
- package/dist/node/fs.js +16 -3
- package/dist/node/http.js +1 -1
- package/dist/node/https.js +1 -1
- package/dist/node/module.js +1 -1
- package/dist/node/os.d.ts +10 -2
- package/dist/node/os.js +11 -4
- package/dist/node/path.d.ts +11 -2
- package/dist/node/path.js +17 -4
- package/dist/node/timers-promises.js +1 -1
- package/dist/node/url.js +1 -1
- package/dist/node/util.js +1 -1
- package/dist/objects/getters.js +1 -1
- package/dist/objects/mutate.js +2 -2
- package/dist/objects/predicates.js +1 -1
- package/dist/packages/edit-class.d.ts +2 -3
- package/dist/packages/edit-class.js +41 -35
- package/dist/packages/exports.js +4 -4
- package/dist/packages/fetch.js +1 -1
- package/dist/packages/isolation.js +1 -1
- package/dist/packages/licenses.js +2 -2
- package/dist/packages/manifest.js +4 -4
- package/dist/packages/normalize.js +1 -1
- package/dist/packages/provenance.js +2 -2
- package/dist/packages/specs.js +1 -1
- package/dist/packages/tarball.js +4 -2
- package/dist/packages/types.d.ts +1 -2
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/resolve.js +14 -19
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/socket.d.ts +74 -111
- package/dist/paths/socket.js +99 -132
- package/dist/primordials/process.d.ts +88 -0
- package/dist/primordials/process.js +132 -0
- package/dist/primordials/uncurry.d.ts +1 -2
- package/dist/process/spawn/child.js +8 -2
- package/dist/process/spawn/errors.js +1 -1
- package/dist/regexps/spec.js +1 -1
- package/dist/releases/github-archives.js +1 -1
- package/dist/releases/github-listing.d.ts +1 -2
- package/dist/schema/types.d.ts +3 -4
- package/dist/schema/validate.js +1 -1
- package/dist/secrets/find.d.ts +2 -2
- package/dist/secrets/find.js +10 -4
- package/dist/secrets/keychain.d.ts +1 -1
- package/dist/secrets/linux.js +32 -44
- package/dist/secrets/macos.d.ts +1 -2
- package/dist/secrets/macos.js +20 -29
- package/dist/secrets/rc.d.ts +2 -2
- package/dist/secrets/rc.js +21 -13
- package/dist/secrets/socket-api-token.js +8 -0
- package/dist/secrets/windows.js +27 -33
- package/dist/shell/parse.d.ts +32 -0
- package/dist/shell/parse.js +60 -0
- package/dist/spinner/create-spinner-class.js +2 -2
- package/dist/spinner/spinner-internals.d.ts +1 -1
- package/dist/spinner/spinner-internals.js +9 -5
- package/dist/spinner/spinner.d.ts +4 -0
- package/dist/spinner/spinner.js +1 -1
- package/dist/stdio/progress.js +5 -1
- package/dist/stdio/prompts.d.ts +2 -2
- package/dist/stdio/prompts.js +1 -1
- package/dist/temporal/instant.js +2 -2
- package/dist/url/assert-safe.d.ts +29 -0
- package/dist/url/assert-safe.js +54 -0
- package/dist/url/predicates.d.ts +31 -1
- package/dist/url/predicates.js +42 -1
- package/dist/url/types.d.ts +4 -0
- package/package.json +177 -115
package/dist/json/edit.js
CHANGED
|
@@ -33,21 +33,21 @@ let editableJsonClass;
|
|
|
33
33
|
*/
|
|
34
34
|
function getEditableJsonClass() {
|
|
35
35
|
if (editableJsonClass === void 0) editableJsonClass = class EditableJson {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
canSave = true;
|
|
37
|
+
contentData = {};
|
|
38
|
+
pathValue = void 0;
|
|
39
|
+
readFileContent = "";
|
|
40
|
+
readFileJson = void 0;
|
|
41
41
|
get content() {
|
|
42
|
-
return this.
|
|
42
|
+
return this.contentData;
|
|
43
43
|
}
|
|
44
44
|
get filename() {
|
|
45
|
-
const path = this.
|
|
45
|
+
const path = this.pathValue;
|
|
46
46
|
if (!path) return "";
|
|
47
47
|
return path;
|
|
48
48
|
}
|
|
49
49
|
get path() {
|
|
50
|
-
return this.
|
|
50
|
+
return this.pathValue;
|
|
51
51
|
}
|
|
52
52
|
static async create(path, opts = { __proto__: null }) {
|
|
53
53
|
const instance = new EditableJson();
|
|
@@ -66,14 +66,14 @@ function getEditableJsonClass() {
|
|
|
66
66
|
/* c8 ignore stop */
|
|
67
67
|
}
|
|
68
68
|
create(path) {
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
69
|
+
this.pathValue = path;
|
|
70
|
+
this.contentData = {};
|
|
71
|
+
this.canSave = true;
|
|
72
72
|
return this;
|
|
73
73
|
}
|
|
74
74
|
fromContent(data) {
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
75
|
+
this.contentData = data;
|
|
76
|
+
this.canSave = false;
|
|
77
77
|
return this;
|
|
78
78
|
}
|
|
79
79
|
fromJSON(data) {
|
|
@@ -82,46 +82,54 @@ function getEditableJsonClass() {
|
|
|
82
82
|
const newline = require_json_format.detectNewline(data);
|
|
83
83
|
parsed[identSymbol] = indent;
|
|
84
84
|
parsed[newlineSymbol] = newline;
|
|
85
|
-
this.
|
|
85
|
+
this.contentData = parsed;
|
|
86
86
|
return this;
|
|
87
87
|
}
|
|
88
88
|
async load(path) {
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
this.fromJSON(this.
|
|
92
|
-
this.
|
|
89
|
+
this.pathValue = path;
|
|
90
|
+
this.readFileContent = await readFile(this.filename);
|
|
91
|
+
this.fromJSON(this.readFileContent);
|
|
92
|
+
this.readFileJson = require_primordials_json.JSONParse(this.readFileContent);
|
|
93
93
|
return this;
|
|
94
94
|
}
|
|
95
95
|
async save(options) {
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
options = {
|
|
97
|
+
__proto__: null,
|
|
98
|
+
...options
|
|
99
|
+
};
|
|
100
|
+
if (!this.canSave || this.content === void 0) throw new require_primordials_error.ErrorCtor("No file path to save to");
|
|
101
|
+
if (!require_json_format.shouldSave(this.content, this.readFileJson, this.readFileContent, options)) return false;
|
|
98
102
|
const content = require_json_format.stripFormattingSymbols(this.content);
|
|
99
103
|
const fileContent = require_json_format.stringifyWithFormatting(options?.sort ? require_json_format.sortKeys(content) : content, require_json_format.getFormattingFromContent(this.content));
|
|
100
104
|
await retryWrite(this.filename, fileContent);
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
105
|
+
this.readFileContent = fileContent;
|
|
106
|
+
this.readFileJson = require_primordials_json.JSONParse(fileContent);
|
|
103
107
|
return true;
|
|
104
108
|
}
|
|
105
109
|
saveSync(options) {
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
options = {
|
|
111
|
+
__proto__: null,
|
|
112
|
+
...options
|
|
113
|
+
};
|
|
114
|
+
if (!this.canSave || this.content === void 0) throw new require_primordials_error.ErrorCtor("No file path to save to");
|
|
115
|
+
if (!require_json_format.shouldSave(this.content, this.readFileJson, this.readFileContent, options)) return false;
|
|
108
116
|
const content = require_json_format.stripFormattingSymbols(this.content);
|
|
109
117
|
const fileContent = require_json_format.stringifyWithFormatting(options?.sort ? require_json_format.sortKeys(content) : content, require_json_format.getFormattingFromContent(this.content));
|
|
110
118
|
require_node_fs.getNodeFs().writeFileSync(this.filename, fileContent);
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
119
|
+
this.readFileContent = fileContent;
|
|
120
|
+
this.readFileJson = require_primordials_json.JSONParse(fileContent);
|
|
113
121
|
return true;
|
|
114
122
|
}
|
|
115
123
|
update(content) {
|
|
116
|
-
this.
|
|
117
|
-
...this.
|
|
124
|
+
this.contentData = {
|
|
125
|
+
...this.contentData,
|
|
118
126
|
...content
|
|
119
127
|
};
|
|
120
128
|
return this;
|
|
121
129
|
}
|
|
122
130
|
willSave(options) {
|
|
123
|
-
if (!this.
|
|
124
|
-
return require_json_format.shouldSave(this.content, this.
|
|
131
|
+
if (!this.canSave || this.content === void 0) return false;
|
|
132
|
+
return require_json_format.shouldSave(this.content, this.readFileJson, this.readFileContent, options);
|
|
125
133
|
}
|
|
126
134
|
};
|
|
127
135
|
return editableJsonClass;
|
package/dist/json/format.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_primordials_json = require('../primordials/json.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_json = require('../primordials/json.js');
|
|
6
6
|
|
|
7
7
|
//#region src/json/format.ts
|
|
8
8
|
/**
|
|
@@ -53,7 +53,7 @@ export interface InstallResult {
|
|
|
53
53
|
export declare function assertNodeStripTypesSupported(): void;
|
|
54
54
|
export declare function buildManifest(wrapperPath: string, allowedOrigins: string[]): object;
|
|
55
55
|
export declare function chromeManifestDirs(): string[];
|
|
56
|
-
export declare function installNativeHost(
|
|
56
|
+
export declare function installNativeHost(options: InstallOptions): InstallResult;
|
|
57
57
|
export declare function registerWindows(manifestPath: string): void;
|
|
58
58
|
export declare function stripTypesFlag(): string;
|
|
59
59
|
export declare function writeWrapperPosix(wrapperPath: string): void;
|
|
@@ -9,11 +9,11 @@ const require_env_windows = require('../env/windows.js');
|
|
|
9
9
|
const require_constants_node = require('../constants/node.js');
|
|
10
10
|
const require_env_node_version_managers = require('../env/node-version-managers.js');
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
|
+
let node_process = require("node:process");
|
|
13
|
+
node_process = require_runtime.__toESM(node_process);
|
|
12
14
|
let node_path = require("node:path");
|
|
13
15
|
node_path = require_runtime.__toESM(node_path);
|
|
14
16
|
let node_url = require("node:url");
|
|
15
|
-
let node_process = require("node:process");
|
|
16
|
-
node_process = require_runtime.__toESM(node_process);
|
|
17
17
|
let _socketsecurity_lib_stable_process_spawn_child = require("@socketsecurity/lib-stable/process/spawn/child");
|
|
18
18
|
|
|
19
19
|
//#region src/native-messaging/install.ts
|
|
@@ -78,9 +78,12 @@ function chromeManifestDirs() {
|
|
|
78
78
|
const config = node_process.default.env["XDG_CONFIG_HOME"] ?? node_path.default.join(home, ".config");
|
|
79
79
|
return [node_path.default.join(config, "google-chrome", "NativeMessagingHosts"), node_path.default.join(config, "chromium", "NativeMessagingHosts")];
|
|
80
80
|
}
|
|
81
|
-
function installNativeHost(
|
|
81
|
+
function installNativeHost(options) {
|
|
82
82
|
assertNodeStripTypesSupported();
|
|
83
|
-
const { allowedOrigins, production = false, wrapperDir = __dirname$1 } =
|
|
83
|
+
const { allowedOrigins, production = false, wrapperDir = __dirname$1 } = {
|
|
84
|
+
__proto__: null,
|
|
85
|
+
...options
|
|
86
|
+
};
|
|
84
87
|
if (production && allowedOrigins.includes("*")) throw new require_primordials_error.ErrorCtor("production mode rejects allowedOrigins '*' — pin to specific chrome-extension://<id>/ origins");
|
|
85
88
|
if (allowedOrigins.length === 0) throw new require_primordials_error.ErrorCtor("allowedOrigins must contain at least one origin; pass ['*'] for development");
|
|
86
89
|
const wrapperName = require_constants_platform.WIN32 ? `${HOST_NAME}.cmd` : `${HOST_NAME}.sh`;
|
|
@@ -38,6 +38,13 @@ export interface TokenBucketOptions {
|
|
|
38
38
|
*/
|
|
39
39
|
maxKeys: number;
|
|
40
40
|
}
|
|
41
|
+
export interface BucketEntry {
|
|
42
|
+
tokens: number;
|
|
43
|
+
lastRefillAt: number;
|
|
44
|
+
newer: BucketEntry | undefined;
|
|
45
|
+
older: BucketEntry | undefined;
|
|
46
|
+
key: string;
|
|
47
|
+
}
|
|
41
48
|
export declare class TokenBucketLimiter {
|
|
42
49
|
#private;
|
|
43
50
|
constructor(options: TokenBucketOptions);
|
|
@@ -31,6 +31,10 @@ var TokenBucketLimiter = class {
|
|
|
31
31
|
#newest = void 0;
|
|
32
32
|
#oldest = void 0;
|
|
33
33
|
constructor(options) {
|
|
34
|
+
options = {
|
|
35
|
+
__proto__: null,
|
|
36
|
+
...options
|
|
37
|
+
};
|
|
34
38
|
if (options.capacity < 1) throw new require_primordials_error.ErrorCtor("capacity must be >= 1");
|
|
35
39
|
if (options.refillIntervalMs <= 0) throw new require_primordials_error.ErrorCtor("refillIntervalMs must be > 0");
|
|
36
40
|
if (options.maxKeys < 1) throw new require_primordials_error.ErrorCtor("maxKeys must be >= 1");
|
package/dist/node/async-hooks.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let asyncHooks;
|
|
8
8
|
function getNodeAsyncHooks() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return asyncHooks ??= /*@__PURE__*/ require("
|
|
10
|
+
return asyncHooks ??= /*@__PURE__*/ require("async_hooks");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let childProcess;
|
|
8
8
|
function getNodeChildProcess() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return childProcess ??= /*@__PURE__*/ require("
|
|
10
|
+
return childProcess ??= /*@__PURE__*/ require("child_process");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/crypto.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let crypto;
|
|
8
8
|
function getNodeCrypto() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return crypto ??= /*@__PURE__*/ require("
|
|
10
|
+
return crypto ??= /*@__PURE__*/ require("crypto");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/events.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let events;
|
|
8
8
|
function getNodeEvents() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return events ??= /*@__PURE__*/ require("
|
|
10
|
+
return events ??= /*@__PURE__*/ require("events");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/fs-promises.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let fsPromises;
|
|
8
8
|
function getNodeFsPromises() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return fsPromises ??= /*@__PURE__*/ require("
|
|
10
|
+
return fsPromises ??= /*@__PURE__*/ require("fs/promises");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/fs.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @file Early-snapshot accessor for `node:fs`. The `require('fs')` runs at
|
|
3
|
+
* module load, but ONLY inside the `IS_NODE` runtime guard — in a browser
|
|
4
|
+
* `IS_NODE` is `false`, so the require branch never executes (bundlers mark
|
|
5
|
+
* `node:` builtins external, so the call survives in the output but is
|
|
6
|
+
* unreachable at runtime). In Node the module is captured at load: a
|
|
7
|
+
* primordial-style snapshot, so a later tamper of the `node:fs` cache entry
|
|
8
|
+
* can't redirect what we already hold. `getNodeFs()` returns the captured
|
|
9
|
+
* reference; the `/*@__PURE__*\/` lets a Node-targeted minifier strip the
|
|
10
|
+
* capture when `getNodeFs` is unused. Was a lazy first-call loader; the
|
|
11
|
+
* eager-but-guarded form keeps the browser-safe behavior while gaining the
|
|
12
|
+
* load-time snapshot. Two surfaces: `getNodeFs()` returns the module object
|
|
13
|
+
* with LATE method lookup (spy-able — the test seam); the `fs<Method>` consts
|
|
14
|
+
* (`fsExistsSync`, `fsReadFileSync`, …) are method references FROZEN at load
|
|
15
|
+
* (tamper-proof against a method swap, not spy-able), for the fleet's hot fs
|
|
16
|
+
* calls. Both stay browser-safe behind IS_NODE + `/*@__PURE__*\/`.
|
|
8
17
|
*/
|
|
9
18
|
import type * as NodeFs from 'node:fs';
|
|
10
19
|
export declare function getNodeFs(): typeof NodeFs;
|
|
20
|
+
export declare const fsAccessSync: any;
|
|
21
|
+
export declare const fsExistsSync: any;
|
|
22
|
+
export declare const fsMkdirSync: any;
|
|
23
|
+
export declare const fsReadFileSync: any;
|
|
24
|
+
export declare const fsRealpathSync: any;
|
|
25
|
+
export declare const fsStatSync: any;
|
|
26
|
+
export declare const fsWriteFileSync: any;
|
package/dist/node/fs.js
CHANGED
|
@@ -4,11 +4,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
|
|
6
6
|
//#region src/node/fs.ts
|
|
7
|
-
|
|
7
|
+
const nodeFs = require_constants_runtime.IS_NODE ? /*@__PURE__*/ require("fs") : void 0;
|
|
8
8
|
function getNodeFs() {
|
|
9
|
-
|
|
10
|
-
return cachedFs ??= /*@__PURE__*/ require("node:fs");
|
|
9
|
+
return nodeFs;
|
|
11
10
|
}
|
|
11
|
+
const fsAccessSync = nodeFs?.accessSync;
|
|
12
|
+
const fsExistsSync = nodeFs?.existsSync;
|
|
13
|
+
const fsMkdirSync = nodeFs?.mkdirSync;
|
|
14
|
+
const fsReadFileSync = nodeFs?.readFileSync;
|
|
15
|
+
const fsRealpathSync = nodeFs?.realpathSync;
|
|
16
|
+
const fsStatSync = nodeFs?.statSync;
|
|
17
|
+
const fsWriteFileSync = nodeFs?.writeFileSync;
|
|
12
18
|
|
|
13
19
|
//#endregion
|
|
20
|
+
exports.fsAccessSync = fsAccessSync;
|
|
21
|
+
exports.fsExistsSync = fsExistsSync;
|
|
22
|
+
exports.fsMkdirSync = fsMkdirSync;
|
|
23
|
+
exports.fsReadFileSync = fsReadFileSync;
|
|
24
|
+
exports.fsRealpathSync = fsRealpathSync;
|
|
25
|
+
exports.fsStatSync = fsStatSync;
|
|
26
|
+
exports.fsWriteFileSync = fsWriteFileSync;
|
|
14
27
|
exports.getNodeFs = getNodeFs;
|
package/dist/node/http.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedHttp;
|
|
8
8
|
function getNodeHttp() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedHttp ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedHttp ??= /*@__PURE__*/ require("http");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/https.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedHttps;
|
|
8
8
|
function getNodeHttps() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedHttps ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedHttps ??= /*@__PURE__*/ require("https");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/module.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedModule;
|
|
8
8
|
function getNodeModule() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedModule ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedModule ??= /*@__PURE__*/ require("module");
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Lazy + cached reference to `node:module`'s `isBuiltin(name)`. First call
|
package/dist/node/os.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
2
|
+
* @file Early-snapshot accessor for `node:os`. See `node/fs.ts` for the shared
|
|
3
|
+
* rationale: the `require` runs at module load behind the runtime `IS_NODE`
|
|
4
|
+
* guard (false in browsers → never executes there), giving a load-time
|
|
5
|
+
* snapshot in Node while staying browser-safe. `getNodeOs()` returns the
|
|
6
|
+
* module object (late method lookup, spy-able); the frozen `os<Method>`
|
|
7
|
+
* snapshots below are the tamper-proof hot-path twin.
|
|
4
8
|
*/
|
|
5
9
|
import type * as NodeOs from 'node:os';
|
|
6
10
|
export declare function getNodeOs(): typeof NodeOs;
|
|
11
|
+
export declare const osArch: any;
|
|
12
|
+
export declare const osHomedir: any;
|
|
13
|
+
export declare const osPlatform: any;
|
|
14
|
+
export declare const osTmpdir: any;
|
package/dist/node/os.js
CHANGED
|
@@ -4,11 +4,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
|
|
6
6
|
//#region src/node/os.ts
|
|
7
|
-
|
|
7
|
+
const nodeOs = require_constants_runtime.IS_NODE ? /*@__PURE__*/ require("os") : void 0;
|
|
8
8
|
function getNodeOs() {
|
|
9
|
-
|
|
10
|
-
return cachedOs ??= /*@__PURE__*/ require("node:os");
|
|
9
|
+
return nodeOs;
|
|
11
10
|
}
|
|
11
|
+
const osArch = nodeOs?.arch;
|
|
12
|
+
const osHomedir = nodeOs?.homedir;
|
|
13
|
+
const osPlatform = nodeOs?.platform;
|
|
14
|
+
const osTmpdir = nodeOs?.tmpdir;
|
|
12
15
|
|
|
13
16
|
//#endregion
|
|
14
|
-
exports.getNodeOs = getNodeOs;
|
|
17
|
+
exports.getNodeOs = getNodeOs;
|
|
18
|
+
exports.osArch = osArch;
|
|
19
|
+
exports.osHomedir = osHomedir;
|
|
20
|
+
exports.osPlatform = osPlatform;
|
|
21
|
+
exports.osTmpdir = osTmpdir;
|
package/dist/node/path.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
* shared
|
|
2
|
+
* @file Early-snapshot accessor for `node:path`. See `node/fs.ts` for the
|
|
3
|
+
* shared rationale: the `require` runs at module load behind the runtime
|
|
4
|
+
* `IS_NODE` guard (false in browsers → never executes there), giving a
|
|
5
|
+
* load-time snapshot in Node while staying browser-safe.
|
|
4
6
|
*/
|
|
5
7
|
import type * as NodePath from 'node:path';
|
|
6
8
|
export declare function getNodePath(): typeof NodePath;
|
|
9
|
+
export declare const pathBasename: any;
|
|
10
|
+
export declare const pathDirname: any;
|
|
11
|
+
export declare const pathExtname: any;
|
|
12
|
+
export declare const pathIsAbsolute: any;
|
|
13
|
+
export declare const pathJoin: any;
|
|
14
|
+
export declare const pathRelative: any;
|
|
15
|
+
export declare const pathResolve: any;
|
package/dist/node/path.js
CHANGED
|
@@ -4,11 +4,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
|
|
6
6
|
//#region src/node/path.ts
|
|
7
|
-
|
|
7
|
+
const nodePath = require_constants_runtime.IS_NODE ? /*@__PURE__*/ require("path") : void 0;
|
|
8
8
|
function getNodePath() {
|
|
9
|
-
|
|
10
|
-
return cachedPath ??= /*@__PURE__*/ require("node:path");
|
|
9
|
+
return nodePath;
|
|
11
10
|
}
|
|
11
|
+
const pathBasename = nodePath?.basename;
|
|
12
|
+
const pathDirname = nodePath?.dirname;
|
|
13
|
+
const pathExtname = nodePath?.extname;
|
|
14
|
+
const pathIsAbsolute = nodePath?.isAbsolute;
|
|
15
|
+
const pathJoin = nodePath?.join;
|
|
16
|
+
const pathRelative = nodePath?.relative;
|
|
17
|
+
const pathResolve = nodePath?.resolve;
|
|
12
18
|
|
|
13
19
|
//#endregion
|
|
14
|
-
exports.getNodePath = getNodePath;
|
|
20
|
+
exports.getNodePath = getNodePath;
|
|
21
|
+
exports.pathBasename = pathBasename;
|
|
22
|
+
exports.pathDirname = pathDirname;
|
|
23
|
+
exports.pathExtname = pathExtname;
|
|
24
|
+
exports.pathIsAbsolute = pathIsAbsolute;
|
|
25
|
+
exports.pathJoin = pathJoin;
|
|
26
|
+
exports.pathRelative = pathRelative;
|
|
27
|
+
exports.pathResolve = pathResolve;
|
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let timersPromises;
|
|
8
8
|
function getNodeTimersPromises() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return timersPromises ??= /*@__PURE__*/ require("
|
|
10
|
+
return timersPromises ??= /*@__PURE__*/ require("timers/promises");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/url.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedUrl;
|
|
8
8
|
function getNodeUrl() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedUrl ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedUrl ??= /*@__PURE__*/ require("url");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/util.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedUtil;
|
|
8
8
|
function getNodeUtil() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedUtil ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedUtil ??= /*@__PURE__*/ require("util");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/objects/getters.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
6
6
|
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
7
7
|
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
8
8
|
const require_objects_sort = require('./sort.js');
|
package/dist/objects/mutate.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
-
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
6
|
-
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
7
5
|
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
8
6
|
const require_objects_predicates = require('./predicates.js');
|
|
7
|
+
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
8
|
+
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
9
9
|
|
|
10
10
|
//#region src/objects/mutate.ts
|
|
11
11
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
5
4
|
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
5
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
6
6
|
|
|
7
7
|
//#region src/objects/predicates.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file The `EditablePackageJson` class factory. Split out of
|
|
3
3
|
* `packages/edit.ts` for size hygiene. Wraps `@npmcli/package-json` with
|
|
4
|
-
* Socket-specific knobs: path tracking, a `
|
|
4
|
+
* Socket-specific knobs: path tracking, a `canSave` guard for content-only
|
|
5
5
|
* instances, async + sync save paths that honor `EditablePackageJsonOptions`
|
|
6
6
|
* formatting.
|
|
7
7
|
*
|
|
@@ -14,7 +14,7 @@ import type { EditablePackageJsonInstance } from './edit';
|
|
|
14
14
|
* class. Not exported because consumers go through
|
|
15
15
|
* `getEditablePackageJsonClass()`.
|
|
16
16
|
*/
|
|
17
|
-
interface EditablePackageJsonConstructor {
|
|
17
|
+
export interface EditablePackageJsonConstructor {
|
|
18
18
|
new (): EditablePackageJsonInstance;
|
|
19
19
|
fixSteps: unknown[];
|
|
20
20
|
normalizeSteps: unknown[];
|
|
@@ -36,4 +36,3 @@ interface EditablePackageJsonConstructor {
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
export declare function getEditablePackageJsonClass(): EditablePackageJsonConstructor;
|
|
39
|
-
export {};
|