- 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
30 lines
629 B
JavaScript
30 lines
629 B
JavaScript
'use strict'
|
|
|
|
/**
|
|
* Checks if the given value is a valid LastEventId.
|
|
* @param {string} value
|
|
* @returns {boolean}
|
|
*/
|
|
function isValidLastEventId (value) {
|
|
// LastEventId should not contain U+0000 NULL
|
|
return value.indexOf('\u0000') === -1
|
|
}
|
|
|
|
/**
|
|
* Checks if the given value is a base 10 digit.
|
|
* @param {string} value
|
|
* @returns {boolean}
|
|
*/
|
|
function isASCIINumber (value) {
|
|
if (value.length === 0) return false
|
|
for (let i = 0; i < value.length; i++) {
|
|
if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
module.exports = {
|
|
isValidLastEventId,
|
|
isASCIINumber
|
|
}
|