@ancplua/qyl-api-schema 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +89 -0
  3. package/VERSIONING.md +74 -0
  4. package/api/routes.tsp +1052 -0
  5. package/api/streaming.tsp +335 -0
  6. package/common/errors.tsp +206 -0
  7. package/common/pagination.tsp +254 -0
  8. package/common/types.tsp +345 -0
  9. package/generated/README.md +26 -0
  10. package/generated/otel-keys.gen.tsp +1648 -0
  11. package/index.tsp +55 -0
  12. package/intelligence/causal-rules.tsp +34 -0
  13. package/intelligence/diagnostic-patterns.tsp +54 -0
  14. package/intelligence/investigation-strategies.tsp +37 -0
  15. package/intelligence/main.tsp +19 -0
  16. package/intelligence/seed/patterns.tsp +172 -0
  17. package/intelligence/seed/rules.tsp +44 -0
  18. package/intelligence/seed/strategies.tsp +56 -0
  19. package/intelligence/signals.tsp +60 -0
  20. package/models/agent/agent-run.tsp +154 -0
  21. package/models/agent/tool-call.tsp +122 -0
  22. package/models/agent/workflow-checkpoint.tsp +50 -0
  23. package/models/agent/workflow-execution.tsp +136 -0
  24. package/models/alerting.tsp +436 -0
  25. package/models/configurator.tsp +433 -0
  26. package/models/control-graph.tsp +197 -0
  27. package/models/db.tsp +810 -0
  28. package/models/deployment.tsp +365 -0
  29. package/models/error.tsp +433 -0
  30. package/models/genai.tsp +1368 -0
  31. package/models/http.tsp +600 -0
  32. package/models/identity.tsp +213 -0
  33. package/models/issues.tsp +484 -0
  34. package/models/log.tsp +140 -0
  35. package/models/messaging.tsp +304 -0
  36. package/models/otel-config.tsp +455 -0
  37. package/models/retention.tsp +240 -0
  38. package/models/rpc.tsp +309 -0
  39. package/models/search.tsp +243 -0
  40. package/models/session.tsp +274 -0
  41. package/models/system.tsp +400 -0
  42. package/models/test.tsp +346 -0
  43. package/models/triage.tsp +113 -0
  44. package/models/workflow.tsp +396 -0
  45. package/models/workspace.tsp +435 -0
  46. package/otel/enums.tsp +392 -0
  47. package/otel/logs.tsp +135 -0
  48. package/otel/metrics.tsp +358 -0
  49. package/otel/otel-conventions.tsp +14 -0
  50. package/otel/profiles.tsp +335 -0
  51. package/otel/resource.tsp +257 -0
  52. package/otel/span.tsp +307 -0
  53. package/package.json +88 -0
  54. package/tspconfig.yaml +49 -0
