@alexnodeland/claude-telegram 0.2.1 → 0.3.0
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/orchestrator.ts +25 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.0] - 2026-03-22
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Project MCP server loading** — orchestrator reads the target directory's `.mcp.json` and merges project MCP servers into spawned Claude CLI sessions. Projects with MCP servers (e.g., Slack, Jira, Confluence) now work out of the box via `/new`.
|
|
13
|
+
- **Explicit setting sources** — passes `--setting-sources user,project,local` to ensure project hooks and permissions are loaded in `-p` mode.
|
|
14
|
+
- **PATH augmentation** — spawned Claude CLI processes include `/opt/homebrew/bin` in PATH, fixing MCP server startup failures when running as a launchd daemon with a restricted PATH.
|
|
15
|
+
|
|
8
16
|
## [0.2.1] - 2026-03-22
|
|
9
17
|
|
|
10
18
|
### Fixed
|
package/package.json
CHANGED
package/src/orchestrator.ts
CHANGED
|
@@ -1242,10 +1242,26 @@ async function runQuery(
|
|
|
1242
1242
|
const isResume = session.sessionId !== "pending";
|
|
1243
1243
|
const model = session.model ?? globalModel;
|
|
1244
1244
|
|
|
1245
|
-
//
|
|
1245
|
+
// Read project .mcp.json so spawned sessions get the project's MCP servers.
|
|
1246
|
+
// In -p mode the workspace trust dialog is skipped, which may prevent
|
|
1247
|
+
// .mcp.json servers from being auto-enabled. Merging them here is defensive.
|
|
1248
|
+
let projectMcpServers: Record<string, unknown> = {};
|
|
1249
|
+
try {
|
|
1250
|
+
const raw = await readFile(join(session.cwd, ".mcp.json"), "utf8");
|
|
1251
|
+
const parsed = JSON.parse(raw);
|
|
1252
|
+
if (parsed?.mcpServers && typeof parsed.mcpServers === "object") {
|
|
1253
|
+
projectMcpServers = parsed.mcpServers;
|
|
1254
|
+
}
|
|
1255
|
+
} catch {
|
|
1256
|
+
// No .mcp.json or invalid — fine, not every project has one
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
// Write temp MCP config: project servers + permission relay sidecar.
|
|
1260
|
+
// Relay is spread last so a project can't shadow it.
|
|
1246
1261
|
const mcpConfigPath = `/tmp/telegram-relay-${chatId}-${process.pid}.json`;
|
|
1247
1262
|
const mcpConfig = {
|
|
1248
1263
|
mcpServers: {
|
|
1264
|
+
...projectMcpServers,
|
|
1249
1265
|
telegram_relay: {
|
|
1250
1266
|
command: "bun",
|
|
1251
1267
|
args: ["run", RELAY_SCRIPT],
|
|
@@ -1266,6 +1282,8 @@ async function runQuery(
|
|
|
1266
1282
|
"--verbose",
|
|
1267
1283
|
"--max-turns",
|
|
1268
1284
|
String(MAX_TURNS),
|
|
1285
|
+
"--setting-sources",
|
|
1286
|
+
"user,project,local",
|
|
1269
1287
|
"--mcp-config",
|
|
1270
1288
|
mcpConfigPath,
|
|
1271
1289
|
"--permission-prompt-tool",
|
|
@@ -1295,11 +1313,16 @@ async function runQuery(
|
|
|
1295
1313
|
` prompt: ${prompt.slice(0, 80)}${prompt.length > 80 ? "…" : ""}\n`,
|
|
1296
1314
|
);
|
|
1297
1315
|
|
|
1316
|
+
// Ensure homebrew/nvm paths are available — the launchd plist PATH is minimal
|
|
1317
|
+
const extraPaths = ["/opt/homebrew/bin", "/opt/homebrew/sbin", "/usr/local/bin"];
|
|
1318
|
+
const currentPath = process.env.PATH ?? "";
|
|
1319
|
+
const mergedPath = [...extraPaths.filter((p) => !currentPath.includes(p)), currentPath].join(":");
|
|
1320
|
+
|
|
1298
1321
|
const proc = Bun.spawn(args, {
|
|
1299
1322
|
cwd: session.cwd,
|
|
1300
1323
|
stdout: "pipe",
|
|
1301
1324
|
stderr: "pipe",
|
|
1302
|
-
env: { ...process.env },
|
|
1325
|
+
env: { ...process.env, PATH: mergedPath },
|
|
1303
1326
|
});
|
|
1304
1327
|
|
|
1305
1328
|
activeProcs.set(chatId, proc);
|