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,11 @@
export interface IExportTraceServiceResponse {
/** ExportTraceServiceResponse partialSuccess */
partialSuccess?: IExportTracePartialSuccess;
}
export interface IExportTracePartialSuccess {
/** ExportLogsServiceResponse rejectedLogRecords */
rejectedSpans?: number;
/** ExportLogsServiceResponse errorMessage */
errorMessage?: string;
}
//# sourceMappingURL=export-response.d.ts.map

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=export-response.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"export-response.js","sourceRoot":"","sources":["../../../src/trace/export-response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface IExportTraceServiceResponse {\n /** ExportTraceServiceResponse partialSuccess */\n partialSuccess?: IExportTracePartialSuccess;\n}\n\nexport interface IExportTracePartialSuccess {\n /** ExportLogsServiceResponse rejectedLogRecords */\n rejectedSpans?: number;\n\n /** ExportLogsServiceResponse errorMessage */\n errorMessage?: string;\n}\n"]}

View File

@@ -0,0 +1,2 @@
export { IExportTracePartialSuccess, IExportTraceServiceResponse, } from './export-response';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/trace/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// IMPORTANT: exports added here are public\nexport {\n IExportTracePartialSuccess,\n IExportTraceServiceResponse,\n} from './export-response';\n"]}

View File

@@ -0,0 +1,128 @@
import { Fixed64, IInstrumentationScope, IKeyValue, IResource } from '../common/internal-types';
/** Properties of an ExportTraceServiceRequest. */
export interface IExportTraceServiceRequest {
/** ExportTraceServiceRequest resourceSpans */
resourceSpans?: IResourceSpans[];
}
/** Properties of a ResourceSpans. */
export interface IResourceSpans {
/** ResourceSpans resource */
resource?: IResource;
/** ResourceSpans scopeSpans */
scopeSpans: IScopeSpans[];
/** ResourceSpans schemaUrl */
schemaUrl?: string;
}
/** Properties of an ScopeSpans. */
export interface IScopeSpans {
/** IScopeSpans scope */
scope?: IInstrumentationScope;
/** IScopeSpans spans */
spans?: ISpan[];
/** IScopeSpans schemaUrl */
schemaUrl?: string | null;
}
/** Properties of a Span. */
export interface ISpan {
/** Span traceId */
traceId: string | Uint8Array;
/** Span spanId */
spanId: string | Uint8Array;
/** Span traceState */
traceState?: string | null;
/** Span parentSpanId */
parentSpanId?: string | Uint8Array;
/** Span name */
name: string;
/** Span kind */
kind: ESpanKind;
/** Span startTimeUnixNano */
startTimeUnixNano: Fixed64;
/** Span endTimeUnixNano */
endTimeUnixNano: Fixed64;
/** Span attributes */
attributes: IKeyValue[];
/** Span droppedAttributesCount */
droppedAttributesCount: number;
/** Span events */
events: IEvent[];
/** Span droppedEventsCount */
droppedEventsCount: number;
/** Span links */
links: ILink[];
/** Span droppedLinksCount */
droppedLinksCount: number;
/** Span status */
status: IStatus;
}
/**
* SpanKind is the type of span. Can be used to specify additional relationships between spans
* in addition to a parent/child relationship.
*/
export declare enum ESpanKind {
/** Unspecified. Do NOT use as default. Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED. */
SPAN_KIND_UNSPECIFIED = 0,
/** Indicates that the span represents an internal operation within an application,
* as opposed to an operation happening at the boundaries. Default value.
*/
SPAN_KIND_INTERNAL = 1,
/** Indicates that the span covers server-side handling of an RPC or other
* remote network request.
*/
SPAN_KIND_SERVER = 2,
/** Indicates that the span describes a request to some remote service.
*/
SPAN_KIND_CLIENT = 3,
/** Indicates that the span describes a producer sending a message to a broker.
* Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
* between producer and consumer spans. A PRODUCER span ends when the message was accepted
* by the broker while the logical processing of the message might span a much longer time.
*/
SPAN_KIND_PRODUCER = 4,
/** Indicates that the span describes consumer receiving a message from a broker.
* Like the PRODUCER kind, there is often no direct critical path latency relationship
* between producer and consumer spans.
*/
SPAN_KIND_CONSUMER = 5
}
/** Properties of a Status. */
export interface IStatus {
/** Status message */
message?: string;
/** Status code */
code: EStatusCode;
}
/** StatusCode enum. */
export declare const enum EStatusCode {
/** The default status. */
STATUS_CODE_UNSET = 0,
/** The Span has been evaluated by an Application developers or Operator to have completed successfully. */
STATUS_CODE_OK = 1,
/** The Span contains an error. */
STATUS_CODE_ERROR = 2
}
/** Properties of an Event. */
export interface IEvent {
/** Event timeUnixNano */
timeUnixNano: Fixed64;
/** Event name */
name: string;
/** Event attributes */
attributes: IKeyValue[];
/** Event droppedAttributesCount */
droppedAttributesCount: number;
}
/** Properties of a Link. */
export interface ILink {
/** Link traceId */
traceId: string | Uint8Array;
/** Link spanId */
spanId: string | Uint8Array;
/** Link traceState */
traceState?: string;
/** Link attributes */
attributes: IKeyValue[];
/** Link droppedAttributesCount */
droppedAttributesCount: number;
}
//# sourceMappingURL=internal-types.d.ts.map

