Files
zCode-CLI-X/~/.npm-cache/execa@9.6.1@@@1/lib/ipc/methods.js
admin 875c7f9b91 feat: Complete zCode CLI X with Telegram bot integration
- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
2026-05-05 09:01:26 +00:00

50 lines
1.2 KiB
JavaScript

import process from 'node:process';
import {sendMessage} from './send.js';
import {getOneMessage} from './get-one.js';
import {getEachMessage} from './get-each.js';
import {getCancelSignal} from './graceful.js';
// Add promise-based IPC methods in current process
export const addIpcMethods = (subprocess, {ipc}) => {
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
};
// Get promise-based IPC in the subprocess
export const getIpcExport = () => {
const anyProcess = process;
const isSubprocess = true;
const ipc = process.channel !== undefined;
return {
...getIpcMethods(anyProcess, isSubprocess, ipc),
getCancelSignal: getCancelSignal.bind(undefined, {
anyProcess,
channel: anyProcess.channel,
isSubprocess,
ipc,
}),
};
};
// Retrieve the `ipc` shared by both the current process and the subprocess
const getIpcMethods = (anyProcess, isSubprocess, ipc) => ({
sendMessage: sendMessage.bind(undefined, {
anyProcess,
channel: anyProcess.channel,
isSubprocess,
ipc,
}),
getOneMessage: getOneMessage.bind(undefined, {
anyProcess,
channel: anyProcess.channel,
isSubprocess,
ipc,
}),
getEachMessage: getEachMessage.bind(undefined, {
anyProcess,
channel: anyProcess.channel,
isSubprocess,
ipc,
}),
});