@kmugalkhod/lightcode 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/cli.js +1 -1
- package/lightcode.cjs +27 -10
- package/package.json +2 -3
package/cli.js
CHANGED
package/lightcode.cjs
CHANGED
|
@@ -37,18 +37,35 @@ try {
|
|
|
37
37
|
// to Bun unless we forward the certs explicitly.
|
|
38
38
|
if (process.platform === "win32" && !process.env.NODE_EXTRA_CA_CERTS) {
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
const tmpPem = path.join(os.tmpdir(), "lightcode-win-ca.pem");
|
|
41
|
+
const tmpPs1 = path.join(os.tmpdir(), "lightcode-win-ca.ps1");
|
|
42
|
+
const escapedPem = tmpPem.replace(/\\/g, "\\\\");
|
|
43
|
+
const script = [
|
|
44
|
+
"$pem = ''",
|
|
45
|
+
"foreach ($store in @('Root', 'CA')) {",
|
|
46
|
+
" try {",
|
|
47
|
+
" foreach ($cert in (Get-ChildItem -Path \"Cert:\\LocalMachine\\$store\" -ErrorAction Stop)) {",
|
|
48
|
+
" $b64 = [Convert]::ToBase64String($cert.RawData)",
|
|
49
|
+
" $pem += \"-----BEGIN CERTIFICATE-----\\n\"",
|
|
50
|
+
" for ($i = 0; $i -lt $b64.Length; $i += 64) {",
|
|
51
|
+
" $pem += $b64.Substring($i, [Math]::Min(64, $b64.Length - $i)) + \"\\n\"",
|
|
52
|
+
" }",
|
|
53
|
+
" $pem += \"-----END CERTIFICATE-----\\n\"",
|
|
54
|
+
" }",
|
|
55
|
+
" } catch {}",
|
|
56
|
+
"}",
|
|
57
|
+
"[IO.File]::WriteAllText('" + escapedPem + "', $pem, [Text.Encoding]::ASCII)",
|
|
58
|
+
].join("\n");
|
|
59
|
+
fs.writeFileSync(tmpPs1, script, "utf8");
|
|
60
|
+
const r = spawnSync("powershell", [
|
|
61
|
+
"-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", tmpPs1,
|
|
62
|
+
], { stdio: "pipe" });
|
|
63
|
+
try { fs.unlinkSync(tmpPs1); } catch {}
|
|
64
|
+
if (r.status === 0 && fs.existsSync(tmpPem) && fs.statSync(tmpPem).size > 0) {
|
|
65
|
+
process.env.NODE_EXTRA_CA_CERTS = tmpPem;
|
|
49
66
|
}
|
|
50
67
|
} catch {
|
|
51
|
-
//
|
|
68
|
+
// cert export failed — Bun uses its own bundled roots
|
|
52
69
|
}
|
|
53
70
|
}
|
|
54
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmugalkhod/lightcode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Lightcode — a personal AI coding agent with a terminal UI and local session storage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"hono": "4.12.25",
|
|
30
30
|
"react": "^19.0.0",
|
|
31
31
|
"react-router": "^7.1.0",
|
|
32
|
-
"zod": "^4.4.3"
|
|
33
|
-
"win-ca": "^3.5.1"
|
|
32
|
+
"zod": "^4.4.3"
|
|
34
33
|
}
|
|
35
34
|
}
|