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,30 @@
import type { Logger } from '@opentelemetry/api-logs';
import type { Resource } from '@opentelemetry/resources';
import type { InstrumentationScope } from '@opentelemetry/core';
import type { LogRecordProcessor } from '../LogRecordProcessor';
import type { LogRecordLimits, LoggerConfig, LoggerConfigurator } from '../types';
/**
* Default LoggerConfigurator that returns the default config for all loggers
*/
export declare const DEFAULT_LOGGER_CONFIGURATOR: LoggerConfigurator;
export declare class LoggerProviderSharedState {
readonly loggers: Map<string, Logger>;
activeProcessor: LogRecordProcessor;
readonly registeredLogRecordProcessors: LogRecordProcessor[];
readonly resource: Resource;
readonly forceFlushTimeoutMillis: number;
readonly logRecordLimits: Required<LogRecordLimits>;
readonly processors: LogRecordProcessor[];
private _loggerConfigurator;
private _loggerConfigs;
constructor(resource: Resource, forceFlushTimeoutMillis: number, logRecordLimits: Required<LogRecordLimits>, processors: LogRecordProcessor[], loggerConfigurator?: LoggerConfigurator);
/**
* Get the LoggerConfig for a given instrumentation scope.
* Uses the LoggerConfigurator function to compute the config on first access
* and caches the result.
*
* @experimental This feature is in development as per the OpenTelemetry specification.
*/
getLoggerConfig(instrumentationScope: InstrumentationScope): Required<LoggerConfig>;
}
//# sourceMappingURL=LoggerProviderSharedState.d.ts.map

View File

