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
This commit is contained in:
admin
2026-05-05 09:01:26 +00:00
Unverified
parent 4a7035dd92
commit 875c7f9b91
24688 changed files with 3224957 additions and 221 deletions

View File

@@ -0,0 +1,56 @@
import { Transform } from "node:stream";
export class EventSigningTransformStream extends Transform {
priorSignature;
messageSigner;
eventStreamCodec;
systemClockOffsetProvider;
constructor(options) {
super({
autoDestroy: true,
readableObjectMode: true,
writableObjectMode: true,
...options,
});
this.priorSignature = options.priorSignature;
this.eventStreamCodec = options.eventStreamCodec;
this.messageSigner = options.messageSigner;
this.systemClockOffsetProvider = options.systemClockOffsetProvider;
}
async _transform(chunk, encoding, callback) {
try {
const now = new Date(Date.now() + (await this.systemClockOffsetProvider()));
const dateHeader = {
":date": { type: "timestamp", value: now },
};
const signedMessage = await this.messageSigner.sign({
message: {
body: chunk,
headers: dateHeader,
},
priorSignature: this.priorSignature,
}, {
signingDate: now,
});
this.priorSignature = signedMessage.signature;
const serializedSigned = this.eventStreamCodec.encode({
headers: {
...dateHeader,
":chunk-signature": {
type: "binary",
value: getSignatureBinary(signedMessage.signature),
},
},
body: chunk,
});
this.push(serializedSigned);
return callback();
}
catch (err) {
callback(err);
}
}
}
function getSignatureBinary(signature) {
const buf = Buffer.from(signature, "hex");
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
}