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,7 @@
/**
* Any exports here may change at any time and without warning
* @module @opentelemetry/api/experimental
*/
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
export type { SugaredSpanOptions } from './trace/SugaredOptions';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,10 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Any exports here may change at any time and without warning
* @module @opentelemetry/api/experimental
*/
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Any exports here may change at any time and without warning\n * @module @opentelemetry/api/experimental\n */\n\nexport { wrapTracer, SugaredTracer } from './trace/SugaredTracer';\nexport type { SugaredSpanOptions } from './trace/SugaredOptions';\n"]}

View File

@@ -0,0 +1,13 @@
import type { Span, SpanOptions } from '../../';
/**
* Options needed for span creation
*/
export interface SugaredSpanOptions extends SpanOptions {
/**
* function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.
* @param e Error which triggered this exception
* @param span current span from context
*/
onException?: (e: Error, span: Span) => void;
}
//# sourceMappingURL=SugaredOptions.d.ts.map

View File

@@ -0,0 +1,6 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
export {};
//# sourceMappingURL=SugaredOptions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SugaredOptions.js","sourceRoot":"","sources":["../../../../src/experimental/trace/SugaredOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Span, SpanOptions } from '../../';\n\n/**\n * Options needed for span creation\n */\nexport interface SugaredSpanOptions extends SpanOptions {\n /**\n * function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.\n * @param e Error which triggered this exception\n * @param span current span from context\n */\n onException?: (e: Error, span: Span) => void;\n}\n"]}

View File

@@ -0,0 +1,64 @@
import type { SugaredSpanOptions } from './SugaredOptions';
import type { Context, Span, Tracer } from '../../';
/**
* return a new SugaredTracer created from the supplied one
* @param tracer
*/
export declare function wrapTracer(tracer: Tracer): SugaredTracer;
export declare class SugaredTracer implements Tracer {
private readonly _tracer;
constructor(tracer: Tracer);
startActiveSpan: Tracer['startActiveSpan'];
startSpan: Tracer['startSpan'];
/**
* Starts a new {@link Span} and calls the given function passing it the
* created span as first argument.
* Additionally, the new span gets set in context and this context is activated
* for the duration of the function call.
* The span will be closed after the function has executed.
* If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.
*
* @param name The name of the span
* @param [options] SugaredSpanOptions used for span creation
* @param [context] Context to use to extract parent
* @param fn function called in the context of the span and receives the newly created span as an argument
* @returns return value of fn
* @example
* const something = tracer.withActiveSpan('op', span => {
* // do some work
* });
* @example
* const something = await tracer.withActiveSpan('op', span => {
* // do some async work
* });
*/
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, fn: F): ReturnType<F>;
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, fn: F): ReturnType<F>;
withActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
/**
* Starts a new {@link Span} and ends it after execution of fn without setting it on context.
* The span will be closed after the function has executed.
* If an exception occurs, it is recorded, the status is et to ERROR and rethrown.
*
* This method does NOT modify the current Context.
*
* @param name The name of the span
* @param [options] SugaredSpanOptions used for span creation
* @param [context] Context to use to extract parent
* @param fn function called in the context of the span and receives the newly created span as an argument
* @returns Span The newly created span
* @example
* const something = tracer.withSpan('op', span => {
* // do some work
* });
* @example
* const something = await tracer.withSpan('op', span => {
* // do some async work
* });
*/
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, fn: F): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, fn: F): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(name: string, options: SugaredSpanOptions, context: Context, fn: F): ReturnType<F>;
}
//# sourceMappingURL=SugaredTracer.d.ts.map

View File

@@ -0,0 +1,88 @@
import { context as contextApi, SpanStatusCode } from '../../';
const defaultOnException = (e, span) => {
span.recordException(e);
span.setStatus({
code: SpanStatusCode.ERROR,
});
};
/**
* return a new SugaredTracer created from the supplied one
* @param tracer
*/
export function wrapTracer(tracer) {
return new SugaredTracer(tracer);
}
export class SugaredTracer {
constructor(tracer) {
this._tracer = tracer;
this.startSpan = tracer.startSpan.bind(this._tracer);
this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);
}
withActiveSpan(name, arg2, arg3, arg4) {
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
return this._tracer.startActiveSpan(name, opts, ctx, (span) => handleFn(span, opts, fn));
}
withSpan(name, arg2, arg3, arg4) {
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
const span = this._tracer.startSpan(name, opts, ctx);
return handleFn(span, opts, fn);
}
}
/**
* Massages parameters of withSpan and withActiveSpan to allow signature overwrites
* @param arg
* @param arg2
* @param arg3
*/
function massageParams(arg, arg2, arg3) {
let opts;
let ctx;
let fn;
if (!arg2 && !arg3) {
fn = arg;
}
else if (!arg3) {
opts = arg;
fn = arg2;
}
else {
opts = arg;
ctx = arg2;
fn = arg3;
}
opts = opts !== null && opts !== void 0 ? opts : {};
ctx = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
return { opts, ctx, fn };
}
/**
* Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling
* @param span
* @param opts
* @param fn
*/
function handleFn(span, opts, fn) {
var _a;
const onException = (_a = opts.onException) !== null && _a !== void 0 ? _a : defaultOnException;
const errorHandler = (e) => {
onException(e, span);
span.end();
throw e;
};
try {
const ret = fn(span);
// if fn is an async function, attach a recordException and spanEnd callback to the promise
if (typeof (ret === null || ret === void 0 ? void 0 : ret.then) === 'function') {
return ret.then(val => {
span.end();
return val;
}, errorHandler);
}
span.end();
return ret;
}
catch (e) {
// add throw to signal the compiler that this will throw in the inner scope
throw errorHandler(e);
}
}
//# sourceMappingURL=SugaredTracer.js.map

File diff suppressed because one or more lines are too long