@@ -0,0 +1,67 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
import { SeverityNumber } from '@opentelemetry/api-logs';
import { NoopLogRecordProcessor } from '../export/NoopLogRecordProcessor';
import { MultiLogRecordProcessor } from '../MultiLogRecordProcessor';
import { getInstrumentationScopeKey } from './utils';
const DEFAULT_LOGGER_CONFIG = {
disabled: false,
minimumSeverity: SeverityNumber.UNSPECIFIED,
traceBased: false,
};
/**
* Default LoggerConfigurator that returns the default config for all loggers
*/
export const DEFAULT_LOGGER_CONFIGURATOR = () => ({
...DEFAULT_LOGGER_CONFIG,
});
export class LoggerProviderSharedState {
loggers = new Map();
activeProcessor;
registeredLogRecordProcessors = [];
resource;
forceFlushTimeoutMillis;
logRecordLimits;
processors;
_loggerConfigurator;
_loggerConfigs = new Map();
constructor(resource, forceFlushTimeoutMillis, logRecordLimits, processors, loggerConfigurator) {
this.resource = resource;
this.forceFlushTimeoutMillis = forceFlushTimeoutMillis;
this.logRecordLimits = logRecordLimits;
this.processors = processors;
if (processors.length > 0) {
this.registeredLogRecordProcessors = processors;
this.activeProcessor = new MultiLogRecordProcessor(this.registeredLogRecordProcessors, this.forceFlushTimeoutMillis);
}
else {
this.activeProcessor = new NoopLogRecordProcessor();
}
this._loggerConfigurator =
loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR;
}
/**
* Get the LoggerConfig for a given instrumentation scope.
* Uses the LoggerConfigurator function to compute the config on first access
* and caches the result.
*
* @experimental This feature is in development as per the OpenTelemetry specification.
*/
getLoggerConfig(instrumentationScope) {
const key = getInstrumentationScopeKey(instrumentationScope);
// Return cached config if available
let config = this._loggerConfigs.get(key);
if (config) {
return config;
}
// Compute config using the configurator
// The configurator always returns a complete config
config = this._loggerConfigurator(instrumentationScope);
// Cache the result
this._loggerConfigs.set(key, config);
return config;
}
}
//# sourceMappingURL=LoggerProviderSharedState.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"LoggerProviderSharedState.js","sourceRoot":"","sources":["../../../src/internal/LoggerProviderSharedState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,O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;SACrD;QAED,IAAI,CAAC,mBAAmB;YACtB,kBAAkB,IAAI,2BAA2B,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CACb,oBAA0C;QAE1C,MAAM,GAAG,GAAG,0BAA0B,CAAC,oBAAoB,CAAC,CAAC;QAE7D,oCAAoC;QACpC,IAAI,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,MAAM,EAAE;YACV,OAAO,MAAM,CAAC;SACf;QAED,wCAAwC;QACxC,oDAAoD;QACpD,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;QAExD,mBAAmB;QACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAErC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Logger } from '@opentelemetry/api-logs';\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport type { Resource } from '@opentelemetry/resources';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport type { LogRecordProcessor } from '../LogRecordProcessor';\nimport type {\n LogRecordLimits,\n LoggerConfig,\n LoggerConfigurator,\n} from '../types';\nimport { NoopLogRecordProcessor } from '../export/NoopLogRecordProcessor';\nimport { MultiLogRecordProcessor } from '../MultiLogRecordProcessor';\nimport { getInstrumentationScopeKey } from './utils';\n\nconst DEFAULT_LOGGER_CONFIG: Required<LoggerConfig> = {\n disabled: false,\n minimumSeverity: SeverityNumber.UNSPECIFIED,\n traceBased: false,\n};\n\n/**\n * Default LoggerConfigurator that returns the default config for all loggers\n */\nexport const DEFAULT_LOGGER_CONFIGURATOR: LoggerConfigurator = () => ({\n ...DEFAULT_LOGGER_CONFIG,\n});\n\nexport class LoggerProviderSharedState {\n readonly loggers: Map<string, Logger> = new Map();\n activeProcessor: LogRecordProcessor;\n readonly registeredLogRecordProcessors: LogRecordProcessor[] = [];\n readonly resource: Resource;\n readonly forceFlushTimeoutMillis: number;\n readonly logRecordLimits: Required<LogRecordLimits>;\n readonly processors: LogRecordProcessor[];\n private _loggerConfigurator: LoggerConfigurator;\n private _loggerConfigs: Map<string, Required<LoggerConfig>> = new Map();\n\n constructor(\n resource: Resource,\n forceFlushTimeoutMillis: number,\n logRecordLimits: Required<LogRecordLimits>,\n processors: LogRecordProcessor[],\n loggerConfigurator?: LoggerConfigurator\n ) {\n this.resource = resource;\n this.forceFlushTimeoutMillis = forceFlushTimeoutMillis;\n this.logRecordLimits = logRecordLimits;\n this.processors = processors;\n if (processors.length > 0) {\n this.registeredLogRecordProcessors = processors;\n this.activeProcessor = new MultiLogRecordProcessor(\n this.registeredLogRecordProcessors,\n this.forceFlushTimeoutMillis\n );\n } else {\n this.activeProcessor = new NoopLogRecordProcessor();\n }\n\n this._loggerConfigurator =\n loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR;\n }\n\n /**\n * Get the LoggerConfig for a given instrumentation scope.\n * Uses the LoggerConfigurator function to compute the config on first access\n * and caches the result.\n *\n * @experimental This feature is in development as per the OpenTelemetry specification.\n */\n getLoggerConfig(\n instrumentationScope: InstrumentationScope\n ): Required<LoggerConfig> {\n const key = getInstrumentationScopeKey(instrumentationScope);\n\n // Return cached config if available\n let config = this._loggerConfigs.get(key);\n if (config) {\n return config;\n }\n\n // Compute config using the configurator\n // The configurator always returns a complete config\n config = this._loggerConfigurator(instrumentationScope);\n\n // Cache the result\n this._loggerConfigs.set(key, config);\n\n return config;\n }\n}\n"]}

View File

@@ -0,0 +1,8 @@
import type { InstrumentationScope } from '@opentelemetry/core';
/**
* Converting the instrumentation scope object to a unique identifier string.
* @param scope - The instrumentation scope to convert
* @returns A unique string identifier for the scope
*/
export declare function getInstrumentationScopeKey(scope: InstrumentationScope): string;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1,13 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Converting the instrumentation scope object to a unique identifier string.
* @param scope - The instrumentation scope to convert
* @returns A unique string identifier for the scope
*/
export function getInstrumentationScopeKey(scope) {
return `${scope.name}@${scope.version || ''}:${scope.schemaUrl || ''}`;
}
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/internal/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAA2B;IAE3B,OAAO,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;AACzE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { InstrumentationScope } from '@opentelemetry/core';\n\n/**\n * Converting the instrumentation scope object to a unique identifier string.\n * @param scope - The instrumentation scope to convert\n * @returns A unique string identifier for the scope\n */\nexport function getInstrumentationScopeKey(\n scope: InstrumentationScope\n): string {\n return `${scope.name}@${scope.version || ''}:${scope.schemaUrl || ''}`;\n}\n"]}