@cleocode/adapters 2026.5.49 → 2026.5.51

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/index.js CHANGED
@@ -27900,6 +27900,9 @@ import { homedir as homedir6 } from "node:os";
27900
27900
  import { dirname as dirname3, join as join7 } from "node:path";
27901
27901
  import { fileURLToPath as fileURLToPath2 } from "node:url";
27902
27902
  import { ensureProviderInstructionFile } from "@cleocode/caamp";
27903
+ function getClaudeConfigDir() {
27904
+ return process.env["CLAUDE_HOME"] ?? join7(homedir6(), ".claude");
27905
+ }
27903
27906
  function getAdapterCommandsDir() {
27904
27907
  const thisDir = dirname3(fileURLToPath2(import.meta.url));
27905
27908
  return join7(thisDir, "commands");
@@ -27958,7 +27961,7 @@ var init_install = __esm({
27958
27961
  * Checks for plugin enabled in ~/.claude/settings.json.
27959
27962
  */
27960
27963
  async isInstalled() {
27961
- const settingsPath = join7(homedir6(), ".claude", "settings.json");
27964
+ const settingsPath = join7(getClaudeConfigDir(), "settings.json");
27962
27965
  if (existsSync6(settingsPath)) {
27963
27966
  try {
27964
27967
  const settings = JSON.parse(readFileSync5(settingsPath, "utf-8"));
@@ -28014,8 +28017,8 @@ var init_install = __esm({
28014
28017
  * @returns Description of what was registered, or null if no change needed
28015
28018
  */
28016
28019
  registerPlugin() {
28017
- const home = homedir6();
28018
- const settingsPath = join7(home, ".claude", "settings.json");
28020
+ const claudeDir = getClaudeConfigDir();
28021
+ const settingsPath = join7(claudeDir, "settings.json");
28019
28022
  let settings = {};
28020
28023
  if (existsSync6(settingsPath)) {
28021
28024
  try {
@@ -28033,7 +28036,7 @@ var init_install = __esm({
28033
28036
  }
28034
28037
  enabledPlugins[pluginKey] = true;
28035
28038
  settings.enabledPlugins = enabledPlugins;
28036
- mkdirSync3(join7(home, ".claude"), { recursive: true });
28039
+ mkdirSync3(claudeDir, { recursive: true });
28037
28040
  writeFileSync3(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
28038
28041
  return `Enabled ${pluginKey} in ~/.claude/settings.json`;
28039
28042
  }
@@ -28058,8 +28061,8 @@ var init_install = __esm({
28058
28061
  * @task T1013
28059
28062
  */
28060
28063
  installHookTemplates() {
28061
- const home = homedir6();
28062
- const hooksDir = join7(home, ".claude", "hooks");
28064
+ const claudeDir = getClaudeConfigDir();
28065
+ const hooksDir = join7(claudeDir, "hooks");
28063
28066
  let templates;
28064
28067
  try {
28065
28068
  templates = installProviderHookTemplates({
@@ -28092,8 +28095,8 @@ var init_install = __esm({
28092
28095
  * @task T1013
28093
28096
  */
28094
28097
  registerPreCompactHook(shimPath) {
28095
- const home = homedir6();
28096
- const settingsPath = join7(home, ".claude", "settings.json");
28098
+ const claudeDir = getClaudeConfigDir();
28099
+ const settingsPath = join7(claudeDir, "settings.json");
28097
28100
  let settings = {};
28098
28101
  if (existsSync6(settingsPath)) {
28099
28102
  try {
@@ -28123,7 +28126,7 @@ var init_install = __esm({
28123
28126
  });
28124
28127
  hooks.PreCompact = preCompactEntries;
28125
28128
  settings.hooks = hooks;
28126
- mkdirSync3(join7(home, ".claude"), { recursive: true });
28129
+ mkdirSync3(claudeDir, { recursive: true });
28127
28130
  writeFileSync3(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
28128
28131
  return true;
28129
28132
  }