@agentchatme/claude-code 0.0.13941141111111 → 0.0.1394114111111111
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 +45 -17
- package/dist/daemon-main.js.map +1 -1
- package/dist/index.js +68 -21
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -537,7 +537,7 @@ var require_cross_spawn = __commonJS({
|
|
|
537
537
|
// src/index.ts
|
|
538
538
|
import { parseArgs } from "util";
|
|
539
539
|
|
|
540
|
-
// node_modules/.pnpm/@agentchatme+agent-core@0.0.
|
|
540
|
+
// node_modules/.pnpm/@agentchatme+agent-core@0.0.13131111111/node_modules/@agentchatme/agent-core/dist/chunk-VIUTA6W2.js
|
|
541
541
|
import * as fs2 from "fs";
|
|
542
542
|
import * as path2 from "path";
|
|
543
543
|
import * as fs3 from "fs";
|
|
@@ -567,7 +567,7 @@ var log = {
|
|
|
567
567
|
info: (msg) => emit("info", msg),
|
|
568
568
|
debug: (msg) => emit("debug", msg)
|
|
569
569
|
};
|
|
570
|
-
var VERSION = "0.0.
|
|
570
|
+
var VERSION = "0.0.13131111111";
|
|
571
571
|
var CODING_AGENTS_CLIENT_IDENTITY = {
|
|
572
572
|
name: "coding_agents",
|
|
573
573
|
version: VERSION
|
|
@@ -4975,7 +4975,7 @@ function alwaysOnHealth(home) {
|
|
|
4975
4975
|
return { wanted: state !== "off", healthy: state !== "down" };
|
|
4976
4976
|
}
|
|
4977
4977
|
|
|
4978
|
-
// node_modules/.pnpm/@agentchatme+agent-core@0.0.
|
|
4978
|
+
// node_modules/.pnpm/@agentchatme+agent-core@0.0.13131111111/node_modules/@agentchatme/agent-core/dist/index.js
|
|
4979
4979
|
import * as fs from "fs";
|
|
4980
4980
|
import * as path from "path";
|
|
4981
4981
|
import * as readline from "readline";
|
|
@@ -6316,7 +6316,7 @@ var HOUR2 = 60 * MIN2;
|
|
|
6316
6316
|
var DAY2 = 24 * HOUR2;
|
|
6317
6317
|
var MAX_ATTACHMENT_SIZE = 25 * 1024 * 1024;
|
|
6318
6318
|
|
|
6319
|
-
// node_modules/.pnpm/@agentchatme+agent-core@0.0.
|
|
6319
|
+
// node_modules/.pnpm/@agentchatme+agent-core@0.0.13131111111/node_modules/@agentchatme/agent-core/dist/index.js
|
|
6320
6320
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
6321
6321
|
import * as fs22 from "fs";
|
|
6322
6322
|
import * as os from "os";
|
|
@@ -7675,12 +7675,45 @@ function serviceLabel(value) {
|
|
|
7675
7675
|
}
|
|
7676
7676
|
return value;
|
|
7677
7677
|
}
|
|
7678
|
+
function transientPathEntry(value) {
|
|
7679
|
+
const normalized2 = value.replace(/\\/g, "/");
|
|
7680
|
+
return /\/node_modules\/\.bin\/?$/i.test(normalized2) || /\/node_modules\/npm\/node_modules\/@npmcli\/run-script\/lib\/node-gyp-bin\/?$/i.test(normalized2) || /\/\.[^/]+\/tmp\//i.test(normalized2);
|
|
7681
|
+
}
|
|
7682
|
+
function stableServicePath(value, nodePath = process.execPath) {
|
|
7683
|
+
const entries = [path22.dirname(nodePath), ...value.split(path22.delimiter)];
|
|
7684
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7685
|
+
const stable = [];
|
|
7686
|
+
for (const raw of entries) {
|
|
7687
|
+
const trimmed = raw.trim();
|
|
7688
|
+
if (!trimmed || transientPathEntry(trimmed)) continue;
|
|
7689
|
+
let resolved = trimmed;
|
|
7690
|
+
try {
|
|
7691
|
+
resolved = fs22.realpathSync(trimmed);
|
|
7692
|
+
} catch {
|
|
7693
|
+
}
|
|
7694
|
+
const key = process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
7695
|
+
if (seen.has(key)) continue;
|
|
7696
|
+
seen.add(key);
|
|
7697
|
+
stable.push(resolved);
|
|
7698
|
+
}
|
|
7699
|
+
return stable.join(path22.delimiter);
|
|
7700
|
+
}
|
|
7678
7701
|
function plan(opts) {
|
|
7679
7702
|
const env = {};
|
|
7680
|
-
if (process.env["PATH"])
|
|
7703
|
+
if (process.env["PATH"]) {
|
|
7704
|
+
env["PATH"] = serviceValue(
|
|
7705
|
+
"environment value",
|
|
7706
|
+
stableServicePath(process.env["PATH"])
|
|
7707
|
+
);
|
|
7708
|
+
}
|
|
7681
7709
|
for (const [k, v] of Object.entries(opts.env ?? {})) {
|
|
7682
7710
|
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(k)) throw new Error(`invalid service environment key: ${k}`);
|
|
7683
|
-
if (typeof v === "string" && v.length > 0)
|
|
7711
|
+
if (typeof v === "string" && v.length > 0) {
|
|
7712
|
+
env[k] = serviceValue(
|
|
7713
|
+
"environment value",
|
|
7714
|
+
k === "PATH" ? stableServicePath(v) : v
|
|
7715
|
+
);
|
|
7716
|
+
}
|
|
7684
7717
|
}
|
|
7685
7718
|
return {
|
|
7686
7719
|
label: serviceLabel(opts.label),
|
|
@@ -7835,8 +7868,11 @@ function uninstallLaunchd(label) {
|
|
|
7835
7868
|
log.info(`service ${launchdLabel(label)} removed`);
|
|
7836
7869
|
}
|
|
7837
7870
|
function statusLaunchd(label) {
|
|
7838
|
-
const
|
|
7839
|
-
|
|
7871
|
+
const fullLabel = launchdLabel(label);
|
|
7872
|
+
const uid = typeof process.getuid === "function" ? process.getuid() : os.userInfo().uid;
|
|
7873
|
+
const modern = run("launchctl", ["print", `gui/${uid}/${fullLabel}`]);
|
|
7874
|
+
const loaded = modern.ok || run("launchctl", ["list", fullLabel]).ok;
|
|
7875
|
+
return `launchd ${fullLabel}: ${loaded ? "loaded" : "not loaded"}`;
|
|
7840
7876
|
}
|
|
7841
7877
|
function isWslFromVersion(version) {
|
|
7842
7878
|
return /microsoft|wsl/i.test(version);
|
|
@@ -8031,10 +8067,12 @@ function serviceInstalled(opts) {
|
|
|
8031
8067
|
// src/host.ts
|
|
8032
8068
|
import * as os2 from "os";
|
|
8033
8069
|
import * as path5 from "path";
|
|
8034
|
-
function
|
|
8070
|
+
function claudeConfigOverride() {
|
|
8035
8071
|
const override = process.env["CLAUDE_CONFIG_DIR"];
|
|
8036
|
-
|
|
8037
|
-
|
|
8072
|
+
return override !== void 0 && override.trim().length > 0 ? path5.resolve(override) : void 0;
|
|
8073
|
+
}
|
|
8074
|
+
function claudeHome() {
|
|
8075
|
+
return claudeConfigOverride() ?? path5.join(os2.homedir(), ".claude");
|
|
8038
8076
|
}
|
|
8039
8077
|
function identityHome() {
|
|
8040
8078
|
return path5.join(claudeHome(), "agentchat");
|
|
@@ -8054,26 +8092,25 @@ function hostCopy() {
|
|
|
8054
8092
|
}
|
|
8055
8093
|
function serviceEnv() {
|
|
8056
8094
|
const env = {};
|
|
8057
|
-
const configDir =
|
|
8058
|
-
if (configDir !== void 0
|
|
8059
|
-
env["CLAUDE_CONFIG_DIR"] = path5.resolve(configDir);
|
|
8060
|
-
}
|
|
8095
|
+
const configDir = claudeConfigOverride();
|
|
8096
|
+
if (configDir !== void 0) env["CLAUDE_CONFIG_DIR"] = configDir;
|
|
8061
8097
|
return env;
|
|
8062
8098
|
}
|
|
8063
8099
|
|
|
8064
8100
|
// src/wiring.ts
|
|
8065
8101
|
import * as fs6 from "fs";
|
|
8066
|
-
import * as
|
|
8102
|
+
import * as os4 from "os";
|
|
8067
8103
|
import * as path7 from "path";
|
|
8068
8104
|
import { fileURLToPath } from "url";
|
|
8069
8105
|
|
|
8070
8106
|
// src/adapter.ts
|
|
8071
8107
|
import * as fs5 from "fs";
|
|
8108
|
+
import * as os3 from "os";
|
|
8072
8109
|
import * as path6 from "path";
|
|
8073
8110
|
import * as crypto from "crypto";
|
|
8074
8111
|
|
|
8075
8112
|
// src/version.ts
|
|
8076
|
-
var VERSION3 = "0.0.
|
|
8113
|
+
var VERSION3 = "0.0.1394114111111111";
|
|
8077
8114
|
|
|
8078
8115
|
// src/runtime-version.ts
|
|
8079
8116
|
var MIN_CLAUDE_CODE_VERSION = "2.1.219";
|
|
@@ -8094,13 +8131,20 @@ function semverAtLeast(actual, minimum) {
|
|
|
8094
8131
|
// src/adapter.ts
|
|
8095
8132
|
var MAX_EVENT_TAIL_CHARS = 1024 * 1024;
|
|
8096
8133
|
var AGENTCHAT_MCP_PACKAGE = "@agentchatme/mcp@0.1.1121411";
|
|
8097
|
-
function
|
|
8134
|
+
function claudeProcessEnv(configDirOverride, source = process.env) {
|
|
8135
|
+
const env = { ...source };
|
|
8136
|
+
if (configDirOverride === void 0) delete env["CLAUDE_CONFIG_DIR"];
|
|
8137
|
+
else env["CLAUDE_CONFIG_DIR"] = configDirOverride;
|
|
8138
|
+
return env;
|
|
8139
|
+
}
|
|
8140
|
+
function claudeIsLoggedIn(configDirOverride) {
|
|
8098
8141
|
const status = spawnCommandSync("claude", ["auth", "status"], {
|
|
8099
8142
|
encoding: "utf-8",
|
|
8100
8143
|
timeout: 1e4,
|
|
8101
|
-
env:
|
|
8144
|
+
env: claudeProcessEnv(configDirOverride)
|
|
8102
8145
|
});
|
|
8103
8146
|
if (!status.error && status.status === 0) return true;
|
|
8147
|
+
const configDir = configDirOverride ?? path6.join(os3.homedir(), ".claude");
|
|
8104
8148
|
if (fs5.existsSync(path6.join(configDir, ".credentials.json"))) return true;
|
|
8105
8149
|
if (process.platform !== "darwin") return false;
|
|
8106
8150
|
const keychain = spawnCommandSync(
|
|
@@ -8130,7 +8174,7 @@ function stableDaemonPath() {
|
|
|
8130
8174
|
}
|
|
8131
8175
|
function claudeUserStatePath() {
|
|
8132
8176
|
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(
|
|
8177
|
+
return override !== void 0 && override.trim().length > 0 ? path7.join(path7.resolve(override), ".claude.json") : path7.join(os4.homedir(), ".claude.json");
|
|
8134
8178
|
}
|
|
8135
8179
|
function shippedDaemonPath() {
|
|
8136
8180
|
return path7.join(path7.dirname(fileURLToPath(import.meta.url)), "daemon-main.js");
|
|
@@ -8631,6 +8675,9 @@ function installClaude(handle) {
|
|
|
8631
8675
|
warnings.push(`direct wiring could not be verified after installation (${mcp2.detail})`);
|
|
8632
8676
|
}
|
|
8633
8677
|
if (complete) {
|
|
8678
|
+
const misplacedMcp = removeMisplacedDefaultMcp();
|
|
8679
|
+
if (misplacedMcp.removed) actions.push("misplaced AgentChat MCP server removed");
|
|
8680
|
+
if (misplacedMcp.warning) warnings.push(misplacedMcp.warning);
|
|
8634
8681
|
if (handle !== null) {
|
|
8635
8682
|
writeAnchor(anchorFile(), renderClaudeAgents(handle), handle);
|
|
8636
8683
|
actions.push(`CLAUDE.md \u2190 identity + etiquette (@${handle})`);
|
|
@@ -8777,7 +8824,7 @@ function runtimeChecks() {
|
|
|
8777
8824
|
mcpRunner
|
|
8778
8825
|
];
|
|
8779
8826
|
}
|
|
8780
|
-
const authenticated = claudeIsLoggedIn(
|
|
8827
|
+
const authenticated = claudeIsLoggedIn(claudeConfigOverride());
|
|
8781
8828
|
return [
|
|
8782
8829
|
{
|
|
8783
8830
|
name: "claude-cli",
|