@letta-ai/letta-code 0.16.5 → 0.16.6

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 (2) hide show
  1. package/letta.js +18 -8
  2. package/package.json +1 -1
package/letta.js CHANGED
@@ -3122,7 +3122,7 @@ var package_default;
3122
3122
  var init_package = __esm(() => {
3123
3123
  package_default = {
3124
3124
  name: "@letta-ai/letta-code",
3125
- version: "0.16.5",
3125
+ version: "0.16.6",
3126
3126
  description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
3127
3127
  type: "module",
3128
3128
  bin: {
@@ -65310,10 +65310,19 @@ var init_checker = __esm(async () => {
65310
65310
  var exports_loader = {};
65311
65311
  __export(exports_loader, {
65312
65312
  savePermissionRule: () => savePermissionRule,
65313
- loadPermissions: () => loadPermissions
65313
+ loadPermissions: () => loadPermissions,
65314
+ getUserSettingsPaths: () => getUserSettingsPaths
65314
65315
  });
65315
65316
  import { homedir as homedir9 } from "node:os";
65316
65317
  import { join as join14 } from "node:path";
65318
+ function getUserSettingsPaths(options = {}) {
65319
+ const homeDir = options.homeDir || homedir9();
65320
+ const xdgConfigHome = options.xdgConfigHome || process.env.XDG_CONFIG_HOME || join14(homeDir, ".config");
65321
+ return {
65322
+ canonical: join14(homeDir, ".letta", "settings.json"),
65323
+ legacy: join14(xdgConfigHome, "letta", "settings.json")
65324
+ };
65325
+ }
65317
65326
  async function loadPermissions(workingDirectory = process.cwd()) {
65318
65327
  const merged = {
65319
65328
  allow: [],
@@ -65321,9 +65330,10 @@ async function loadPermissions(workingDirectory = process.cwd()) {
65321
65330
  ask: [],
65322
65331
  additionalDirectories: []
65323
65332
  };
65333
+ const { canonical: userSettingsPath, legacy: legacyUserSettingsPath } = getUserSettingsPaths();
65324
65334
  const sources = [
65325
- join14(process.env.XDG_CONFIG_HOME || join14(homedir9(), ".config"), "letta", "settings.json"),
65326
- join14(homedir9(), ".letta", "settings.json"),
65335
+ legacyUserSettingsPath,
65336
+ userSettingsPath,
65327
65337
  join14(workingDirectory, ".letta", "settings.json"),
65328
65338
  join14(workingDirectory, ".letta", "settings.local.json")
65329
65339
  ];
@@ -65370,7 +65380,7 @@ async function savePermissionRule(rule, ruleType, scope, workingDirectory = proc
65370
65380
  let settingsPath;
65371
65381
  switch (scope) {
65372
65382
  case "user":
65373
- settingsPath = join14(process.env.XDG_CONFIG_HOME || join14(homedir9(), ".config"), "letta", "settings.json");
65383
+ settingsPath = getUserSettingsPaths().canonical;
65374
65384
  break;
65375
65385
  case "project":
65376
65386
  settingsPath = join14(workingDirectory, ".letta", "settings.json");
@@ -117217,7 +117227,7 @@ BEHAVIOR
117217
117227
  - Use /profile save <name> to bookmark your current agent
117218
117228
 
117219
117229
  Profiles are stored in:
117220
- - Global: ~/.config/letta/settings.json (available everywhere)
117230
+ - Global: ~/.letta/settings.json (available everywhere)
117221
117231
  - Local: .letta/settings.local.json (pinned to project)
117222
117232
 
117223
117233
  If no credentials are configured, you'll be prompted to authenticate via
@@ -117745,7 +117755,7 @@ Error: ${message}`);
117745
117755
  console.error("Failed to connect to Letta server");
117746
117756
  console.error(`Base URL: ${baseURL}`);
117747
117757
  console.error("Your credentials may be invalid or the server may be unreachable.");
117748
- console.error("Delete ~/.config/letta/settings.json then run 'letta' to re-authenticate");
117758
+ console.error("Delete ~/.letta/settings.json then run 'letta' to re-authenticate");
117749
117759
  process.exit(1);
117750
117760
  }
117751
117761
  console.log("Failed to connect to Letta server.");
@@ -118574,4 +118584,4 @@ Error during initialization: ${message}`);
118574
118584
  }
118575
118585
  main();
118576
118586
 
118577
- //# debugId=2098C6D3E346ED8564756E2164756E21
118587
+ //# debugId=F77C42EE35B5DE0464756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.16.5",
3
+ "version": "0.16.6",
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": {