@kmugalkhod/lightcode 0.16.0 → 0.17.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/README.md +50 -5
- package/assets/web/geist-LICENSE.txt +93 -0
- package/assets/web/geist-latin.woff2 +0 -0
- package/assets/web/index-1rsanca1.js +171 -0
- package/assets/web/index-68c606db.css +1 -0
- package/assets/web/index.html +1 -1
- package/cli.js +244 -81
- package/lightcode.cjs +21 -16
- package/package.json +5 -5
- package/server.js +304 -110
- package/assets/web/index-wma2v20c.css +0 -1
- package/assets/web/index-wzb9vzdt.js +0 -149
package/lightcode.cjs
CHANGED
|
@@ -82,30 +82,30 @@ if (!bunPath) {
|
|
|
82
82
|
// to Bun unless we forward the certs explicitly.
|
|
83
83
|
// Strategy: use PowerShell only to export raw DER .cer files; do all PEM
|
|
84
84
|
// formatting in Node.js where string/encoding handling is reliable.
|
|
85
|
-
if (process.platform === "win32" && !process.env.NODE_EXTRA_CA_CERTS) {
|
|
85
|
+
if (process.platform === "win32" && !process.env.NODE_EXTRA_CA_CERTS && !process.env.LIGHTCODE_CA_CERTS && !process.env.SSL_CERT_FILE) {
|
|
86
|
+
let exportDir;
|
|
86
87
|
try {
|
|
87
|
-
|
|
88
|
-
const cerDir =
|
|
89
|
-
const pemFile = path.join(
|
|
90
|
-
const ps1File = path.join(
|
|
91
|
-
|
|
92
|
-
if (!fs.existsSync(cerDir)) fs.mkdirSync(cerDir, { recursive: true });
|
|
93
|
-
|
|
94
|
-
// Forward slashes work in PowerShell and avoid backslash escaping issues
|
|
95
|
-
const cerDirFwd = cerDir.replace(/\\/g, "/");
|
|
88
|
+
exportDir = fs.mkdtempSync(path.join(os.tmpdir(), "lightcode-certs-"));
|
|
89
|
+
const cerDir = exportDir;
|
|
90
|
+
const pemFile = path.join(exportDir, "ca.pem");
|
|
91
|
+
const ps1File = path.join(exportDir, "export.ps1");
|
|
96
92
|
const psLines = [
|
|
97
93
|
"$i = 0",
|
|
98
|
-
'foreach ($s in @("
|
|
94
|
+
'foreach ($s in @("LocalMachine", "CurrentUser")) {',
|
|
99
95
|
' try {',
|
|
100
|
-
' foreach ($c in (Get-ChildItem "Cert
|
|
101
|
-
' Export-Certificate -Cert $c -FilePath
|
|
96
|
+
' foreach ($c in (Get-ChildItem "Cert:\\$s\\Root" -EA Stop)) {',
|
|
97
|
+
' Export-Certificate -Cert $c -FilePath (Join-Path $env:LIGHTCODE_CERT_EXPORT_DIR "$i.cer") -Type CERT -ErrorAction Stop | Out-Null',
|
|
102
98
|
' $i++',
|
|
103
99
|
' }',
|
|
104
100
|
' } catch {}',
|
|
105
101
|
'}',
|
|
106
102
|
];
|
|
107
103
|
fs.writeFileSync(ps1File, psLines.join("\n"), "utf8");
|
|
108
|
-
spawnSync("powershell", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", ps1File], {
|
|
104
|
+
const exported = spawnSync("powershell", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", ps1File], {
|
|
105
|
+
stdio: "pipe", timeout: 10000, windowsHide: true,
|
|
106
|
+
env: { ...process.env, LIGHTCODE_CERT_EXPORT_DIR: cerDir },
|
|
107
|
+
});
|
|
108
|
+
if (exported.error || exported.status !== 0) throw new Error("Certificate export failed");
|
|
109
109
|
try { fs.unlinkSync(ps1File); } catch {}
|
|
110
110
|
|
|
111
111
|
// Convert DER .cer files to PEM entirely in Node.js
|
|
@@ -123,8 +123,13 @@ if (process.platform === "win32" && !process.env.NODE_EXTRA_CA_CERTS) {
|
|
|
123
123
|
|
|
124
124
|
// Cleanup individual cert files
|
|
125
125
|
cerFiles.forEach(function(f) { try { fs.unlinkSync(path.join(cerDir, f)); } catch {} });
|
|
126
|
-
|
|
126
|
+
process.on("exit", () => {
|
|
127
|
+
try { fs.rmSync(exportDir, { recursive: true, force: true }); } catch {}
|
|
128
|
+
});
|
|
127
129
|
} catch {
|
|
130
|
+
if (exportDir) {
|
|
131
|
+
try { fs.rmSync(exportDir, { recursive: true, force: true }); } catch {}
|
|
132
|
+
}
|
|
128
133
|
// cert export failed — Bun uses its own bundled roots
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -146,7 +151,7 @@ try {
|
|
|
146
151
|
stdio: "inherit",
|
|
147
152
|
env: process.env,
|
|
148
153
|
});
|
|
149
|
-
process.exit(result.status
|
|
154
|
+
process.exit(result.status ?? 1);
|
|
150
155
|
} catch (error) {
|
|
151
156
|
process.exit(error.status || 1);
|
|
152
157
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmugalkhod/lightcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Lightcode — a local AI coding agent with terminal and browser interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@openrouter/ai-sdk-provider": "2.10.0",
|
|
39
39
|
"@opentui/core": "0.4.0",
|
|
40
40
|
"@opentui/react": "0.4.0",
|
|
41
|
-
"@prisma/adapter-libsql": "
|
|
42
|
-
"@prisma/client": "
|
|
41
|
+
"@prisma/adapter-libsql": "7.10.0",
|
|
42
|
+
"@prisma/client": "7.10.0",
|
|
43
43
|
"ai": "6.0.182",
|
|
44
44
|
"diff": "^9.0.0",
|
|
45
|
-
"hono": "4.
|
|
45
|
+
"hono": "4.13.7",
|
|
46
46
|
"react": "19.2.6",
|
|
47
|
-
"react-router": "^7.
|
|
47
|
+
"react-router": "^7.18.3",
|
|
48
48
|
"zod": "^4.4.3"
|
|
49
49
|
}
|
|
50
50
|
}
|