@kmugalkhod/lightcode 0.1.0

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 (5) hide show
  1. package/README.md +62 -0
  2. package/cli.js +13754 -0
  3. package/lightcode.cjs +52 -0
  4. package/package.json +34 -0
  5. package/server.js +7585 -0
package/lightcode.cjs ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Lightcode launcher - ensures Bun is installed before running the actual CLI.
4
+ */
5
+
6
+ const { spawnSync } = require("child_process");
7
+ const path = require("path");
8
+ const fs = require("fs");
9
+
10
+ // Check if Bun is available
11
+ try {
12
+ const result = spawnSync("bun", ["--version"], { encoding: "utf8" });
13
+ if (result.status !== 0) {
14
+ throw new Error("Bun not found");
15
+ }
16
+ const version = result.stdout.trim();
17
+ const [major, minor] = version.split(".").map(Number);
18
+ // Accept Bun >= 1.3.0
19
+ if (major < 1 || (major === 1 && minor < 3)) {
20
+ console.error("Lightcode requires Bun >= 1.3.0. Found: " + version);
21
+ console.error("Install the latest Bun from https://bun.sh");
22
+ process.exit(1);
23
+ }
24
+ } catch {
25
+ console.error("Lightcode requires Bun >= 1.3.0, which is not installed.");
26
+ console.error("Install Bun from https://bun.sh or:");
27
+ console.error(" curl -fsSL https://bun.sh/install | bash");
28
+ console.error(" # on Windows (PowerShell):");
29
+ console.error(" powershell -c \"irm bun.sh/install.ps1 | iex\"");
30
+ process.exit(1);
31
+ }
32
+
33
+ // Get the directory of this launcher and find cli.js next to it
34
+ const launcherDir = path.dirname(process.argv[1]);
35
+ const cliPath = path.join(launcherDir, "cli.js");
36
+
37
+ // Ensure cli.js exists
38
+ if (!fs.existsSync(cliPath)) {
39
+ console.error("Error: cli.js not found at " + cliPath);
40
+ process.exit(1);
41
+ }
42
+
43
+ // Exec Bun with the cli.js script using spawnSync for proper argument handling
44
+ try {
45
+ const args = process.argv.slice(2);
46
+ const result = spawnSync("bun", [cliPath, ...args], {
47
+ stdio: "inherit",
48
+ });
49
+ process.exit(result.status || 0);
50
+ } catch (error) {
51
+ process.exit(error.status || 1);
52
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@kmugalkhod/lightcode",
3
+ "version": "0.1.0",
4
+ "description": "Lightcode — a personal AI coding agent with a terminal UI and local session storage.",
5
+ "type": "module",
6
+ "bin": {
7
+ "lightcode": "./lightcode.cjs"
8
+ },
9
+ "engines": {
10
+ "bun": ">=1.3.0"
11
+ },
12
+ "files": [
13
+ "cli.js",
14
+ "lightcode.cjs",
15
+ "server.js",
16
+ "README.md"
17
+ ],
18
+ "dependencies": {
19
+ "@ai-sdk/anthropic": "3.0.77",
20
+ "@ai-sdk/openai-compatible": "2.0.48",
21
+ "@ai-sdk/react": "3.0.184",
22
+ "@hono/zod-validator": "0.8.0",
23
+ "@opentui/core": "0.4.0",
24
+ "@opentui/react": "0.4.0",
25
+ "@prisma/adapter-libsql": "^7.8.0",
26
+ "@prisma/client": "^7.8.0",
27
+ "ai": "6.0.182",
28
+ "diff": "^9.0.0",
29
+ "hono": "4.12.25",
30
+ "react": "^19.0.0",
31
+ "react-router": "^7.1.0",
32
+ "zod": "^4.4.3"
33
+ }
34
+ }