- 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
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import {checkIpcMaxBuffer} from '../io/max-buffer.js';
|
|
import {shouldLogIpc, logIpcOutput} from '../verbose/ipc.js';
|
|
import {getFdSpecificValue} from '../arguments/specific.js';
|
|
import {loopOnMessages} from './get-each.js';
|
|
|
|
// Iterate through IPC messages sent by the subprocess
|
|
export const waitForIpcOutput = async ({
|
|
subprocess,
|
|
buffer: bufferArray,
|
|
maxBuffer: maxBufferArray,
|
|
ipc,
|
|
ipcOutput,
|
|
verboseInfo,
|
|
}) => {
|
|
if (!ipc) {
|
|
return ipcOutput;
|
|
}
|
|
|
|
const isVerbose = shouldLogIpc(verboseInfo);
|
|
const buffer = getFdSpecificValue(bufferArray, 'ipc');
|
|
const maxBuffer = getFdSpecificValue(maxBufferArray, 'ipc');
|
|
|
|
for await (const message of loopOnMessages({
|
|
anyProcess: subprocess,
|
|
channel: subprocess.channel,
|
|
isSubprocess: false,
|
|
ipc,
|
|
shouldAwait: false,
|
|
reference: true,
|
|
})) {
|
|
if (buffer) {
|
|
checkIpcMaxBuffer(subprocess, ipcOutput, maxBuffer);
|
|
ipcOutput.push(message);
|
|
}
|
|
|
|
if (isVerbose) {
|
|
logIpcOutput(message, verboseInfo);
|
|
}
|
|
}
|
|
|
|
return ipcOutput;
|
|
};
|
|
|
|
export const getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => {
|
|
await Promise.allSettled([ipcOutputPromise]);
|
|
return ipcOutput;
|
|
};
|