@nodesecure/scanner 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/class/logger.class.d.ts +11 -1
- package/dist/class/logger.class.d.ts.map +1 -1
- package/dist/class/logger.class.js +1 -0
- package/dist/class/logger.class.js.map +1 -1
- package/dist/comparePayloads.d.ts +1 -1
- package/dist/data/top-packages.json +50000 -0
- package/dist/depWalker.d.ts +2 -2
- package/dist/depWalker.js +188 -262
- package/dist/depWalker.js.map +1 -1
- package/dist/extractors/index.d.ts +2 -2
- package/dist/extractors/payload.d.ts +5 -5
- package/dist/extractors/payload.d.ts.map +1 -1
- package/dist/extractors/payload.js +1 -3
- package/dist/extractors/payload.js.map +1 -1
- package/dist/extractors/probes/ContactExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/ExtensionsExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/FlagsExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/FlagsExtractor.class.js +1 -1
- package/dist/extractors/probes/FlagsExtractor.class.js.map +1 -1
- package/dist/extractors/probes/LicensesExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/NodeDependenciesExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/SizeExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/VulnerabilitiesExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/WarningsExtractor.class.d.ts +2 -2
- package/dist/extractors/probes/index.d.ts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -73
- package/dist/index.js.map +1 -1
- package/dist/registry/NpmRegistryProvider.d.ts +6 -6
- package/dist/registry/PackumentExtractor.d.ts +1 -1
- package/dist/registry/RegistryTokenStore.d.ts +1 -1
- package/dist/registry/fetchNpmAvatars.d.ts +1 -1
- package/dist/utils/addMissingVersionFlags.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/isNodesecurePayload.d.ts +1 -1
- package/dist/utils/warnings.d.ts +1 -1
- package/package.json +15 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type ContactsResult = {
|
|
4
4
|
contacts: Record<string, number>;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type ExtensionsResult = {
|
|
4
4
|
extensions: Record<string, number>;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type FlagsResult = {
|
|
4
4
|
flags: Record<string, number>;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagsExtractor.class.js","sourceRoot":"","sources":["../../../src/extractors/probes/FlagsExtractor.class.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FlagsExtractor.class.js","sourceRoot":"","sources":["../../../src/extractors/probes/FlagsExtractor.class.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAYjD,YAAY;AACZ,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;AAEhC,MAAM,OAAO,KAAK;IAChB,KAAK,GAAG,UAAmB,CAAC;IAE5B,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;IAE5B,IAAI,CACF,CAAS,EACT,OAA0B;QAE1B,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACzB,IAAI,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;SACvC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type LicensesResult = {
|
|
4
4
|
licenses: Record<string, number>;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type NodeDependenciesResult = {
|
|
4
4
|
nodeDeps: string[];
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.
|
|
2
|
-
import type { DependencyVersion } from "../../types.
|
|
1
|
+
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.ts";
|
|
2
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
3
3
|
export type SizeResult = {
|
|
4
4
|
size: {
|
|
5
5
|
all: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StandardVulnerability } from "@nodesecure/vulnera";
|
|
2
|
-
import type { PackumentProbeExtractor } from "../payload.
|
|
3
|
-
import type { Dependency } from "../../types.
|
|
2
|
+
import type { PackumentProbeExtractor } from "../payload.ts";
|
|
3
|
+
import type { Dependency } from "../../types.ts";
|
|
4
4
|
export type VulnerabilitiesResult = {
|
|
5
5
|
vulnerabilities: StandardVulnerability[];
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Warning, WarningName } from "@nodesecure/js-x-ray";
|
|
2
|
-
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.
|
|
3
|
-
import type { DependencyVersion } from "../../types.
|
|
2
|
+
import type { ManifestProbeExtractor, ProbeExtractorManifestParent } from "../payload.ts";
|
|
3
|
+
import type { DependencyVersion } from "../../types.ts";
|
|
4
4
|
export type WarningsResult = {
|
|
5
5
|
warnings: {
|
|
6
6
|
count: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./SizeExtractor.class.
|
|
2
|
-
export * from "./LicensesExtractor.class.
|
|
3
|
-
export * from "./ContactExtractor.class.
|
|
4
|
-
export * from "./WarningsExtractor.class.
|
|
5
|
-
export * from "./VulnerabilitiesExtractor.class.
|
|
6
|
-
export * from "./FlagsExtractor.class.
|
|
7
|
-
export * from "./ExtensionsExtractor.class.
|
|
8
|
-
export * from "./NodeDependenciesExtractor.class.
|
|
1
|
+
export * from "./SizeExtractor.class.ts";
|
|
2
|
+
export * from "./LicensesExtractor.class.ts";
|
|
3
|
+
export * from "./ContactExtractor.class.ts";
|
|
4
|
+
export * from "./WarningsExtractor.class.ts";
|
|
5
|
+
export * from "./VulnerabilitiesExtractor.class.ts";
|
|
6
|
+
export * from "./FlagsExtractor.class.ts";
|
|
7
|
+
export * from "./ExtensionsExtractor.class.ts";
|
|
8
|
+
export * from "./NodeDependenciesExtractor.class.ts";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as tarball from "@nodesecure/tarball";
|
|
2
2
|
import type Config from "@npmcli/config";
|
|
3
|
-
import { depWalker } from "./depWalker.
|
|
4
|
-
import { Logger, ScannerLoggerEvents } from "./class/logger.class.
|
|
5
|
-
import { comparePayloads } from "./comparePayloads.
|
|
6
|
-
import type { Options } from "./types.
|
|
7
|
-
export * from "./types.
|
|
8
|
-
export * from "./extractors/index.
|
|
3
|
+
import { depWalker } from "./depWalker.ts";
|
|
4
|
+
import { Logger, ScannerLoggerEvents } from "./class/logger.class.ts";
|
|
5
|
+
import { comparePayloads } from "./comparePayloads.ts";
|
|
6
|
+
import type { Options } from "./types.ts";
|
|
7
|
+
export * from "./types.ts";
|
|
8
|
+
export * from "./extractors/index.ts";
|
|
9
9
|
export type CwdOptions = Options & {
|
|
10
10
|
/**
|
|
11
11
|
* NPM runtime configuration (such as local .npmrc file)
|
|
@@ -13,9 +13,9 @@ export type CwdOptions = Options & {
|
|
|
13
13
|
*/
|
|
14
14
|
npmRcConfig?: Config;
|
|
15
15
|
};
|
|
16
|
-
export declare function cwd(location?: string, options?: CwdOptions, logger?: Logger): Promise<import("./types.
|
|
16
|
+
export declare function cwd(location?: string, options?: CwdOptions, logger?: Logger): Promise<import("./types.ts").Payload>;
|
|
17
17
|
export type FromOptions = Omit<Options, "includeDevDeps">;
|
|
18
|
-
export declare function from(packageName: string, options?: FromOptions, logger?: Logger): Promise<import("./types.
|
|
18
|
+
export declare function from(packageName: string, options?: FromOptions, logger?: Logger): Promise<import("./types.ts").Payload>;
|
|
19
19
|
export declare function verify(packageName?: string): Promise<tarball.ScannedPackageResult>;
|
|
20
20
|
export { depWalker, tarball, comparePayloads, Logger, ScannerLoggerEvents };
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,55 +1,3 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
1
|
// Import Node.js Dependencies
|
|
54
2
|
import path from "node:path";
|
|
55
3
|
import fs from "node:fs/promises";
|
|
@@ -103,28 +51,16 @@ export async function from(packageName, options = {}, logger = new Logger()) {
|
|
|
103
51
|
manifest, Object.assign(options, { registry }), logger);
|
|
104
52
|
}
|
|
105
53
|
export async function verify(packageName) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (typeof packageName === "undefined") {
|
|
109
|
-
return tarball.scanPackage(process.cwd());
|
|
110
|
-
}
|
|
111
|
-
const tempDir = __addDisposableResource(env_1, await TempDirectory.create(), true);
|
|
112
|
-
const mama = await tarball.extractAndResolve(tempDir.location, {
|
|
113
|
-
spec: packageName,
|
|
114
|
-
registry: getLocalRegistryURL()
|
|
115
|
-
});
|
|
116
|
-
const scanResult = await tarball.scanPackage(mama);
|
|
117
|
-
return scanResult;
|
|
118
|
-
}
|
|
119
|
-
catch (e_1) {
|
|
120
|
-
env_1.error = e_1;
|
|
121
|
-
env_1.hasError = true;
|
|
122
|
-
}
|
|
123
|
-
finally {
|
|
124
|
-
const result_1 = __disposeResources(env_1);
|
|
125
|
-
if (result_1)
|
|
126
|
-
await result_1;
|
|
54
|
+
if (typeof packageName === "undefined") {
|
|
55
|
+
return tarball.scanPackage(process.cwd());
|
|
127
56
|
}
|
|
57
|
+
await using tempDir = await TempDirectory.create();
|
|
58
|
+
const mama = await tarball.extractAndResolve(tempDir.location, {
|
|
59
|
+
spec: packageName,
|
|
60
|
+
registry: getLocalRegistryURL()
|
|
61
|
+
});
|
|
62
|
+
const scanResult = await tarball.scanPackage(mama);
|
|
63
|
+
return scanResult;
|
|
128
64
|
}
|
|
129
65
|
export { depWalker, tarball, comparePayloads, Logger, ScannerLoggerEvents };
|
|
130
66
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as npmRegistrySDK from "@nodesecure/npm-registry-sdk";
|
|
2
2
|
import type { Packument, PackumentVersion, Signature } from "@nodesecure/npm-types";
|
|
3
|
-
import { type DateProvider } from "./PackumentExtractor.
|
|
4
|
-
import type { Dependency, DependencyConfusionWarning, TokenStore } from "../types.
|
|
5
|
-
import { Logger } from "../class/logger.class.
|
|
3
|
+
import { type DateProvider } from "./PackumentExtractor.ts";
|
|
4
|
+
import type { Dependency, DependencyConfusionWarning, TokenStore } from "../types.ts";
|
|
5
|
+
import { Logger } from "../class/logger.class.ts";
|
|
6
6
|
type PackumentNpmApiOptions = {
|
|
7
7
|
registry: string;
|
|
8
8
|
token?: string;
|
|
@@ -47,10 +47,10 @@ export declare class NpmRegistryProvider {
|
|
|
47
47
|
hasChangedAuthor: boolean;
|
|
48
48
|
hasManyPublishers: boolean;
|
|
49
49
|
hasReceivedUpdateInOneYear: boolean;
|
|
50
|
-
author: import("../types.
|
|
50
|
+
author: import("../types.ts").Maintainer | null;
|
|
51
51
|
homepage: string | null;
|
|
52
|
-
maintainers: import("../types.
|
|
53
|
-
publishers: import("../types.
|
|
52
|
+
maintainers: import("../types.ts").Maintainer[];
|
|
53
|
+
publishers: import("../types.ts").Publisher[];
|
|
54
54
|
integrity: Record<string, string>;
|
|
55
55
|
};
|
|
56
56
|
flags: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type Config from "@npmcli/config";
|
|
2
|
-
import { type TokenStore } from "../types.
|
|
2
|
+
import { type TokenStore } from "../types.ts";
|
|
3
3
|
export declare class RegistryTokenStore implements TokenStore {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(config: Config | undefined, tokenFromEnv: string | undefined);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./dirname.
|
|
2
|
-
export * from "./warnings.
|
|
3
|
-
export * from "./addMissingVersionFlags.
|
|
4
|
-
export * from "./getLinks.
|
|
5
|
-
export * from "./urlToString.
|
|
6
|
-
export * from "./getUsedDeps.
|
|
7
|
-
export * from "./isNodesecurePayload.
|
|
1
|
+
export * from "./dirname.ts";
|
|
2
|
+
export * from "./warnings.ts";
|
|
3
|
+
export * from "./addMissingVersionFlags.ts";
|
|
4
|
+
export * from "./getLinks.ts";
|
|
5
|
+
export * from "./urlToString.ts";
|
|
6
|
+
export * from "./getUsedDeps.ts";
|
|
7
|
+
export * from "./isNodesecurePayload.ts";
|
|
8
8
|
export declare const NPM_TOKEN: {
|
|
9
9
|
token: string;
|
|
10
10
|
} | {
|
package/dist/utils/warnings.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IlluminatedContact } from "@nodesecure/contact";
|
|
2
2
|
import type { Contact } from "@nodesecure/npm-types";
|
|
3
|
-
import type { Dependency, GlobalWarning } from "../types.
|
|
3
|
+
import type { Dependency, GlobalWarning } from "../types.ts";
|
|
4
4
|
export interface GetWarningsResult {
|
|
5
5
|
warnings: GlobalWarning[];
|
|
6
6
|
illuminated: IlluminatedContact[];
|
package/package.json
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodesecure/scanner",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "A package API to run a static analysis of your module's dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"exports":
|
|
7
|
-
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./extractors": {
|
|
12
|
+
"types": "./dist/extractors/index.d.ts",
|
|
13
|
+
"import": "./dist/extractors/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
8
17
|
"engines": {
|
|
9
18
|
"node": ">=20"
|
|
10
19
|
},
|
|
11
20
|
"scripts": {
|
|
12
|
-
"build": "tsc -b
|
|
21
|
+
"build": "tsc -b && cp -R ./src/data ./dist/data",
|
|
13
22
|
"lint": "eslint src test",
|
|
14
23
|
"prepublishOnly": "npm run build && pkg-ok",
|
|
15
24
|
"test": "c8 -r html npm run test-only && npm run test-types",
|
|
16
|
-
"test-only": "
|
|
25
|
+
"test-only": "node --test ./test/**/*.spec.ts",
|
|
17
26
|
"test-types": "attw --pack . --profile esm-only"
|
|
18
27
|
},
|
|
19
28
|
"files": [
|
|
@@ -59,7 +68,7 @@
|
|
|
59
68
|
"@nodesecure/npm-types": "^1.3.0",
|
|
60
69
|
"@nodesecure/rc": "^5.0.1",
|
|
61
70
|
"@nodesecure/tarball": "^2.3.0",
|
|
62
|
-
"@nodesecure/tree-walker": "^2.
|
|
71
|
+
"@nodesecure/tree-walker": "^2.1.0",
|
|
63
72
|
"@nodesecure/utils": "^2.3.0",
|
|
64
73
|
"@nodesecure/vulnera": "^2.0.1",
|
|
65
74
|
"@openally/mutex": "^2.0.0",
|
|
@@ -75,7 +84,6 @@
|
|
|
75
84
|
"@types/node": "^24.0.2",
|
|
76
85
|
"@types/npmcli__config": "^6.0.3",
|
|
77
86
|
"c8": "^10.1.3",
|
|
78
|
-
"tsx": "^4.19.4",
|
|
79
87
|
"typescript": "^5.8.3"
|
|
80
88
|
}
|
|
81
89
|
}
|