@kmugalkhod/lightcode 0.1.0 → 0.1.1
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 +23 -0
- package/package.json +3 -2
- package/server.js +2 -1
package/cli.js
CHANGED
package/lightcode.cjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
const { spawnSync } = require("child_process");
|
|
7
7
|
const path = require("path");
|
|
8
8
|
const fs = require("fs");
|
|
9
|
+
const os = require("os");
|
|
9
10
|
|
|
10
11
|
// Check if Bun is available
|
|
11
12
|
try {
|
|
@@ -30,6 +31,27 @@ try {
|
|
|
30
31
|
process.exit(1);
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
// On Windows, inject system root certificates into Bun via NODE_EXTRA_CA_CERTS.
|
|
35
|
+
// Bun uses its own TLS stack and does not read the Windows certificate store,
|
|
36
|
+
// so corporate SSL proxies (which install their CA into Windows) are invisible
|
|
37
|
+
// to Bun unless we forward the certs explicitly.
|
|
38
|
+
if (process.platform === "win32" && !process.env.NODE_EXTRA_CA_CERTS) {
|
|
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;
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
// win-ca not available or failed — Bun uses its own bundled roots
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
33
55
|
// Get the directory of this launcher and find cli.js next to it
|
|
34
56
|
const launcherDir = path.dirname(process.argv[1]);
|
|
35
57
|
const cliPath = path.join(launcherDir, "cli.js");
|
|
@@ -45,6 +67,7 @@ try {
|
|
|
45
67
|
const args = process.argv.slice(2);
|
|
46
68
|
const result = spawnSync("bun", [cliPath, ...args], {
|
|
47
69
|
stdio: "inherit",
|
|
70
|
+
env: process.env,
|
|
48
71
|
});
|
|
49
72
|
process.exit(result.status || 0);
|
|
50
73
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmugalkhod/lightcode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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,6 +29,7 @@
|
|
|
29
29
|
"hono": "4.12.25",
|
|
30
30
|
"react": "^19.0.0",
|
|
31
31
|
"react-router": "^7.1.0",
|
|
32
|
-
"zod": "^4.4.3"
|
|
32
|
+
"zod": "^4.4.3",
|
|
33
|
+
"win-ca": "^3.5.1"
|
|
33
34
|
}
|
|
34
35
|
}
|
package/server.js
CHANGED
|
@@ -5382,7 +5382,8 @@ async function validatePersistedMessages(persistedMessages) {
|
|
|
5382
5382
|
messages: hydratePersistedMessages(persistedMessages)
|
|
5383
5383
|
});
|
|
5384
5384
|
if (!validationResult.success) {
|
|
5385
|
-
|
|
5385
|
+
console.error(`Persisted chat history failed validation, starting fresh: ${validationResult.error.message}`);
|
|
5386
|
+
return [];
|
|
5386
5387
|
}
|
|
5387
5388
|
return validationResult.data;
|
|
5388
5389
|
}
|