View File

@@ -0,0 +1,50 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ESpanKind = void 0;
/**
* SpanKind is the type of span. Can be used to specify additional relationships between spans
* in addition to a parent/child relationship.
*/
var ESpanKind;
(function (ESpanKind) {
/** Unspecified. Do NOT use as default. Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED. */
ESpanKind[ESpanKind["SPAN_KIND_UNSPECIFIED"] = 0] = "SPAN_KIND_UNSPECIFIED";
/** Indicates that the span represents an internal operation within an application,
* as opposed to an operation happening at the boundaries. Default value.
*/
ESpanKind[ESpanKind["SPAN_KIND_INTERNAL"] = 1] = "SPAN_KIND_INTERNAL";
/** Indicates that the span covers server-side handling of an RPC or other
* remote network request.
*/
ESpanKind[ESpanKind["SPAN_KIND_SERVER"] = 2] = "SPAN_KIND_SERVER";
/** Indicates that the span describes a request to some remote service.
*/
ESpanKind[ESpanKind["SPAN_KIND_CLIENT"] = 3] = "SPAN_KIND_CLIENT";
/** Indicates that the span describes a producer sending a message to a broker.
* Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
* between producer and consumer spans. A PRODUCER span ends when the message was accepted
* by the broker while the logical processing of the message might span a much longer time.
*/
ESpanKind[ESpanKind["SPAN_KIND_PRODUCER"] = 4] = "SPAN_KIND_PRODUCER";
/** Indicates that the span describes consumer receiving a message from a broker.
* Like the PRODUCER kind, there is often no direct critical path latency relationship
* between producer and consumer spans.
*/
ESpanKind[ESpanKind["SPAN_KIND_CONSUMER"] = 5] = "SPAN_KIND_CONSUMER";
})(ESpanKind = exports.ESpanKind || (exports.ESpanKind = {}));
//# sourceMappingURL=internal-types.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import type { Link } from '@opentelemetry/api';
import type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
import type { Encoder } from '../common/utils';
import { IEvent, IExportTraceServiceRequest, ILink, ISpan } from './internal-types';
import { OtlpEncodingOptions } from '../common/internal-types';
export declare function sdkSpanToOtlpSpan(span: ReadableSpan, encoder: Encoder): ISpan;
export declare function toOtlpLink(link: Link, encoder: Encoder): ILink;
export declare function toOtlpSpanEvent(timedEvent: TimedEvent, encoder: Encoder): IEvent;
export declare function createExportTraceServiceRequest(spans: ReadableSpan[], options?: OtlpEncodingOptions): IExportTraceServiceRequest;
//# sourceMappingURL=internal.d.ts.map

View File

