- 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
16 lines
600 B
JavaScript
16 lines
600 B
JavaScript
import { encrypt, decrypt } from './content_encryption.js';
|
|
import { encode as b64u } from '../util/base64url.js';
|
|
export async function wrap(alg, key, cek, iv) {
|
|
const jweAlgorithm = alg.slice(0, 7);
|
|
const wrapped = await encrypt(jweAlgorithm, cek, key, iv, new Uint8Array());
|
|
return {
|
|
encryptedKey: wrapped.ciphertext,
|
|
iv: b64u(wrapped.iv),
|
|
tag: b64u(wrapped.tag),
|
|
};
|
|
}
|
|
export async function unwrap(alg, key, encryptedKey, iv, tag) {
|
|
const jweAlgorithm = alg.slice(0, 7);
|
|
return decrypt(jweAlgorithm, key, encryptedKey, iv, tag, new Uint8Array());
|
|
}
|