claudemesh-cli 1.34.13 → 1.34.16

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.
@@ -81,7 +81,7 @@ __export(exports_urls, {
81
81
  VERSION: () => VERSION,
82
82
  URLS: () => URLS
83
83
  });
84
- var URLS, VERSION = "1.34.13", env;
84
+ var URLS, VERSION = "1.34.16", env;
85
85
  var init_urls = __esm(() => {
86
86
  URLS = {
87
87
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -97,13 +97,40 @@ var init_urls = __esm(() => {
97
97
  });
98
98
 
99
99
  // src/constants/paths.ts
100
+ import { existsSync } from "node:fs";
100
101
  import { homedir as homedir2 } from "node:os";
101
102
  import { join as join2 } from "node:path";
102
- var home, PATHS;
103
+ function resolveConfigDir() {
104
+ if (_resolvedConfigDir !== null)
105
+ return _resolvedConfigDir;
106
+ const envDir = process.env.CLAUDEMESH_CONFIG_DIR;
107
+ if (!envDir) {
108
+ _resolvedConfigDir = DEFAULT_CONFIG_DIR;
109
+ return DEFAULT_CONFIG_DIR;
110
+ }
111
+ if (existsSync(envDir)) {
112
+ _resolvedConfigDir = envDir;
113
+ return envDir;
114
+ }
115
+ if (!_warnedStaleEnv && process.stderr.isTTY) {
116
+ _warnedStaleEnv = true;
117
+ const unsetHint = process.env.SHELL?.endsWith("fish") ? "set -e CLAUDEMESH_CONFIG_DIR CLAUDEMESH_IPC_TOKEN_FILE" : "unset CLAUDEMESH_CONFIG_DIR CLAUDEMESH_IPC_TOKEN_FILE";
118
+ process.stderr.write(`claudemesh: ignoring stale CLAUDEMESH_CONFIG_DIR=${envDir} (no config.json there); using ${DEFAULT_CONFIG_DIR}.
119
+ ` + ` Hint: this is usually a leftover env from a previous \`claudemesh launch\`. Clean it with:
120
+ ` + ` ${unsetHint}
121
+ `);
122
+ }
123
+ _resolvedConfigDir = DEFAULT_CONFIG_DIR;
124
+ return DEFAULT_CONFIG_DIR;
125
+ }
126
+ var home, DEFAULT_CONFIG_DIR, _resolvedConfigDir = null, _warnedStaleEnv = false, PATHS;
103
127
  var init_paths2 = __esm(() => {
104
128
  home = homedir2();
129
+ DEFAULT_CONFIG_DIR = join2(home, ".claudemesh");
105
130
  PATHS = {
106
- CONFIG_DIR: process.env.CLAUDEMESH_CONFIG_DIR || join2(home, ".claudemesh"),
131
+ get CONFIG_DIR() {
132
+ return resolveConfigDir();
133
+ },
107
134
  get CONFIG_FILE() {
108
135
  return join2(this.CONFIG_DIR, "config.json");
109
136
  },
@@ -127,9 +154,9 @@ function emptyConfig() {
127
154
  }
128
155
 
129
156
  // src/services/config/read.ts
130
- import { readFileSync, existsSync } from "node:fs";
157
+ import { readFileSync, existsSync as existsSync2 } from "node:fs";
131
158
  function readConfig() {
132
- if (!existsSync(PATHS.CONFIG_FILE))
159
+ if (!existsSync2(PATHS.CONFIG_FILE))
133
160
  return emptyConfig();
134
161
  try {
135
162
  const raw = readFileSync(PATHS.CONFIG_FILE, "utf-8");
@@ -2640,7 +2667,7 @@ __export(exports_token, {
2640
2667
  TOKEN_FILE_ENV: () => TOKEN_FILE_ENV
2641
2668
  });
2642
2669
  import { randomBytes as randomBytes3 } from "node:crypto";
2643
- import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
2670
+ import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
2644
2671
  function mintSessionToken(dir, fileName = "session-token") {
2645
2672
  const token = randomBytes3(32).toString("hex");
2646
2673
  const filePath = `${dir}/${fileName}`;
@@ -2655,7 +2682,7 @@ function readSessionTokenFromEnv(env2 = process.env) {
2655
2682
  if (!path)
2656
2683
  return null;
2657
2684
  try {
2658
- if (!existsSync2(path))
2685
+ if (!existsSync3(path))
2659
2686
  return null;
2660
2687
  const raw = readFileSync2(path, "utf8").trim();
2661
2688
  if (/^[0-9a-f]{64}$/i.test(raw))
@@ -2681,12 +2708,12 @@ import {
2681
2708
  ListResourcesRequestSchema,
2682
2709
  ReadResourceRequestSchema
2683
2710
  } from "@modelcontextprotocol/sdk/types.js";
2684
- import { existsSync as existsSync3, appendFileSync } from "node:fs";
2711
+ import { existsSync as existsSync4, appendFileSync } from "node:fs";
2685
2712
  import { request as httpRequest } from "node:http";
2686
2713
  import { join as join3 } from "node:path";
2687
2714
  async function daemonReady() {
2688
2715
  for (let i = 0;i < DAEMON_BOOT_RETRIES; i++) {
2689
- if (existsSync3(DAEMON_PATHS.SOCK_FILE))
2716
+ if (existsSync4(DAEMON_PATHS.SOCK_FILE))
2690
2717
  return true;
2691
2718
  await new Promise((r) => setTimeout(r, DAEMON_BOOT_RETRY_MS));
2692
2719
  }
@@ -3310,4 +3337,4 @@ startMcpServer().catch((err) => {
3310
3337
  process.exit(1);
3311
3338
  });
3312
3339
 
3313
- //# debugId=6C369F7C2A50542164756E2164756E21
3340
+ //# debugId=3AC3E9CEB72A02F864756E2164756E21