@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
package/package.json
CHANGED
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;;AAEH,qCAAoD;AACpD,yCAAoC;AACpC,uCAAyC;AAEzC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC;AAChE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACpC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAChD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE9B,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAE9B,sEAAsE;AACtE,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,MAAM,WAAW,GAAG,OAAO;IACzB,CAAC,CAAC,IAAA,mBAAO,EACL,OAAO,EACP,UAAU,CAAC,CAAC,CAAC,OAAO,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AO,CAAC,GAAG,UAAU,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;AAEjH,4EAA4E;AAC5E,2EAA2E;AAC3E,6CAA6C;AAC7C,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,yEAAyE;AACzE,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,gFAAgF;AAChF,MAAM,CAAC,IAAA,wBAAa,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACvD,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,WAAW,GAAG,IAAI,CAAC;IACnB,aAAa,CAAC,oBAAoB,WAAW,WAAW,WAAW,WAAW,IAAI,CAAC,SAAS,CAAC,iBAAiB,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACjI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -143,6 +143,45 @@ describe('mcp-spawn-tee in-process shim', () => {
|
|
|
143
143
|
expect(readdirSync(logDir).some((f) => /stderr-\d{4}-\d{2}-\d{2}\.log$/.test(f))).toBe(false)
|
|
144
144
|
})
|
|
145
145
|
|
|
146
|
+
// Task 2356 — the shim must be transparent to the entry's own "am I the
|
|
147
|
+
// entry module?" check. Every channel server (whatsapp, webchat, telegram)
|
|
148
|
+
// gates main() on `import.meta.url === pathToFileURL(realpath(argv[1]))`. With
|
|
149
|
+
// the shim's own path left in argv[1] that guard is false, so the server
|
|
150
|
+
// loads, connects nothing, and exits 0 — a channel that is silently dead.
|
|
151
|
+
it('presents argv as a direct `node <entry>` invocation', () => {
|
|
152
|
+
const { stub, logDir } = makeStub(
|
|
153
|
+
'process.stdout.write(JSON.stringify(process.argv.slice(1))); process.exit(0)',
|
|
154
|
+
)
|
|
155
|
+
const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'argv1', MCP_SPAWN_TEE_NAME: 'stub' })
|
|
156
|
+
expect(JSON.parse(r.stdout)).toEqual([stub])
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
it('the entry-module guard the channel servers use passes under the shim', () => {
|
|
160
|
+
const { stub, logDir } = makeStub(
|
|
161
|
+
[
|
|
162
|
+
'const { realpathSync } = require("node:fs")',
|
|
163
|
+
'const { pathToFileURL } = require("node:url")',
|
|
164
|
+
'const isEntry = process.argv[1] &&',
|
|
165
|
+
' pathToFileURL(__filename).href === pathToFileURL(realpathSync(process.argv[1])).href',
|
|
166
|
+
'process.stdout.write(isEntry ? "MAIN-RAN" : "MAIN-SKIPPED")',
|
|
167
|
+
'process.exit(0)',
|
|
168
|
+
].join('\n'),
|
|
169
|
+
)
|
|
170
|
+
const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'argv2', MCP_SPAWN_TEE_NAME: 'stub' })
|
|
171
|
+
expect(r.stdout).toBe('MAIN-RAN')
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('forwards extra CLI args to the entry, after the entry slot', () => {
|
|
175
|
+
const { stub, logDir } = makeStub(
|
|
176
|
+
'process.stdout.write(JSON.stringify(process.argv.slice(1))); process.exit(0)',
|
|
177
|
+
)
|
|
178
|
+
const r = spawnSync(process.execPath, [shim, stub, '--flag', 'value'], {
|
|
179
|
+
env: { ...process.env, SESSION_ID: 'argv3', PLATFORM_PORT: '', LOG_DIR: logDir, MCP_SPAWN_TEE_NAME: 'stub' },
|
|
180
|
+
encoding: 'utf8',
|
|
181
|
+
})
|
|
182
|
+
expect(JSON.parse(r.stdout)).toEqual([stub, '--flag', 'value'])
|
|
183
|
+
})
|
|
184
|
+
|
|
146
185
|
it('does not crash when PLATFORM_PORT is unreachable', () => {
|
|
147
186
|
const { stub, logDir } = makeStub('process.stderr.write("x\\n"); process.exit(0)')
|
|
148
187
|
const r = runSync(stub, { LOG_DIR: logDir, SESSION_ID: 'p1', MCP_SPAWN_TEE_NAME: 'stub', PLATFORM_PORT: '59999' })
|
|
@@ -189,6 +189,18 @@ process.on("exit", (code) => {
|
|
|
189
189
|
|
|
190
190
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
191
191
|
|
|
192
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
193
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
194
|
+
// standard "am I the entry module?" question
|
|
195
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
196
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
197
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
198
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
199
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
200
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
201
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
202
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
203
|
+
|
|
192
204
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
193
205
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
194
206
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -9,6 +9,10 @@ Invoked by the admin agent directly.
|
|
|
9
9
|
|
|
10
10
|
This is the platform's release timeline, newest first. Each entry shows the date it shipped and the version it shipped in, so you can tell the operator how current their install is. To compare, read the installed version from `capabilities-here` and match it against the versions below. Keep answers high level and in plain English; this is a summary, not a full commit log.
|
|
11
11
|
|
|
12
|
+
## 2026-08-02 (0.1.546)
|
|
13
|
+
|
|
14
|
+
- When the assistant notifies you on a channel, the outcome of that notification is now recorded, so a message that never arrived can be traced rather than guessed at.
|
|
15
|
+
|
|
12
16
|
## 2026-08-02 (0.1.545)
|
|
13
17
|
|
|
14
18
|
- The assistant is now instructed differently depending on whether you messaged it directly or the turn was relayed from someone outside your team, so your own standing rules no longer ride along on a relayed turn.
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -180,6 +180,17 @@ process.on("exit", (code) => {
|
|
|
180
180
|
`code=${codeField} signal=${exitSignal ?? "—"} lifetimeMs=${lifetimeMs} stderr-tail=${JSON.stringify(tail)}`, level);
|
|
181
181
|
});
|
|
182
182
|
emitLifecycle(`op=spawn session=${SESSION_ID8} server=${SERVER_NAME} pid=${process.pid} entry=${ENTRY}`, "info");
|
|
183
|
+
// Task 2356 — present argv as a direct `node <entry>` invocation before the
|
|
184
|
+
// entry loads. The shim is meant to be transparent: an entry that asks the
|
|
185
|
+
// standard "am I the entry module?" question
|
|
186
|
+
// (`import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href`)
|
|
187
|
+
// must get the same answer it gets when Claude Code runs it without the shim.
|
|
188
|
+
// With the shim's own path left in argv[1] the answer is no, so such an entry
|
|
189
|
+
// loads, starts nothing, and exits 0 — measured on the three channel servers,
|
|
190
|
+
// which all gate main() that way. Plugin MCPs connect at module top level and
|
|
191
|
+
// never read argv, so this is inert for them. ENTRY was captured above, before
|
|
192
|
+
// the rewrite. Extra CLI args keep their positions after the entry slot.
|
|
193
|
+
process.argv = [process.argv[0], ENTRY, ...process.argv.slice(3)];
|
|
183
194
|
// Run the real MCP server in THIS process. Dynamic import() (not top-level
|
|
184
195
|
// await — this file compiles to CommonJS) loads the ESM entry; a load-time
|
|
185
196
|
// failure mirrors the old child spawn-error path (op=error, exit 127). The
|
|
@@ -13,6 +13,11 @@ export declare function buildChannelMcpServers(p: {
|
|
|
13
13
|
* fails to spawn and the channel never boots (Task 1402); callers pass the
|
|
14
14
|
* installer-resolved NODE_BIN. */
|
|
15
15
|
nodeBin: string;
|
|
16
|
+
/** Task 2356 — spawn-tee inputs; see channel-spawn-tee.ts. Supplied by the
|
|
17
|
+
* caller because this module is pure. */
|
|
18
|
+
platformRoot: string;
|
|
19
|
+
logDir: string;
|
|
20
|
+
platformPort: string;
|
|
16
21
|
}): Record<string, ChannelMcpServerEntry>;
|
|
17
22
|
export declare function channelDevChannelsArgv(): string[];
|
|
18
23
|
export declare function channelMcpConfigPath(sessionId: string, dir: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-mcp.d.ts","sourceRoot":"","sources":["../src/channel-mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel-mcp.d.ts","sourceRoot":"","sources":["../src/channel-mcp.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAE5C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,gBAAgB,CAAA;IACzB;;;uCAGmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf;8CAC0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CA4BxC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhE"}
|