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,15 @@
import type { AnyValue } from '@opentelemetry/api-logs';
/**
* Validates if a value is a valid AnyValue for Log Attributes according to OpenTelemetry spec.
* Log Attributes support a superset of standard Attributes and must support:
* - Scalar values: string, boolean, signed 64 bit integer, or double precision floating point
* - Byte arrays (Uint8Array)
* - Arrays of any values (heterogeneous arrays allowed)
* - Maps from string to any value (nested objects)
* - Empty values (null/undefined)
*
* @param val - The value to validate
* @returns true if the value is a valid AnyValue, false otherwise
*/
export declare function isLogAttributeValue(val: unknown): val is AnyValue;
//# sourceMappingURL=validation.d.ts.map

View File

@@ -0,0 +1,58 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Validates if a value is a valid AnyValue for Log Attributes according to OpenTelemetry spec.
* Log Attributes support a superset of standard Attributes and must support:
* - Scalar values: string, boolean, signed 64 bit integer, or double precision floating point
* - Byte arrays (Uint8Array)
* - Arrays of any values (heterogeneous arrays allowed)
* - Maps from string to any value (nested objects)
* - Empty values (null/undefined)
*
* @param val - The value to validate
* @returns true if the value is a valid AnyValue, false otherwise
*/
export function isLogAttributeValue(val) {
return isLogAttributeValueInternal(val, new WeakSet());
}
function isLogAttributeValueInternal(val, visited) {
// null and undefined are explicitly allowed
if (val == null) {
return true;
}
// Scalar values
if (typeof val === 'string' ||
typeof val === 'number' ||
typeof val === 'boolean') {
return true;
}
// Byte arrays
if (val instanceof Uint8Array) {
return true;
}
// For objects and arrays, check for circular references
if (typeof val === 'object') {
if (visited.has(val)) {
// Circular reference detected - reject it
return false;
}
visited.add(val);
// Arrays (can contain any AnyValue, including heterogeneous)
if (Array.isArray(val)) {
return val.every(item => isLogAttributeValueInternal(item, visited));
}
// Only accept plain objects (not built-in objects like Date, RegExp, Error, etc.)
// Check if it's a plain object by verifying its constructor is Object or it has no constructor
const obj = val;
if (obj.constructor !== Object && obj.constructor !== undefined) {
return false;
}
// Objects/Maps (including empty objects)
// All object properties must be valid AnyValues
return Object.values(obj).every(item => isLogAttributeValueInternal(item, visited));
}
return false;
}
//# sourceMappingURL=validation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAO,2BAA2B,CAAC,GAAG,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,2BAA2B,CAClC,GAAY,EACZ,OAAwB;IAExB,4CAA4C;IAC5C,IAAI,GAAG,IAAI,IAAI,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,gBAAgB;IAChB,IACE,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAO,GAAG,KAAK,SAAS,EACxB;QACA,OAAO,IAAI,CAAC;KACb;IAED,cAAc;IACd,IAAI,GAAG,YAAY,UAAU,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IAED,wDAAwD;IACxD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,GAAa,CAAC,EAAE;YAC9B,0CAA0C;YAC1C,OAAO,KAAK,CAAC;SACd;QACD,OAAO,CAAC,GAAG,CAAC,GAAa,CAAC,CAAC;QAE3B,6DAA6D;QAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACtB,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,2BAA2B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;SACtE;QAED,kFAAkF;QAClF,+FAA+F;QAC/F,MAAM,GAAG,GAAG,GAA8B,CAAC;QAC3C,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,GAAG,CAAC,WAAW,KAAK,SAAS,EAAE;YAC/D,OAAO,KAAK,CAAC;SACd;QAED,yCAAyC;QACzC,gDAAgD;QAChD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CACrC,2BAA2B,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3C,CAAC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { AnyValue } from '@opentelemetry/api-logs';\n\n/**\n * Validates if a value is a valid AnyValue for Log Attributes according to OpenTelemetry spec.\n * Log Attributes support a superset of standard Attributes and must support:\n * - Scalar values: string, boolean, signed 64 bit integer, or double precision floating point\n * - Byte arrays (Uint8Array)\n * - Arrays of any values (heterogeneous arrays allowed)\n * - Maps from string to any value (nested objects)\n * - Empty values (null/undefined)\n *\n * @param val - The value to validate\n * @returns true if the value is a valid AnyValue, false otherwise\n */\nexport function isLogAttributeValue(val: unknown): val is AnyValue {\n return isLogAttributeValueInternal(val, new WeakSet());\n}\n\nfunction isLogAttributeValueInternal(\n val: unknown,\n visited: WeakSet<object>\n): val is AnyValue {\n // null and undefined are explicitly allowed\n if (val == null) {\n return true;\n }\n\n // Scalar values\n if (\n typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean'\n ) {\n return true;\n }\n\n // Byte arrays\n if (val instanceof Uint8Array) {\n return true;\n }\n\n // For objects and arrays, check for circular references\n if (typeof val === 'object') {\n if (visited.has(val as object)) {\n // Circular reference detected - reject it\n return false;\n }\n visited.add(val as object);\n\n // Arrays (can contain any AnyValue, including heterogeneous)\n if (Array.isArray(val)) {\n return val.every(item => isLogAttributeValueInternal(item, visited));\n }\n\n // Only accept plain objects (not built-in objects like Date, RegExp, Error, etc.)\n // Check if it's a plain object by verifying its constructor is Object or it has no constructor\n const obj = val as Record<string, unknown>;\n if (obj.constructor !== Object && obj.constructor !== undefined) {\n return false;\n }\n\n // Objects/Maps (including empty objects)\n // All object properties must be valid AnyValues\n return Object.values(obj).every(item =>\n isLogAttributeValueInternal(item, visited)\n );\n }\n\n return false;\n}\n"]}