- 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
66 lines
2.3 KiB
JavaScript
66 lines
2.3 KiB
JavaScript
/*
|
|
* Copyright The OpenTelemetry Authors
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
|
import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
|
|
import { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';
|
|
import { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';
|
|
import { DiagAPI } from './diag';
|
|
const API_NAME = 'trace';
|
|
/**
|
|
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
export class TraceAPI {
|
|
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
constructor() {
|
|
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
this.wrapSpanContext = wrapSpanContext;
|
|
this.isSpanContextValid = isSpanContextValid;
|
|
this.deleteSpan = deleteSpan;
|
|
this.getSpan = getSpan;
|
|
this.getActiveSpan = getActiveSpan;
|
|
this.getSpanContext = getSpanContext;
|
|
this.setSpan = setSpan;
|
|
this.setSpanContext = setSpanContext;
|
|
}
|
|
/** Get the singleton instance of the Trace API */
|
|
static getInstance() {
|
|
if (!this._instance) {
|
|
this._instance = new TraceAPI();
|
|
}
|
|
return this._instance;
|
|
}
|
|
/**
|
|
* Set the current global tracer.
|
|
*
|
|
* @returns true if the tracer provider was successfully registered, else false
|
|
*/
|
|
setGlobalTracerProvider(provider) {
|
|
const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
|
if (success) {
|
|
this._proxyTracerProvider.setDelegate(provider);
|
|
}
|
|
return success;
|
|
}
|
|
/**
|
|
* Returns the global tracer provider.
|
|
*/
|
|
getTracerProvider() {
|
|
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
|
}
|
|
/**
|
|
* Returns a tracer from the global tracer provider.
|
|
*/
|
|
getTracer(name, version) {
|
|
return this.getTracerProvider().getTracer(name, version);
|
|
}
|
|
/** Remove the global tracer provider */
|
|
disable() {
|
|
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
}
|
|
}
|
|
//# sourceMappingURL=trace.js.map
|