agentradar-cli 0.1.1 → 0.1.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.
- package/dist/setup.js +4 -0
- package/package.json +1 -1
package/dist/setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { lstat, readFile, realpath, rename, chmod, writeFile } from "node:fs/promises";
|
|
2
2
|
import { basename, join, resolve } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
+
import * as tls from "node:tls";
|
|
4
5
|
const DEFAULT_API_URL = "https://vendor.agentradar.com/api";
|
|
5
6
|
async function postJson(fetchImpl, url, body) {
|
|
6
7
|
return fetchImpl(url, {
|
|
@@ -109,6 +110,9 @@ async function installProjectMcp(configPath, cwd, installation, trust) {
|
|
|
109
110
|
return projectPath;
|
|
110
111
|
}
|
|
111
112
|
export async function setupVendorAgent(deps = {}) {
|
|
113
|
+
if (!deps.fetch && tls.getCACertificates && tls.setDefaultCACertificates) {
|
|
114
|
+
tls.setDefaultCACertificates([...tls.getCACertificates("default"), ...tls.getCACertificates("system")]);
|
|
115
|
+
}
|
|
112
116
|
const fetchImpl = deps.fetch ?? fetch;
|
|
113
117
|
const sleep = deps.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
114
118
|
const log = deps.log ?? console.log;
|