package/models/log.tsp ADDED
@@ -0,0 +1,140 @@
1
+ // =============================================================================
2
+ // ANcpLua v2.0 - Log Semantic Conventions (OTel v1.40)
3
+ // =============================================================================
4
+ // Log record attributes and log-specific semantic conventions.
5
+ // =============================================================================
6
+
7
+ import "../otel/enums.tsp";
8
+
9
+ using Qyl.Api.Contracts.OTel.Enums;
10
+
11
+ namespace Qyl.Api.Contracts.Domains.Observe.Log;
12
+
13
+ // =============================================================================
14
+ // Log Attributes
15
+ // =============================================================================
16
+
17
+ @doc("Log record attributes")
18
+ model LogAttributes {
19
+ @doc("Log record unique identifier")
20
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.RecordUid)
21
+ recordUid?: string;
22
+
23
+ @doc("Original log file name")
24
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.FileName)
25
+ fileName?: string;
26
+
27
+ @doc("Full path to log file")
28
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.FilePath)
29
+ filePath?: string;
30
+
31
+ @doc("Original log file name resolved")
32
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.FileNameResolved)
33
+ fileNameResolved?: string;
34
+
35
+ @doc("Full path to log file resolved")
36
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.FilePathResolved)
37
+ filePathResolved?: string;
38
+
39
+ @doc("Log iostream (stdout/stderr)")
40
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Log.Iostream)
41
+ iostream?: LogIostream;
42
+ }
43
+
44
+ @doc("Log IO streams")
45
+ enum LogIostream {
46
+ @doc("Standard output")
47
+ stdout: "stdout",
48
+
49
+ @doc("Standard error")
50
+ stderr: "stderr",
51
+ }
52
+
53
+ // =============================================================================
54
+ // Event Attributes
55
+ // =============================================================================
56
+
57
+ @doc("Event domain for event.name categorization")
58
+ enum EventDomain {
59
+ @doc("Browser events")
60
+ browser: "browser",
61
+
62
+ @doc("Device events")
63
+ device: "device",
64
+
65
+ @doc("Kubernetes events")
66
+ k8s: "k8s",
67
+
68
+ @doc("User events")
69
+ user: "user",
70
+
71
+ @doc("Session events")
72
+ session: "session",
73
+
74
+ @doc("Application events")
75
+ app: "app",
76
+
77
+ @doc("Feature flag events")
78
+ featureFlag: "feature_flag",
79
+
80
+ @doc("Deployment events")
81
+ deployment: "deployment",
82
+
83
+ @doc("CI/CD events")
84
+ cicd: "cicd",
85
+ }
86
+
87
+ @doc("Log event attributes")
88
+ model EventAttributes {
89
+ @doc("Event name (with domain prefix)")
90
+ @encodedName("application/json", "event.name")
91
+ name: string;
92
+
93
+ @doc("Event domain")
94
+ @encodedName("application/json", "event.domain")
95
+ domain?: EventDomain;
96
+ }
97
+
98
+ // =============================================================================
99
+ // Log Severity Mapping
100
+ // =============================================================================
101
+
102
+ @doc("Log severity text to number mapping")
103
+ model SeverityMapping {
104
+ @doc("Severity text")
105
+ text: string;
106
+
107
+ @doc("Severity number (1-24)")
108
+ number: SeverityNumber;
109
+ }
110
+
111
+ // =============================================================================
112
+ // Structured Log Format
113
+ // =============================================================================
114
+
115
+ @doc("Structured log format detection")
116
+ enum StructuredLogFormat {
117
+ @doc("JSON format")
118
+ json: "json",
119
+
120
+ @doc("Logfmt format")
121
+ logfmt: "logfmt",
122
+
123
+ @doc("Apache Common Log Format")
124
+ clf: "clf",
125
+
126
+ @doc("Apache Combined Log Format")
127
+ combined: "combined",
128
+
129
+ @doc("Syslog format")
130
+ syslog: "syslog",
131
+
132
+ @doc("W3C Extended Log Format")
133
+ w3c: "w3c",
134
+
135
+ @doc("CSV format")
136
+ csv: "csv",
137
+
138
+ @doc("Unstructured/plaintext")
139
+ plaintext: "plaintext",
140
+ }
@@ -0,0 +1,304 @@
1
+ // =============================================================================
2
+ // ANcpLua v2.0 - Messaging Semantic Conventions (OTel v1.40)
3
+ // =============================================================================
4
+ // Message broker and queue telemetry attributes.
5
+ // =============================================================================
6
+
7
+ import "../common/types.tsp";
8
+
9
+ using Qyl.Api.Contracts.Common;
10
+
11
+ namespace Qyl.Api.Contracts.Domains.Transport.Messaging;
12
+
13
+ // =============================================================================
14
+ // Messaging Span Attributes
15
+ // =============================================================================
16
+
17
+ @doc("Messaging span attributes")
18
+ model MessagingAttributes {
19
+ @doc("The messaging system (e.g., kafka, rabbitmq, aws_sqs)")
20
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.System)
21
+ system: MessagingSystem;
22
+
23
+ @doc("Message destination name (queue or topic)")
24
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationName)
25
+ destinationName?: string;
26
+
27
+ @doc("Destination kind (queue or topic)")
28
+ @encodedName("application/json", "messaging.destination.kind")
29
+ destinationKind?: MessagingDestinationKind;
30
+
31
+ @doc("Whether the destination is temporary")
32
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationTemporary)
33
+ destinationTemporary?: boolean;
34
+
35
+ @doc("Whether the destination is anonymous")
36
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationAnonymous)
37
+ destinationAnonymous?: boolean;
38
+
39
+ @doc("Partition number (for partitioned systems)")
40
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationPartitionId)
41
+ destinationPartitionId?: string;
42
+
43
+ @doc("Destination template (e.g., for subscription patterns)")
44
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationTemplate)
45
+ destinationTemplate?: string;
46
+
47
+ @doc("Message ID")
48
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.MessageId)
49
+ messageId?: string;
50
+
51
+ @doc("Conversation/correlation ID")
52
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.MessageConversationId)
53
+ messageConversationId?: string;
54
+
55
+ @doc("Message body size in bytes")
56
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.MessageBodySize)
57
+ messageBodySize?: ByteSize;
58
+
59
+ @doc("Total message size including metadata")
60
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.MessageEnvelopeSize)
61
+ messageEnvelopeSize?: ByteSize;
62
+
63
+ @doc("Messaging operation type")
64
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.OperationType)
65
+ operationType?: MessagingOperationType;
66
+
67
+ @doc("Operation name")
68
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.OperationName)
69
+ operationName?: string;
70
+
71
+ @doc("Batch message count")
72
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.BatchMessageCount)
73
+ batchMessageCount?: int32;
74
+
75
+ @doc("Consumer group name")
76
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.ConsumerGroupName)
77
+ consumerGroupName?: string;
78
+
79
+ @doc("Consumer ID")
80
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.ClientId)
81
+ clientId?: string;
82
+
83
+ // ---------------------------------------------------------------------------
84
+ // Kafka-Specific Attributes
85
+ // ---------------------------------------------------------------------------
86
+
87
+ @doc("Kafka consumer group")
88
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.KafkaConsumerGroup)
89
+ kafkaConsumerGroup?: string;
90
+
91
+ @doc("Kafka message key")
92
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.KafkaMessageKey)
93
+ kafkaMessageKey?: string;
94
+
95
+ @doc("Kafka message offset")
96
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.KafkaMessageOffset)
97
+ kafkaMessageOffset?: int64;
98
+
99
+ @doc("Kafka message tombstone")
100
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.KafkaMessageTombstone)
101
+ kafkaMessageTombstone?: boolean;
102
+
103
+ // ---------------------------------------------------------------------------
104
+ // RabbitMQ-Specific Attributes
105
+ // ---------------------------------------------------------------------------
106
+
107
+ @doc("RabbitMQ delivery tag")
108
+ @encodedName("application/json", "messaging.rabbitmq.delivery_tag")
109
+ rabbitmqDeliveryTag?: int64;
110
+
111
+ @doc("RabbitMQ routing key")
112
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.RabbitmqDestinationRoutingKey)
113
+ rabbitmqRoutingKey?: string;
114
+
115
+ // ---------------------------------------------------------------------------
116
+ // AWS SQS/SNS-Specific Attributes
117
+ // ---------------------------------------------------------------------------
118
+
119
+ @doc("AWS SQS message group ID")
120
+ @encodedName("application/json", "messaging.aws_sqs.message.group_id")
121
+ awsSqsMessageGroupId?: string;
122
+
123
+ @doc("AWS SQS message deduplication ID")
124
+ @encodedName("application/json", "messaging.aws_sqs.message.deduplication_id")
125
+ awsSqsMessageDeduplicationId?: string;
126
+
127
+ // ---------------------------------------------------------------------------
128
+ // Azure Service Bus-Specific Attributes
129
+ // ---------------------------------------------------------------------------
130
+
131
+ @doc("Azure Service Bus message enqueued time")
132
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.ServicebusMessageEnqueuedTime)
133
+ servicebusEnqueuedTime?: utcDateTime;
134
+ }
135
+
136
+ // =============================================================================
137
+ // Messaging Enumerations
138
+ // =============================================================================
139
+
140
+ @doc("Messaging systems")
141
+ enum MessagingSystem {
142
+ @doc("Apache Kafka")
143
+ kafka: "kafka",
144
+
145
+ @doc("RabbitMQ")
146
+ rabbitmq: "rabbitmq",
147
+
148
+ @doc("Amazon SQS")
149
+ awsSqs: "aws_sqs",
150
+
151
+ @doc("Amazon SNS")
152
+ awsSns: "aws_sns",
153
+
154
+ @doc("Azure Service Bus")
155
+ azureServiceBus: "azure_servicebus",
156
+
157
+ @doc("Azure Event Hubs")
158
+ azureEventHubs: "azure_eventhubs",
159
+
160
+ @doc("Google Cloud Pub/Sub")
161
+ gcpPubsub: "gcp_pubsub",
162
+
163
+ @doc("Apache ActiveMQ")
164
+ activemq: "activemq",
165
+
166
+ @doc("Apache ActiveMQ Artemis")
167
+ activemqArtemis: "activemq_artemis",
168
+
169
+ @doc("Redis Pub/Sub")
170
+ redisPubsub: "redis_pubsub",
171
+
172
+ @doc("Redis Streams")
173
+ redisStreams: "redis_streams",
174
+
175
+ @doc("NATS")
176
+ nats: "nats",
177
+
178
+ @doc("Pulsar")
179
+ pulsar: "pulsar",
180
+
181
+ @doc("JMS")
182
+ jms: "jms",
183
+
184
+ @doc("IBM MQ")
185
+ ibmmq: "ibmmq",
186
+
187
+ @doc("RocketMQ")
188
+ rocketmq: "rocketmq",
189
+ }
190
+
191
+ @doc("Messaging destination kinds")
192
+ enum MessagingDestinationKind {
193
+ @doc("Queue (point-to-point)")
194
+ queue: "queue",
195
+
196
+ @doc("Topic (publish-subscribe)")
197
+ topic: "topic",
198
+ }
199
+
200
+ @doc("Messaging operation types")
201
+ enum MessagingOperationType {
202
+ @doc("Message publish/send")
203
+ publish: "publish",
204
+
205
+ @doc("Message receive (non-blocking)")
206
+ receive: "receive",
207
+
208
+ @doc("Message process (blocking consumer)")
209
+ process: "process",
210
+
211
+ @doc("Create destination")
212
+ create: "create",
213
+
214
+ @doc("Settle/acknowledge message")
215
+ settle: "settle",
216
+ }
217
+
218
+ @doc("Message delivery guarantees")
219
+ enum MessagingDeliveryGuarantee {
220
+ @doc("At most once delivery")
221
+ atMostOnce: "at_most_once",
222
+
223
+ @doc("At least once delivery")
224
+ atLeastOnce: "at_least_once",
225
+
226
+ @doc("Exactly once delivery")
227
+ exactlyOnce: "exactly_once",
228
+ }
229
+
230
+ // =============================================================================
231
+ // Messaging Metrics
232
+ // =============================================================================
233
+
234
+ @doc("Messaging publish duration metric")
235
+ model MessagingPublishDurationMetric {
236
+ @doc("Metric name")
237
+ name: "messaging.publish.duration";
238
+
239
+ @doc("Metric unit (seconds)")
240
+ unit: "s";
241
+
242
+ @doc("Messaging system")
243
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.System)
244
+ system: MessagingSystem;
245
+
246
+ @doc("Destination name")
247
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationName)
248
+ destinationName: string;
249
+ }
250
+
251
+ @doc("Messaging receive duration metric")
252
+ model MessagingReceiveDurationMetric {
253
+ @doc("Metric name")
254
+ name: "messaging.receive.duration";
255
+
256
+ @doc("Metric unit (seconds)")
257
+ unit: "s";
258
+
259
+ @doc("Messaging system")
260
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.System)
261
+ system: MessagingSystem;
262
+
263
+ @doc("Destination name")
264
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationName)
265
+ destinationName: string;
266
+
267
+ @doc("Consumer group")
268
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.ConsumerGroupName)
269
+ consumerGroupName?: string;
270
+ }
271
+
272
+ @doc("Messaging process duration metric")
273
+ model MessagingProcessDurationMetric {
274
+ @doc("Metric name")
275
+ name: "messaging.process.duration";
276
+
277
+ @doc("Metric unit (seconds)")
278
+ unit: "s";
279
+
280
+ @doc("Messaging system")
281
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.System)
282
+ system: MessagingSystem;
283
+
284
+ @doc("Destination name")
285
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationName)
286
+ destinationName: string;
287
+ }
288
+
289
+ @doc("Messaging publish messages metric")
290
+ model MessagingPublishMessagesMetric {
291
+ @doc("Metric name")
292
+ name: "messaging.publish.messages";
293
+
294
+ @doc("Metric unit")
295
+ unit: "{message}";
296
+
297
+ @doc("Messaging system")
298
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.System)
299
+ system: MessagingSystem;
300
+
301
+ @doc("Destination name")
302
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Messaging.DestinationName)
303
+ destinationName: string;
304
+ }