@@ -0,0 +1,130 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0;
const internal_1 = require("../common/internal");
const utils_1 = require("../common/utils");
function sdkSpanToOtlpSpan(span, encoder) {
var _a;
const ctx = span.spanContext();
const status = span.status;
return {
traceId: encoder.encodeSpanContext(ctx.traceId),
spanId: encoder.encodeSpanContext(ctx.spanId),
parentSpanId: encoder.encodeOptionalSpanContext(span.parentSpanId),
traceState: (_a = ctx.traceState) === null || _a === void 0 ? void 0 : _a.serialize(),
name: span.name,
// Span kind is offset by 1 because the API does not define a value for unset
kind: span.kind == null ? 0 : span.kind + 1,
startTimeUnixNano: encoder.encodeHrTime(span.startTime),
endTimeUnixNano: encoder.encodeHrTime(span.endTime),
attributes: (0, internal_1.toAttributes)(span.attributes),
droppedAttributesCount: span.droppedAttributesCount,
events: span.events.map(event => toOtlpSpanEvent(event, encoder)),
droppedEventsCount: span.droppedEventsCount,
status: {
// API and proto enums share the same values
code: status.code,
message: status.message,
},
links: span.links.map(link => toOtlpLink(link, encoder)),
droppedLinksCount: span.droppedLinksCount,
};
}
exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan;
function toOtlpLink(link, encoder) {
var _a;
return {
attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [],
spanId: encoder.encodeSpanContext(link.context.spanId),
traceId: encoder.encodeSpanContext(link.context.traceId),
traceState: (_a = link.context.traceState) === null || _a === void 0 ? void 0 : _a.serialize(),
droppedAttributesCount: link.droppedAttributesCount || 0,
};
}
exports.toOtlpLink = toOtlpLink;
function toOtlpSpanEvent(timedEvent, encoder) {
return {
attributes: timedEvent.attributes
? (0, internal_1.toAttributes)(timedEvent.attributes)
: [],
name: timedEvent.name,
timeUnixNano: encoder.encodeHrTime(timedEvent.time),
droppedAttributesCount: timedEvent.droppedAttributesCount || 0,
};
}
exports.toOtlpSpanEvent = toOtlpSpanEvent;
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function createExportTraceServiceRequest(spans, options) {
const encoder = (0, utils_1.getOtlpEncoder)(options);
return {
resourceSpans: spanRecordsToResourceSpans(spans, encoder),
};
}
exports.createExportTraceServiceRequest = createExportTraceServiceRequest;
function createResourceMap(readableSpans) {
const resourceMap = new Map();
for (const record of readableSpans) {
let ilmMap = resourceMap.get(record.resource);
if (!ilmMap) {
ilmMap = new Map();
resourceMap.set(record.resource, ilmMap);
}
// TODO this is duplicated in basic tracer. Consolidate on a common helper in core
const instrumentationLibraryKey = `${record.instrumentationLibrary.name}@${record.instrumentationLibrary.version || ''}:${record.instrumentationLibrary.schemaUrl || ''}`;
let records = ilmMap.get(instrumentationLibraryKey);
if (!records) {
records = [];
ilmMap.set(instrumentationLibraryKey, records);
}
records.push(record);
}
return resourceMap;
}
function spanRecordsToResourceSpans(readableSpans, encoder) {
const resourceMap = createResourceMap(readableSpans);
const out = [];
const entryIterator = resourceMap.entries();
let entry = entryIterator.next();
while (!entry.done) {
const [resource, ilmMap] = entry.value;
const scopeResourceSpans = [];
const ilmIterator = ilmMap.values();
let ilmEntry = ilmIterator.next();
while (!ilmEntry.done) {
const scopeSpans = ilmEntry.value;
if (scopeSpans.length > 0) {
const spans = scopeSpans.map(readableSpan => sdkSpanToOtlpSpan(readableSpan, encoder));
scopeResourceSpans.push({
scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationLibrary),
spans: spans,
schemaUrl: scopeSpans[0].instrumentationLibrary.schemaUrl,
});
}
ilmEntry = ilmIterator.next();
}
// TODO SDK types don't provide resource schema URL at this time
const transformedSpans = {
resource: (0, internal_1.createResource)(resource),
scopeSpans: scopeResourceSpans,
schemaUrl: undefined,
};
out.push(transformedSpans);
entry = entryIterator.next();
}
return out;
}
//# sourceMappingURL=internal.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export { JsonTraceSerializer } from './trace';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,22 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonTraceSerializer = void 0;
// IMPORTANT: exports added here are public
var trace_1 = require("./trace");
Object.defineProperty(exports, "JsonTraceSerializer", { enumerable: true, get: function () { return trace_1.JsonTraceSerializer; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/trace/json/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAA2C;AAC3C,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// IMPORTANT: exports added here are public\nexport { JsonTraceSerializer } from './trace';\n"]}

View File

@@ -0,0 +1,5 @@
import { ISerializer } from '../../i-serializer';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { IExportTraceServiceResponse } from '../export-response';
export declare const JsonTraceSerializer: ISerializer<ReadableSpan[], IExportTraceServiceResponse>;
//# sourceMappingURL=trace.d.ts.map

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonTraceSerializer = void 0;
const internal_1 = require("../internal");
exports.JsonTraceSerializer = {
serializeRequest: (arg) => {
const request = (0, internal_1.createExportTraceServiceRequest)(arg, {
useHex: true,
useLongBits: false,
});
const encoder = new TextEncoder();
return encoder.encode(JSON.stringify(request));
},
deserializeResponse: (arg) => {
const decoder = new TextDecoder();
return JSON.parse(decoder.decode(arg));
},
};
//# sourceMappingURL=trace.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../src/trace/json/trace.ts"],"names":[],"mappings":";;;AAkBA,0CAA8D;AAEjD,QAAA,mBAAmB,GAG5B;IACF,gBAAgB,EAAE,CAAC,GAAmB,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,IAAA,0CAA+B,EAAC,GAAG,EAAE;YACnD,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,mBAAmB,EAAE,CAAC,GAAe,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAgC,CAAC;IACxE,CAAC;CACF,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ISerializer } from '../../i-serializer';\nimport { ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { IExportTraceServiceResponse } from '../export-response';\nimport { createExportTraceServiceRequest } from '../internal';\n\nexport const JsonTraceSerializer: ISerializer<\n ReadableSpan[],\n IExportTraceServiceResponse\n> = {\n serializeRequest: (arg: ReadableSpan[]) => {\n const request = createExportTraceServiceRequest(arg, {\n useHex: true,\n useLongBits: false,\n });\n const encoder = new TextEncoder();\n return encoder.encode(JSON.stringify(request));\n },\n deserializeResponse: (arg: Uint8Array) => {\n const decoder = new TextDecoder();\n return JSON.parse(decoder.decode(arg)) as IExportTraceServiceResponse;\n },\n};\n"]}

View File

@@ -0,0 +1,2 @@
export { ProtobufTraceSerializer } from './trace';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,22 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProtobufTraceSerializer = void 0;
// IMPORTANT: exports added here are public
var trace_1 = require("./trace");
Object.defineProperty(exports, "ProtobufTraceSerializer", { enumerable: true, get: function () { return trace_1.ProtobufTraceSerializer; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/trace/protobuf/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAA2C;AAC3C,iCAAkD;AAAzC,gHAAA,uBAAuB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// IMPORTANT: exports added here are public\nexport { ProtobufTraceSerializer } from './trace';\n"]}

View File

@@ -0,0 +1,5 @@
import { ISerializer } from '../../i-serializer';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { IExportTraceServiceResponse } from '../export-response';
export declare const ProtobufTraceSerializer: ISerializer<ReadableSpan[], IExportTraceServiceResponse>;
//# sourceMappingURL=trace.d.ts.map

View File

@@ -0,0 +1,34 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProtobufTraceSerializer = void 0;
const root = require("../../generated/root");
const internal_1 = require("../internal");
const traceResponseType = root.opentelemetry.proto.collector.trace.v1
.ExportTraceServiceResponse;
const traceRequestType = root.opentelemetry.proto.collector.trace.v1
.ExportTraceServiceRequest;
exports.ProtobufTraceSerializer = {
serializeRequest: (arg) => {
const request = (0, internal_1.createExportTraceServiceRequest)(arg);
return traceRequestType.encode(request).finish();
},
deserializeResponse: (arg) => {
return traceResponseType.decode(arg);
},
};
//# sourceMappingURL=trace.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../src/trace/protobuf/trace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6CAA6C;AAK7C,0CAA8D;AAG9D,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;KAClE,0BAAqE,CAAC;AAEzE,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;KACjE,yBAAmE,CAAC;AAE1D,QAAA,uBAAuB,GAGhC;IACF,gBAAgB,EAAE,CAAC,GAAmB,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,IAAA,0CAA+B,EAAC,GAAG,CAAC,CAAC;QACrD,OAAO,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,CAAC;IACD,mBAAmB,EAAE,CAAC,GAAe,EAAE,EAAE;QACvC,OAAO,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;CACF,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as root from '../../generated/root';\nimport { ISerializer } from '../../i-serializer';\nimport { ExportType } from '../../common/protobuf/protobuf-export-type';\nimport { IExportTraceServiceRequest } from '../internal-types';\nimport { ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { createExportTraceServiceRequest } from '../internal';\nimport { IExportTraceServiceResponse } from '../export-response';\n\nconst traceResponseType = root.opentelemetry.proto.collector.trace.v1\n .ExportTraceServiceResponse as ExportType<IExportTraceServiceResponse>;\n\nconst traceRequestType = root.opentelemetry.proto.collector.trace.v1\n .ExportTraceServiceRequest as ExportType<IExportTraceServiceRequest>;\n\nexport const ProtobufTraceSerializer: ISerializer<\n ReadableSpan[],\n IExportTraceServiceResponse\n> = {\n serializeRequest: (arg: ReadableSpan[]) => {\n const request = createExportTraceServiceRequest(arg);\n return traceRequestType.encode(request).finish();\n },\n deserializeResponse: (arg: Uint8Array) => {\n return traceResponseType.decode(arg);\n },\n};\n"]}