@rubytech/create-maxy-code 0.1.545 → 0.1.546
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/package.json +1 -1
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js +11 -0
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -1
- package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +39 -0
- package/payload/platform/lib/mcp-spawn-tee/src/index.ts +12 -0
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +4 -0
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/connector/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/filesystem/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/google/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/ledger/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/storage-broker/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/voice-mirror/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +11 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.js +16 -2
- package/payload/platform/services/claude-session-manager/dist/channel-mcp.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/channel-spawn-tee.d.ts +34 -0
- package/payload/platform/services/claude-session-manager/dist/channel-spawn-tee.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/channel-spawn-tee.js +41 -0
- package/payload/platform/services/claude-session-manager/dist/channel-spawn-tee.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +26 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +11 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.js +16 -2
- package/payload/platform/services/claude-session-manager/dist/telegram-channel-mcp.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts +6 -0
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js +17 -2
- package/payload/platform/services/claude-session-manager/dist/wa-channel-mcp.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts +5 -0
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js +16 -2
- package/payload/platform/services/claude-session-manager/dist/webchat-channel-mcp.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +31 -2
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js +11 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +69 -13
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +11 -1
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/targets.js +6 -0
- package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
- package/payload/server/server.js +26 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// whole target set from `CHANNEL_TARGETS` and fans each reply to every bound
|
|
5
5
|
// target's existing gateway reply endpoint. Pure (no fs) like wa-channel-mcp.ts.
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
+
import { buildChannelSpawnTee } from './channel-spawn-tee.js';
|
|
7
8
|
export const CHANNEL_SERVER_NAME = 'channel';
|
|
8
9
|
export function buildChannelMcpServers(p) {
|
|
9
10
|
// Every target carries the same built server path (the generalized
|
|
@@ -11,11 +12,24 @@ export function buildChannelMcpServers(p) {
|
|
|
11
12
|
const anyTarget = p.targets.whatsapp ?? p.targets.webchat;
|
|
12
13
|
if (!anyTarget)
|
|
13
14
|
throw new Error('buildChannelMcpServers: empty target set');
|
|
15
|
+
// Task 2356 — the unified server is that same whatsapp-channel dist, so it is
|
|
16
|
+
// teed the same way; its own name keeps its log file distinct from the
|
|
17
|
+
// per-kind servers'.
|
|
18
|
+
const tee = buildChannelSpawnTee({
|
|
19
|
+
nodeBin: p.nodeBin,
|
|
20
|
+
platformRoot: p.platformRoot,
|
|
21
|
+
logDir: p.logDir,
|
|
22
|
+
platformPort: p.platformPort,
|
|
23
|
+
sessionId: p.sessionId,
|
|
24
|
+
serverName: CHANNEL_SERVER_NAME,
|
|
25
|
+
serverPath: anyTarget.serverPath,
|
|
26
|
+
});
|
|
14
27
|
return {
|
|
15
28
|
[CHANNEL_SERVER_NAME]: {
|
|
16
|
-
command:
|
|
17
|
-
args:
|
|
29
|
+
command: tee.command,
|
|
30
|
+
args: tee.args,
|
|
18
31
|
env: {
|
|
32
|
+
...tee.env,
|
|
19
33
|
CHANNEL_SESSION_ID: p.sessionId,
|
|
20
34
|
CHANNEL_TARGETS: JSON.stringify(p.targets),
|
|
21
35
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-mcp.js","sourceRoot":"","sources":["../src/channel-mcp.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AAEjF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"channel-mcp.js","sourceRoot":"","sources":["../src/channel-mcp.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AAEjF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAQ5C,MAAM,UAAU,sBAAsB,CAAC,CAatC;IACC,mEAAmE;IACnE,wDAAwD;IACxD,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,Q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TeeParams {
|
|
2
|
+
/** Absolute path to the node binary. On darwin the launchd server PATH
|
|
3
|
+
* excludes an nvm node, so a bare `node` fails to spawn (Task 1402); callers
|
|
4
|
+
* pass the installer-resolved NODE_BIN, exactly as they did before the tee. */
|
|
5
|
+
nodeBin: string;
|
|
6
|
+
/** Platform install root. The shim lives at
|
|
7
|
+
* `<platformRoot>/lib/mcp-spawn-tee/dist/index.js`, the same anchor every
|
|
8
|
+
* PLUGIN.md `mcp:` block uses via ${PLATFORM_ROOT}. */
|
|
9
|
+
platformRoot: string;
|
|
10
|
+
/** Brand log dir; the shim writes `mcp-<serverName>-<sessionId>.log` here. */
|
|
11
|
+
logDir: string;
|
|
12
|
+
/** Loopback platform port, so the shim can mirror its three lifecycle lines
|
|
13
|
+
* into server.log through /api/admin/log-ingest. Without it the per-session
|
|
14
|
+
* file still works and only that mirror is lost. */
|
|
15
|
+
platformPort: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
/** MCP server name; also the middle segment of the log filename. */
|
|
18
|
+
serverName: string;
|
|
19
|
+
/** Absolute path to the built channel server entrypoint (dist/server.js). */
|
|
20
|
+
serverPath: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ChannelSpawnTeeAttach {
|
|
23
|
+
command: string;
|
|
24
|
+
args: string[];
|
|
25
|
+
/** The shim's own four keys. The caller merges its channel env alongside. */
|
|
26
|
+
env: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildChannelSpawnTee(p: ChannelSpawnTeeParams): ChannelSpawnTeeAttach;
|
|
29
|
+
/** The manager unit stamps PLATFORM_PORT and `buildMcpPlaceholders` already
|
|
30
|
+
* throws without it on every single spawn (pty-spawner.ts, Task 142), so this
|
|
31
|
+
* adds no new failure mode — it keeps the read out of the pure builders while
|
|
32
|
+
* refusing to stamp an empty value the shim would silently ignore. */
|
|
33
|
+
export declare function requirePlatformPort(env?: NodeJS.ProcessEnv): string;
|
|
34
|
+
//# sourceMappingURL=channel-spawn-tee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-spawn-tee.d.ts","sourceRoot":"","sources":["../src/channel-spawn-tee.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,qBAAqB;IACpC;;oFAEgF;IAChF,OAAO,EAAE,MAAM,CAAA;IACf;;4DAEwD;IACxD,YAAY,EAAE,MAAM,CAAA;IACpB,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAA;IACd;;yDAEqD;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,CAWpF;AAED;;;uEAGuE;AACvE,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAMhF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Task 2356 — the seam that runs a channel server through `mcp-spawn-tee`.
|
|
2
|
+
//
|
|
3
|
+
// The four channel servers (whatsapp, webchat, telegram, and the unified
|
|
4
|
+
// multi-target one) are the only stdio MCP children the platform spawns that
|
|
5
|
+
// were never wired to the shim every plugin MCP rides. Their console.error
|
|
6
|
+
// output — the reframe decision, the Task 813 notification retries, a failed
|
|
7
|
+
// receipt ack — existed only in a pipe Claude Code owns, so a message that was
|
|
8
|
+
// acked and never became a turn left no trace anywhere on disk.
|
|
9
|
+
//
|
|
10
|
+
// The shim (platform/lib/mcp-spawn-tee) is run as `node <shim> <real-entry>`.
|
|
11
|
+
// It replaces process.stderr.write with a tee, imports the real entry into its
|
|
12
|
+
// OWN process (one node runtime, not two), and mirrors every stderr byte to
|
|
13
|
+
// `${LOG_DIR}/mcp-${MCP_SPAWN_TEE_NAME}-${SESSION_ID}.log`.
|
|
14
|
+
//
|
|
15
|
+
// Pure (no fs, no process.env) like the four builders that consume it: the
|
|
16
|
+
// caller supplies concrete values and writes the per-spawn mcp file.
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
export function buildChannelSpawnTee(p) {
|
|
19
|
+
return {
|
|
20
|
+
command: p.nodeBin,
|
|
21
|
+
args: [join(p.platformRoot, 'lib', 'mcp-spawn-tee', 'dist', 'index.js'), p.serverPath],
|
|
22
|
+
env: {
|
|
23
|
+
MCP_SPAWN_TEE_NAME: p.serverName,
|
|
24
|
+
LOG_DIR: p.logDir,
|
|
25
|
+
SESSION_ID: p.sessionId,
|
|
26
|
+
PLATFORM_PORT: p.platformPort,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** The manager unit stamps PLATFORM_PORT and `buildMcpPlaceholders` already
|
|
31
|
+
* throws without it on every single spawn (pty-spawner.ts, Task 142), so this
|
|
32
|
+
* adds no new failure mode — it keeps the read out of the pure builders while
|
|
33
|
+
* refusing to stamp an empty value the shim would silently ignore. */
|
|
34
|
+
export function requirePlatformPort(env = process.env) {
|
|
35
|
+
const v = env.PLATFORM_PORT;
|
|
36
|
+
if (!v) {
|
|
37
|
+
throw new Error('[claude-session-manager] PLATFORM_PORT not set — manager unit must stamp it (Task 142)');
|
|
38
|
+
}
|
|
39
|
+
return v;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=channel-spawn-tee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-spawn-tee.js","sourceRoot":"","sources":["../src/channel-spawn-tee.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,4DAA4D;AAC5D,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AA+BhC,MAAM,UAAU,oBAAoB,CAAC,CAAwB;IAC3D,OAAO;QACL,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;QACtF,GAAG,EAAE;YACH,kBAAkB,EAAE,CAAC,CAAC,UAAU;YAChC,OAAO,EAAE,CAAC,CAAC,MAAM;YACjB,UAAU,EAAE,CAAC,CAAC,SAAS;YACvB,aAAa,EAAE,CAAC,CAAC,YAAY;SAC9B;KACF,CAAA;AACH,CAAC;AAED;;;uEAGuE;AACvE,MAAM,UAAU,mBAAmB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACtE,MAAM,CAAC,GAAG,GAAG,CAAC,aAAa,CAAA;IAC3B,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAA;IAC3G,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAoB3B,OAAO,KAAK,EAAU,SAAS,EAAW,MAAM,YAAY,CAAA;AAK5D,OAAO,EA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,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,MAAM,CAER;AAkCD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe5F;AAiGD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CASvG;AAUD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,GACxB,IAAI,CA4BN;AAkED;;;kEAGkE;AAClE,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG;IAC3B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACpD;;;+CAG2C;IAC3C,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAChD,CAAA;AA8CD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAokHpD"}
|
|
@@ -23,6 +23,7 @@ import { stream } from 'hono/streaming';
|
|
|
23
23
|
import { existsSync, statSync, createReadStream, watchFile, unwatchFile, rmSync, mkdirSync, renameSync, readFileSync, writeFileSync, appendFileSync, openSync, readSync, closeSync } from 'node:fs';
|
|
24
24
|
import { tmpdir } from 'node:os';
|
|
25
25
|
import { buildWaChannelMcpServers, buildWaChannelArgv, waChannelMcpConfigPath, isDevChannelPrompt, WA_CHANNEL_SERVER_NAME } from './wa-channel-mcp.js';
|
|
26
|
+
import { requirePlatformPort } from './channel-spawn-tee.js';
|
|
26
27
|
import { parseWaChannelBody, sessionIdFieldsFor } from './public-spawn-session.js';
|
|
27
28
|
import { buildWebchatChannelMcpServers, buildWebchatChannelArgv, webchatChannelMcpConfigPath, WEBCHAT_CHANNEL_SERVER_NAME } from './webchat-channel-mcp.js';
|
|
28
29
|
import { buildTelegramChannelMcpServers, buildTelegramChannelArgv, telegramChannelMcpConfigPath, TELEGRAM_CHANNEL_SERVER_NAME } from './telegram-channel-mcp.js';
|
|
@@ -3225,7 +3226,16 @@ export function buildHttpApp(deps) {
|
|
|
3225
3226
|
// whose server is absent from this spawn.
|
|
3226
3227
|
let channelServerName = null;
|
|
3227
3228
|
if (sessionId && isMultiTarget(targetSet)) {
|
|
3228
|
-
|
|
3229
|
+
// Task 2356 — the spawn-tee inputs, so this server's stderr lands in
|
|
3230
|
+
// logs/mcp-channel-<sessionId>.log.
|
|
3231
|
+
const unifiedServers = buildChannelMcpServers({
|
|
3232
|
+
sessionId,
|
|
3233
|
+
targets: targetSet,
|
|
3234
|
+
nodeBin: deps.nodeBin,
|
|
3235
|
+
platformRoot: deps.platformRoot,
|
|
3236
|
+
logDir: deps.logDir,
|
|
3237
|
+
platformPort: requirePlatformPort(),
|
|
3238
|
+
});
|
|
3229
3239
|
const unifiedPath = channelMcpConfigPath(sessionId, tmpdir());
|
|
3230
3240
|
try {
|
|
3231
3241
|
writeFileSync(unifiedPath, JSON.stringify({ mcpServers: unifiedServers }, null, 2), 'utf8');
|
|
@@ -3250,6 +3260,11 @@ export function buildHttpApp(deps) {
|
|
|
3250
3260
|
nodeBin: deps.nodeBin,
|
|
3251
3261
|
// Task 2290 — the account the gateway keys this session's hub entry on.
|
|
3252
3262
|
accountId: effectiveAccountId,
|
|
3263
|
+
// Task 2356 — the spawn-tee inputs, so this server's stderr lands in
|
|
3264
|
+
// logs/mcp-whatsapp-channel-<sessionId>.log.
|
|
3265
|
+
platformRoot: deps.platformRoot,
|
|
3266
|
+
logDir: deps.logDir,
|
|
3267
|
+
platformPort: requirePlatformPort(),
|
|
3253
3268
|
});
|
|
3254
3269
|
waPath = waChannelMcpConfigPath(sessionId, tmpdir());
|
|
3255
3270
|
try {
|
|
@@ -3271,6 +3286,11 @@ export function buildHttpApp(deps) {
|
|
|
3271
3286
|
gatewayUrl: effectiveWebchatChannel.gatewayUrl,
|
|
3272
3287
|
serverPath: effectiveWebchatChannel.serverPath,
|
|
3273
3288
|
nodeBin: deps.nodeBin,
|
|
3289
|
+
// Task 2356 — the spawn-tee inputs, so this server's stderr lands in
|
|
3290
|
+
// logs/mcp-webchat-channel-<sessionId>.log.
|
|
3291
|
+
platformRoot: deps.platformRoot,
|
|
3292
|
+
logDir: deps.logDir,
|
|
3293
|
+
platformPort: requirePlatformPort(),
|
|
3274
3294
|
});
|
|
3275
3295
|
webchatPath = webchatChannelMcpConfigPath(sessionId, tmpdir());
|
|
3276
3296
|
try {
|
|
@@ -3299,6 +3319,11 @@ export function buildHttpApp(deps) {
|
|
|
3299
3319
|
// Task 2325 — the body role, unchanged in meaning; `?? undefined`
|
|
3300
3320
|
// only bridges null to the optional parameter this builder declares.
|
|
3301
3321
|
role: rcRole ?? undefined,
|
|
3322
|
+
// Task 2356 — the spawn-tee inputs, so this server's stderr lands in
|
|
3323
|
+
// logs/mcp-telegram-channel-<sessionId>.log.
|
|
3324
|
+
platformRoot: deps.platformRoot,
|
|
3325
|
+
logDir: deps.logDir,
|
|
3326
|
+
platformPort: requirePlatformPort(),
|
|
3302
3327
|
});
|
|
3303
3328
|
telegramPath = telegramChannelMcpConfigPath(sessionId, tmpdir());
|
|
3304
3329
|
try {
|