@agentchatme/claude-code 0.0.1394114111111 → 0.0.139411411111111
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/daemon-main.js +41 -13
- package/dist/daemon-main.js.map +1 -1
- package/dist/index.js +58 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8031,10 +8031,12 @@ function serviceInstalled(opts) {
|
|
|
8031
8031
|
// src/host.ts
|
|
8032
8032
|
import * as os2 from "os";
|
|
8033
8033
|
import * as path5 from "path";
|
|
8034
|
-
function
|
|
8034
|
+
function claudeConfigOverride() {
|
|
8035
8035
|
const override = process.env["CLAUDE_CONFIG_DIR"];
|
|
8036
|
-
|
|
8037
|
-
|
|
8036
|
+
return override !== void 0 && override.trim().length > 0 ? path5.resolve(override) : void 0;
|
|
8037
|
+
}
|
|
8038
|
+
function claudeHome() {
|
|
8039
|
+
return claudeConfigOverride() ?? path5.join(os2.homedir(), ".claude");
|
|
8038
8040
|
}
|
|
8039
8041
|
function identityHome() {
|
|
8040
8042
|
return path5.join(claudeHome(), "agentchat");
|
|
@@ -8054,26 +8056,25 @@ function hostCopy() {
|
|
|
8054
8056
|
}
|
|
8055
8057
|
function serviceEnv() {
|
|
8056
8058
|
const env = {};
|
|
8057
|
-
const configDir =
|
|
8058
|
-
if (configDir !== void 0
|
|
8059
|
-
env["CLAUDE_CONFIG_DIR"] = path5.resolve(configDir);
|
|
8060
|
-
}
|
|
8059
|
+
const configDir = claudeConfigOverride();
|
|
8060
|
+
if (configDir !== void 0) env["CLAUDE_CONFIG_DIR"] = configDir;
|
|
8061
8061
|
return env;
|
|
8062
8062
|
}
|
|
8063
8063
|
|
|
8064
8064
|
// src/wiring.ts
|
|
8065
8065
|
import * as fs6 from "fs";
|
|
8066
|
-
import * as
|
|
8066
|
+
import * as os4 from "os";
|
|
8067
8067
|
import * as path7 from "path";
|
|
8068
8068
|
import { fileURLToPath } from "url";
|
|
8069
8069
|
|
|
8070
8070
|
// src/adapter.ts
|
|
8071
8071
|
import * as fs5 from "fs";
|
|
8072
|
+
import * as os3 from "os";
|
|
8072
8073
|
import * as path6 from "path";
|
|
8073
8074
|
import * as crypto from "crypto";
|
|
8074
8075
|
|
|
8075
8076
|
// src/version.ts
|
|
8076
|
-
var VERSION3 = "0.0.
|
|
8077
|
+
var VERSION3 = "0.0.139411411111111";
|
|
8077
8078
|
|
|
8078
8079
|
// src/runtime-version.ts
|
|
8079
8080
|
var MIN_CLAUDE_CODE_VERSION = "2.1.219";
|
|
@@ -8094,13 +8095,20 @@ function semverAtLeast(actual, minimum) {
|
|
|
8094
8095
|
// src/adapter.ts
|
|
8095
8096
|
var MAX_EVENT_TAIL_CHARS = 1024 * 1024;
|
|
8096
8097
|
var AGENTCHAT_MCP_PACKAGE = "@agentchatme/mcp@0.1.1121411";
|
|
8097
|
-
function
|
|
8098
|
+
function claudeProcessEnv(configDirOverride, source = process.env) {
|
|
8099
|
+
const env = { ...source };
|
|
8100
|
+
if (configDirOverride === void 0) delete env["CLAUDE_CONFIG_DIR"];
|
|
8101
|
+
else env["CLAUDE_CONFIG_DIR"] = configDirOverride;
|
|
8102
|
+
return env;
|
|
8103
|
+
}
|
|
8104
|
+
function claudeIsLoggedIn(configDirOverride) {
|
|
8098
8105
|
const status = spawnCommandSync("claude", ["auth", "status"], {
|
|
8099
8106
|
encoding: "utf-8",
|
|
8100
8107
|
timeout: 1e4,
|
|
8101
|
-
env:
|
|
8108
|
+
env: claudeProcessEnv(configDirOverride)
|
|
8102
8109
|
});
|
|
8103
8110
|
if (!status.error && status.status === 0) return true;
|
|
8111
|
+
const configDir = configDirOverride ?? path6.join(os3.homedir(), ".claude");
|
|
8104
8112
|
if (fs5.existsSync(path6.join(configDir, ".credentials.json"))) return true;
|
|
8105
8113
|
if (process.platform !== "darwin") return false;
|
|
8106
8114
|
const keychain = spawnCommandSync(
|
|
@@ -8130,7 +8138,7 @@ function stableDaemonPath() {
|
|
|
8130
8138
|
}
|
|
8131
8139
|
function claudeUserStatePath() {
|
|
8132
8140
|
const override = process.env["CLAUDE_CONFIG_DIR"];
|
|
8133
|
-
return override !== void 0 && override.trim().length > 0 ? path7.join(path7.resolve(override), ".claude.json") : path7.join(
|
|
8141
|
+
return override !== void 0 && override.trim().length > 0 ? path7.join(path7.resolve(override), ".claude.json") : path7.join(os4.homedir(), ".claude.json");
|
|
8134
8142
|
}
|
|
8135
8143
|
function shippedDaemonPath() {
|
|
8136
8144
|
return path7.join(path7.dirname(fileURLToPath(import.meta.url)), "daemon-main.js");
|
|
@@ -8266,7 +8274,13 @@ function renderClaudeAgents(handle) {
|
|
|
8266
8274
|
].join("\n");
|
|
8267
8275
|
}
|
|
8268
8276
|
function claudeEnv() {
|
|
8269
|
-
const env = { ...process.env
|
|
8277
|
+
const env = { ...process.env };
|
|
8278
|
+
const configured = process.env["CLAUDE_CONFIG_DIR"]?.trim();
|
|
8279
|
+
if (configured !== void 0 && configured.length > 0) {
|
|
8280
|
+
env["CLAUDE_CONFIG_DIR"] = path7.resolve(configured);
|
|
8281
|
+
} else {
|
|
8282
|
+
delete env["CLAUDE_CONFIG_DIR"];
|
|
8283
|
+
}
|
|
8270
8284
|
delete env["CLAUDECODE"];
|
|
8271
8285
|
return env;
|
|
8272
8286
|
}
|
|
@@ -8437,6 +8451,28 @@ function removeOwnedMcp() {
|
|
|
8437
8451
|
}
|
|
8438
8452
|
return { removed: true };
|
|
8439
8453
|
}
|
|
8454
|
+
function removeMisplacedDefaultMcp() {
|
|
8455
|
+
const configured = process.env["CLAUDE_CONFIG_DIR"]?.trim();
|
|
8456
|
+
if (configured !== void 0 && configured.length > 0) return { removed: false };
|
|
8457
|
+
const file = path7.join(claudeHome(), ".claude.json");
|
|
8458
|
+
if (!fs6.existsSync(file)) return { removed: false };
|
|
8459
|
+
try {
|
|
8460
|
+
const doc = JSON.parse(fs6.readFileSync(file, "utf-8"));
|
|
8461
|
+
const servers = doc["mcpServers"] !== null && typeof doc["mcpServers"] === "object" ? doc["mcpServers"] : null;
|
|
8462
|
+
if (servers === null || !mcpServerIsOurs(servers["agentchat"])) {
|
|
8463
|
+
return { removed: false };
|
|
8464
|
+
}
|
|
8465
|
+
delete servers["agentchat"];
|
|
8466
|
+
if (Object.keys(servers).length === 0) delete doc["mcpServers"];
|
|
8467
|
+
atomicText(file, JSON.stringify(doc, null, 2) + "\n");
|
|
8468
|
+
return { removed: true };
|
|
8469
|
+
} catch (err) {
|
|
8470
|
+
return {
|
|
8471
|
+
removed: false,
|
|
8472
|
+
warning: `could not remove the misplaced AgentChat MCP entry from ${file}: ${String(err)}`
|
|
8473
|
+
};
|
|
8474
|
+
}
|
|
8475
|
+
}
|
|
8440
8476
|
function legacyPluginAtUserScope(value, inheritedScope) {
|
|
8441
8477
|
if (Array.isArray(value)) {
|
|
8442
8478
|
return value.some((entry) => legacyPluginAtUserScope(entry, inheritedScope));
|
|
@@ -8599,9 +8635,13 @@ function installClaude(handle) {
|
|
|
8599
8635
|
}
|
|
8600
8636
|
const complete = isClaudeWired();
|
|
8601
8637
|
if (!complete) {
|
|
8602
|
-
|
|
8638
|
+
const mcp2 = inspectClaudeMcp();
|
|
8639
|
+
warnings.push(`direct wiring could not be verified after installation (${mcp2.detail})`);
|
|
8603
8640
|
}
|
|
8604
8641
|
if (complete) {
|
|
8642
|
+
const misplacedMcp = removeMisplacedDefaultMcp();
|
|
8643
|
+
if (misplacedMcp.removed) actions.push("misplaced AgentChat MCP server removed");
|
|
8644
|
+
if (misplacedMcp.warning) warnings.push(misplacedMcp.warning);
|
|
8605
8645
|
if (handle !== null) {
|
|
8606
8646
|
writeAnchor(anchorFile(), renderClaudeAgents(handle), handle);
|
|
8607
8647
|
actions.push(`CLAUDE.md \u2190 identity + etiquette (@${handle})`);
|
|
@@ -8645,6 +8685,9 @@ function removeClaudeWiring(opts = {}) {
|
|
|
8645
8685
|
const mcp = removeOwnedMcp();
|
|
8646
8686
|
if (mcp.removed) removed.push("Claude user MCP server");
|
|
8647
8687
|
if (mcp.warning) warnings.push(mcp.warning);
|
|
8688
|
+
const misplacedMcp = removeMisplacedDefaultMcp();
|
|
8689
|
+
if (misplacedMcp.removed) removed.push("misplaced AgentChat MCP server");
|
|
8690
|
+
if (misplacedMcp.warning) warnings.push(misplacedMcp.warning);
|
|
8648
8691
|
const legacy = removeLegacyUserPlugin();
|
|
8649
8692
|
if (legacy.removed) removed.push("legacy marketplace plugin");
|
|
8650
8693
|
if (legacy.warning) warnings.push(legacy.warning);
|
|
@@ -8745,7 +8788,7 @@ function runtimeChecks() {
|
|
|
8745
8788
|
mcpRunner
|
|
8746
8789
|
];
|
|
8747
8790
|
}
|
|
8748
|
-
const authenticated = claudeIsLoggedIn(
|
|
8791
|
+
const authenticated = claudeIsLoggedIn(claudeConfigOverride());
|
|
8749
8792
|
return [
|
|
8750
8793
|
{
|
|
8751
8794
|
name: "claude-cli",
|