@letta-ai/letta-code 0.10.5 → 0.11.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/dist/types/protocol.d.ts +214 -0
- package/dist/types/protocol.d.ts.map +1 -0
- package/letta.js +8523 -7220
- package/package.json +9 -2
- package/scripts/postinstall-patches.js +32 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letta-ai/letta-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
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": {
|
|
@@ -12,8 +12,15 @@
|
|
|
12
12
|
"letta.js",
|
|
13
13
|
"scripts",
|
|
14
14
|
"skills",
|
|
15
|
-
"vendor"
|
|
15
|
+
"vendor",
|
|
16
|
+
"dist/types"
|
|
16
17
|
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./letta.js",
|
|
20
|
+
"./protocol": {
|
|
21
|
+
"types": "./dist/types/protocol.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
17
24
|
"repository": {
|
|
18
25
|
"type": "git",
|
|
19
26
|
"url": "https://github.com/letta-ai/letta-code.git"
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// Postinstall patcher for vendoring our Ink modifications without patch-package.
|
|
2
2
|
// Copies patched runtime files from ./src/vendor into node_modules.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { execSync } from "node:child_process";
|
|
5
|
+
import {
|
|
6
|
+
copyFileSync,
|
|
7
|
+
existsSync,
|
|
8
|
+
mkdirSync,
|
|
9
|
+
readFileSync,
|
|
10
|
+
writeFileSync,
|
|
11
|
+
} from "node:fs";
|
|
5
12
|
import { createRequire } from "node:module";
|
|
6
13
|
import { dirname, join } from "node:path";
|
|
7
14
|
import { fileURLToPath } from "node:url";
|
|
@@ -101,3 +108,27 @@ await copyToResolved(
|
|
|
101
108
|
);
|
|
102
109
|
|
|
103
110
|
console.log("[patch] Ink runtime patched");
|
|
111
|
+
|
|
112
|
+
// On Unix with Bun available, use polyglot shebang to prefer Bun runtime.
|
|
113
|
+
// This enables Bun.secrets for secure keychain storage instead of fallback.
|
|
114
|
+
// Windows always uses #!/usr/bin/env node (polyglot shebang breaks npm wrappers).
|
|
115
|
+
if (process.platform !== "win32") {
|
|
116
|
+
try {
|
|
117
|
+
execSync("bun --version", { stdio: "ignore" });
|
|
118
|
+
const lettaPath = join(pkgRoot, "letta.js");
|
|
119
|
+
if (existsSync(lettaPath)) {
|
|
120
|
+
let content = readFileSync(lettaPath, "utf-8");
|
|
121
|
+
if (content.startsWith("#!/usr/bin/env node")) {
|
|
122
|
+
content = content.replace(
|
|
123
|
+
"#!/usr/bin/env node",
|
|
124
|
+
`#!/bin/sh
|
|
125
|
+
":" //#; exec /usr/bin/env sh -c 'command -v bun >/dev/null && exec bun "$0" "$@" || exec node "$0" "$@"' "$0" "$@"`,
|
|
126
|
+
);
|
|
127
|
+
writeFileSync(lettaPath, content);
|
|
128
|
+
console.log("[patch] Configured letta to prefer Bun runtime");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
} catch {
|
|
132
|
+
// Bun not available, keep node shebang
|
|
133
|
+
}
|
|
134
|
+
}
|