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,17 @@
/*
* 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.
*/
export {};
//# 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,17 @@
/*
* 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.
*/
export {};
//# 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,47 @@
/*
* 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.
*/
/**
* SpanKind is the type of span. Can be used to specify additional relationships between spans
* in addition to a parent/child relationship.
*/
export 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 || (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,163 @@
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { createInstrumentationScope, createResource, toAttributes, } from '../common/internal';
import { getOtlpEncoder } from '../common/utils';
export function sdkSpanToOtlpSpan(span, encoder) {
var _a;
var ctx = span.spanContext();
var 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: toAttributes(span.attributes),
droppedAttributesCount: span.droppedAttributesCount,
events: span.events.map(function (event) { return 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(function (link) { return toOtlpLink(link, encoder); }),
droppedLinksCount: span.droppedLinksCount,
};
}
export function toOtlpLink(link, encoder) {
var _a;
return {
attributes: link.attributes ? 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,
};
}
export function toOtlpSpanEvent(timedEvent, encoder) {
return {
attributes: timedEvent.attributes
? toAttributes(timedEvent.attributes)
: [],
name: timedEvent.name,
timeUnixNano: encoder.encodeHrTime(timedEvent.time),
droppedAttributesCount: timedEvent.droppedAttributesCount || 0,
};
}
/*
* 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.
*/
export function createExportTraceServiceRequest(spans, options) {
var encoder = getOtlpEncoder(options);
return {
resourceSpans: spanRecordsToResourceSpans(spans, encoder),
};
}
function createResourceMap(readableSpans) {
var e_1, _a;
var resourceMap = new Map();
try {
for (var readableSpans_1 = __values(readableSpans), readableSpans_1_1 = readableSpans_1.next(); !readableSpans_1_1.done; readableSpans_1_1 = readableSpans_1.next()) {
var record = readableSpans_1_1.value;
var 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
var instrumentationLibraryKey = record.instrumentationLibrary.name + "@" + (record.instrumentationLibrary.version || '') + ":" + (record.instrumentationLibrary.schemaUrl || '');
var records = ilmMap.get(instrumentationLibraryKey);
if (!records) {
records = [];
ilmMap.set(instrumentationLibraryKey, records);
}
records.push(record);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (readableSpans_1_1 && !readableSpans_1_1.done && (_a = readableSpans_1.return)) _a.call(readableSpans_1);
}
finally { if (e_1) throw e_1.error; }
}
return resourceMap;
}
function spanRecordsToResourceSpans(readableSpans, encoder) {
var resourceMap = createResourceMap(readableSpans);
var out = [];
var entryIterator = resourceMap.entries();
var entry = entryIterator.next();
while (!entry.done) {
var _a = __read(entry.value, 2), resource = _a[0], ilmMap = _a[1];
var scopeResourceSpans = [];
var ilmIterator = ilmMap.values();
var ilmEntry = ilmIterator.next();
while (!ilmEntry.done) {
var scopeSpans = ilmEntry.value;
if (scopeSpans.length > 0) {
var spans = scopeSpans.map(function (readableSpan) {
return sdkSpanToOtlpSpan(readableSpan, encoder);
});
scopeResourceSpans.push({
scope: 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
var transformedSpans = {
resource: 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,18 @@
/*
* 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.
*/
// IMPORTANT: exports added here are public
export { JsonTraceSerializer } from './trace';
//# 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,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,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\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,16 @@
import { createExportTraceServiceRequest } from '../internal';
export var JsonTraceSerializer = {
serializeRequest: function (arg) {
var request = createExportTraceServiceRequest(arg, {
useHex: true,
useLongBits: false,
});
var encoder = new TextEncoder();
return encoder.encode(JSON.stringify(request));
},
deserializeResponse: function (arg) {
var 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,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,CAAC,IAAM,mBAAmB,GAG5B;IACF,gBAAgB,EAAE,UAAC,GAAmB;QACpC,IAAM,OAAO,GAAG,+BAA+B,CAAC,GAAG,EAAE;YACnD,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,IAAM,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,UAAC,GAAe;QACnC,IAAM,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,18 @@
/*
* 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.
*/
// IMPORTANT: exports added here are public
export { ProtobufTraceSerializer } from './trace';
//# 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,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,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\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,31 @@
/*
* 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.
*/
import * as root from '../../generated/root';
import { createExportTraceServiceRequest } from '../internal';
var traceResponseType = root.opentelemetry.proto.collector.trace.v1
.ExportTraceServiceResponse;
var traceRequestType = root.opentelemetry.proto.collector.trace.v1
.ExportTraceServiceRequest;
export var ProtobufTraceSerializer = {
serializeRequest: function (arg) {
var request = createExportTraceServiceRequest(arg);
return traceRequestType.encode(request).finish();
},
deserializeResponse: function (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,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAK7C,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAG9D,IAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;KAClE,0BAAqE,CAAC;AAEzE,IAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;KACjE,yBAAmE,CAAC;AAEvE,MAAM,CAAC,IAAM,uBAAuB,GAGhC;IACF,gBAAgB,EAAE,UAAC,GAAmB;QACpC,IAAM,OAAO,GAAG,+BAA+B,CAAC,GAAG,CAAC,CAAC;QACrD,OAAO,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,CAAC;IACD,mBAAmB,EAAE,UAAC,GAAe;QACnC,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"]}