@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.
Files changed (3) hide show
  1. package/cli.js +1 -1
  2. package/lightcode.cjs +27 -10
  3. package/package.json +2 -3
package/cli.js CHANGED
@@ -85,7 +85,7 @@ var init_logger = __esm(() => {
85
85
  });
86
86
 
87
87
  // packages/shared/src/version.ts
88
- var lightcodeVersion = "0.1.1";
88
+ var lightcodeVersion = "0.1.2";
89
89
 
90
90
  // packages/shared/src/index.ts
91
91
  var productName = "Lightcode";
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 winca = require("win-ca/api");
41
- const pems = [];
42
- winca.each({ store: ["root", "ca"], format: winca.der2.pem }, (pem) => {
43
- pems.push(pem);
44
- });
45
- if (pems.length > 0) {
46
- const tmpFile = path.join(os.tmpdir(), "lightcode-win-ca.pem");
47
- fs.writeFileSync(tmpFile, pems.join("\n"), "utf8");
48
- process.env.NODE_EXTRA_CA_CERTS = tmpFile;
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
- // win-ca not available or failed — Bun uses its own bundled roots
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.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
  }