@letta-ai/letta-code 0.1.3 → 0.1.4
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/bin/letta-linux-arm64 +0 -0
- package/bin/letta-macos-arm64 +0 -0
- package/bin/letta-macos-x64 +0 -0
- package/bin/letta-windows-x64.exe +0 -0
- package/bin/letta.js +86 -0
- package/package.json +3 -3
- /package/bin/{letta → letta-linux-x64} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/letta.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Unified entry point for the Letta CLI.
|
|
5
|
+
* Detects the platform and spawns the appropriate compiled binary.
|
|
6
|
+
*
|
|
7
|
+
* Note: Uses #!/usr/bin/env node (not bun) for maximum compatibility
|
|
8
|
+
* when users install via npm/npx. Bun can still run this file.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import path from "path";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
import { spawn } from "child_process";
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = path.dirname(__filename);
|
|
17
|
+
|
|
18
|
+
const { platform, arch } = process;
|
|
19
|
+
|
|
20
|
+
// Map platform/arch to binary name
|
|
21
|
+
let binaryName = null;
|
|
22
|
+
switch (platform) {
|
|
23
|
+
case "linux":
|
|
24
|
+
switch (arch) {
|
|
25
|
+
case "x64":
|
|
26
|
+
binaryName = "letta-linux-x64";
|
|
27
|
+
break;
|
|
28
|
+
case "arm64":
|
|
29
|
+
binaryName = "letta-linux-arm64";
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case "darwin":
|
|
34
|
+
switch (arch) {
|
|
35
|
+
case "x64":
|
|
36
|
+
binaryName = "letta-macos-x64";
|
|
37
|
+
break;
|
|
38
|
+
case "arm64":
|
|
39
|
+
binaryName = "letta-macos-arm64";
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case "win32":
|
|
44
|
+
switch (arch) {
|
|
45
|
+
case "x64":
|
|
46
|
+
binaryName = "letta-windows-x64.exe";
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!binaryName) {
|
|
53
|
+
console.error(`Error: Unsupported platform: ${platform} ${arch}`);
|
|
54
|
+
console.error("Supported platforms:");
|
|
55
|
+
console.error(" - macOS: arm64, x64");
|
|
56
|
+
console.error(" - Linux: arm64, x64");
|
|
57
|
+
console.error(" - Windows: x64");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
62
|
+
|
|
63
|
+
// Spawn the binary with all arguments
|
|
64
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
65
|
+
stdio: "inherit",
|
|
66
|
+
env: process.env,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Forward signals to child process
|
|
70
|
+
function forwardSignal(signal) {
|
|
71
|
+
process.on(signal, () => {
|
|
72
|
+
child.kill(signal);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
forwardSignal("SIGINT");
|
|
77
|
+
forwardSignal("SIGTERM");
|
|
78
|
+
|
|
79
|
+
// Exit with the same code as the child process
|
|
80
|
+
child.on("exit", (code, signal) => {
|
|
81
|
+
if (signal) {
|
|
82
|
+
process.kill(process.pid, signal);
|
|
83
|
+
} else {
|
|
84
|
+
process.exit(code || 0);
|
|
85
|
+
}
|
|
86
|
+
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"letta": "bin/letta"
|
|
7
|
+
"letta": "bin/letta.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"LICENSE",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"fix": "bunx --bun @biomejs/biome@2.2.5 check --write src",
|
|
43
43
|
"dev:ui": "bun --loader:.md=text --loader:.mdx=text --loader:.txt=text run src/index.ts",
|
|
44
44
|
"build": "bun build src/index.ts --compile --loader:.md=text --loader:.mdx=text --loader:.txt=text --outfile bin/letta",
|
|
45
|
-
"prepublishOnly": "bun run build",
|
|
45
|
+
"prepublishOnly": "echo 'Binaries should be built in CI. Run bun run build for local development.'",
|
|
46
46
|
"postinstall": "bun scripts/postinstall-patches.js || true"
|
|
47
47
|
},
|
|
48
48
|
"lint-staged": {
|
|
File without changes
|