@ancplua/qyl-api-schema 0.4.0 → 0.5.1
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.
- package/README.md +52 -64
- package/api/routes.tsp +90 -943
- package/api/runner.tsp +99 -0
- package/api/streaming.tsp +13 -299
- package/common/errors.tsp +14 -1
- package/common/pagination.tsp +1 -1
- package/common/types.tsp +2 -41
- package/generated/json-schema/qyl-api-schema.json +3868 -0
- package/generated/openapi/qyl.openapi.json +6919 -0
- package/generated/ts-runtime/api.d.ts +886 -0
- package/generated/ts-runtime/api.js +237 -0
- package/index.tsp +8 -34
- package/models/health.tsp +22 -0
- package/models/mcp-tools.tsp +217 -0
- package/models/runner-mcp.tsp +76 -0
- package/models/runner.tsp +67 -0
- package/models/session.tsp +1 -1
- package/otel/enums.tsp +1 -1
- package/otel/logs.tsp +1 -1
- package/otel/otel-conventions.tsp +0 -1
- package/otel/profiles.tsp +1 -1
- package/otel/resource.tsp +1 -1
- package/otel/span.tsp +9 -6
- package/package.json +56 -36
- package/VERSIONING.md +0 -88
- package/generated/README.md +0 -35
- package/intelligence/causal-rules.tsp +0 -34
- package/intelligence/diagnostic-patterns.tsp +0 -54
- package/intelligence/investigation-strategies.tsp +0 -37
- package/intelligence/main.tsp +0 -17
- package/intelligence/seed/patterns.tsp +0 -171
- package/intelligence/seed/rules.tsp +0 -43
- package/intelligence/seed/strategies.tsp +0 -55
- package/intelligence/signals.tsp +0 -60
- package/models/agent/agent-run.tsp +0 -154
- package/models/agent/tool-call.tsp +0 -122
- package/models/agent/workflow-checkpoint.tsp +0 -50
- package/models/agent/workflow-execution.tsp +0 -136
- package/models/alerting.tsp +0 -436
- package/models/configurator.tsp +0 -433
- package/models/control-graph.tsp +0 -197
- package/models/db.tsp +0 -767
- package/models/deployment.tsp +0 -365
- package/models/error.tsp +0 -433
- package/models/genai.tsp +0 -1305
- package/models/http.tsp +0 -547
- package/models/identity.tsp +0 -213
- package/models/issues.tsp +0 -484
- package/models/log.tsp +0 -140
- package/models/messaging.tsp +0 -304
- package/models/otel-config.tsp +0 -455
- package/models/retention.tsp +0 -240
- package/models/rpc.tsp +0 -309
- package/models/search.tsp +0 -243
- package/models/system.tsp +0 -400
- package/models/test.tsp +0 -346
- package/models/triage.tsp +0 -113
- package/models/workflow.tsp +0 -396
- package/models/workspace.tsp +0 -435
- package/otel/metrics.tsp +0 -358
- package/tspconfig.yaml +0 -49
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// <auto-generated/>
|
|
2
|
+
// Copyright (c) 2025-2026 ancplua
|
|
3
|
+
export const SortOrderValues = {
|
|
4
|
+
"asc": "asc",
|
|
5
|
+
"desc": "desc",
|
|
6
|
+
};
|
|
7
|
+
export const TimeBucketValues = {
|
|
8
|
+
"minute": "1m",
|
|
9
|
+
"fiveMinutes": "5m",
|
|
10
|
+
"fifteenMinutes": "15m",
|
|
11
|
+
"hour": "1h",
|
|
12
|
+
"day": "1d",
|
|
13
|
+
"week": "1w",
|
|
14
|
+
"auto": "auto",
|
|
15
|
+
};
|
|
16
|
+
export const SpanKindValues = {
|
|
17
|
+
"unspecified": 0,
|
|
18
|
+
"internal": 1,
|
|
19
|
+
"server": 2,
|
|
20
|
+
"client": 3,
|
|
21
|
+
"producer": 4,
|
|
22
|
+
"consumer": 5,
|
|
23
|
+
};
|
|
24
|
+
export const SpanStatusCodeValues = {
|
|
25
|
+
"unset": 0,
|
|
26
|
+
"ok": 1,
|
|
27
|
+
"error": 2,
|
|
28
|
+
};
|
|
29
|
+
export const SpanFlagsValues = {
|
|
30
|
+
"none": 0,
|
|
31
|
+
"sampled": 1,
|
|
32
|
+
"random": 2,
|
|
33
|
+
};
|
|
34
|
+
export const SeverityNumberValues = {
|
|
35
|
+
"unspecified": 0,
|
|
36
|
+
"trace": 1,
|
|
37
|
+
"trace2": 2,
|
|
38
|
+
"trace3": 3,
|
|
39
|
+
"trace4": 4,
|
|
40
|
+
"debug": 5,
|
|
41
|
+
"debug2": 6,
|
|
42
|
+
"debug3": 7,
|
|
43
|
+
"debug4": 8,
|
|
44
|
+
"info": 9,
|
|
45
|
+
"info2": 10,
|
|
46
|
+
"info3": 11,
|
|
47
|
+
"info4": 12,
|
|
48
|
+
"warn": 13,
|
|
49
|
+
"warn2": 14,
|
|
50
|
+
"warn3": 15,
|
|
51
|
+
"warn4": 16,
|
|
52
|
+
"error": 17,
|
|
53
|
+
"error2": 18,
|
|
54
|
+
"error3": 19,
|
|
55
|
+
"error4": 20,
|
|
56
|
+
"fatal": 21,
|
|
57
|
+
"fatal2": 22,
|
|
58
|
+
"fatal3": 23,
|
|
59
|
+
"fatal4": 24,
|
|
60
|
+
};
|
|
61
|
+
export const SeverityTextValues = {
|
|
62
|
+
"TRACE": "TRACE",
|
|
63
|
+
"DEBUG": "DEBUG",
|
|
64
|
+
"INFO": "INFO",
|
|
65
|
+
"WARN": "WARN",
|
|
66
|
+
"ERROR": "ERROR",
|
|
67
|
+
"FATAL": "FATAL",
|
|
68
|
+
};
|
|
69
|
+
export const MetricTypeValues = {
|
|
70
|
+
"gauge": "gauge",
|
|
71
|
+
"sum": "sum",
|
|
72
|
+
"histogram": "histogram",
|
|
73
|
+
"exponentialHistogram": "exponential_histogram",
|
|
74
|
+
"summary": "summary",
|
|
75
|
+
};
|
|
76
|
+
export const AggregationTemporalityValues = {
|
|
77
|
+
"unspecified": 0,
|
|
78
|
+
"delta": 1,
|
|
79
|
+
"cumulative": 2,
|
|
80
|
+
};
|
|
81
|
+
export const DataPointFlagsValues = {
|
|
82
|
+
"none": 0,
|
|
83
|
+
"noRecordedValue": 1,
|
|
84
|
+
};
|
|
85
|
+
export const InstrumentKindValues = {
|
|
86
|
+
"counter": "Counter",
|
|
87
|
+
"upDownCounter": "UpDownCounter",
|
|
88
|
+
"histogram": "Histogram",
|
|
89
|
+
"gauge": "Gauge",
|
|
90
|
+
"observableCounter": "ObservableCounter",
|
|
91
|
+
"observableGauge": "ObservableGauge",
|
|
92
|
+
"observableUpDownCounter": "ObservableUpDownCounter",
|
|
93
|
+
};
|
|
94
|
+
export const TelemetrySdkLanguageValues = {
|
|
95
|
+
"cpp": "cpp",
|
|
96
|
+
"dotnet": "dotnet",
|
|
97
|
+
"erlang": "erlang",
|
|
98
|
+
"go": "go",
|
|
99
|
+
"java": "java",
|
|
100
|
+
"nodejs": "nodejs",
|
|
101
|
+
"php": "php",
|
|
102
|
+
"python": "python",
|
|
103
|
+
"ruby": "ruby",
|
|
104
|
+
"rust": "rust",
|
|
105
|
+
"swift": "swift",
|
|
106
|
+
"webjs": "webjs",
|
|
107
|
+
};
|
|
108
|
+
export const ErrorTypeValues = {
|
|
109
|
+
"error": "_OTHER",
|
|
110
|
+
"timeout": "TIMEOUT",
|
|
111
|
+
"connectionRefused": "CONNECTION_REFUSED",
|
|
112
|
+
"dnsError": "DNS_ERROR",
|
|
113
|
+
"tlsError": "TLS_ERROR",
|
|
114
|
+
"authError": "AUTH_ERROR",
|
|
115
|
+
"permissionDenied": "PERMISSION_DENIED",
|
|
116
|
+
"notFound": "NOT_FOUND",
|
|
117
|
+
"resourceExhausted": "RESOURCE_EXHAUSTED",
|
|
118
|
+
"invalidArgument": "INVALID_ARGUMENT",
|
|
119
|
+
"cancelled": "CANCELLED",
|
|
120
|
+
};
|
|
121
|
+
export const EventDomainValues = {
|
|
122
|
+
"browser": "browser",
|
|
123
|
+
"device": "device",
|
|
124
|
+
"k8s": "k8s",
|
|
125
|
+
"session": "session",
|
|
126
|
+
"genAi": "gen_ai",
|
|
127
|
+
"exception": "exception",
|
|
128
|
+
"log": "log",
|
|
129
|
+
};
|
|
130
|
+
export const OriginalPayloadFormatValues = {
|
|
131
|
+
"pprof": "pprof",
|
|
132
|
+
"jfr": "jfr",
|
|
133
|
+
"linuxPerf": "linux_perf",
|
|
134
|
+
};
|
|
135
|
+
export const ProfileFrameTypeValues = {
|
|
136
|
+
"beam": "beam",
|
|
137
|
+
"cpython": "cpython",
|
|
138
|
+
"dotnet": "dotnet",
|
|
139
|
+
"go": "go",
|
|
140
|
+
"jvm": "jvm",
|
|
141
|
+
"kernel": "kernel",
|
|
142
|
+
"native": "native",
|
|
143
|
+
"perl": "perl",
|
|
144
|
+
"php": "php",
|
|
145
|
+
"ruby": "ruby",
|
|
146
|
+
"rust": "rust",
|
|
147
|
+
"v8js": "v8js",
|
|
148
|
+
};
|
|
149
|
+
export const CloudProviderValues = {
|
|
150
|
+
"alibabaCloud": "alibaba_cloud",
|
|
151
|
+
"aws": "aws",
|
|
152
|
+
"azure": "azure",
|
|
153
|
+
"gcp": "gcp",
|
|
154
|
+
"heroku": "heroku",
|
|
155
|
+
"ibmCloud": "ibm_cloud",
|
|
156
|
+
"tencentCloud": "tencent_cloud",
|
|
157
|
+
};
|
|
158
|
+
export const HostArchValues = {
|
|
159
|
+
"amd64": "amd64",
|
|
160
|
+
"arm32": "arm32",
|
|
161
|
+
"arm64": "arm64",
|
|
162
|
+
"ia64": "ia64",
|
|
163
|
+
"ppc32": "ppc32",
|
|
164
|
+
"ppc64": "ppc64",
|
|
165
|
+
"s390x": "s390x",
|
|
166
|
+
"x86": "x86",
|
|
167
|
+
};
|
|
168
|
+
export const OsTypeValues = {
|
|
169
|
+
"windows": "windows",
|
|
170
|
+
"linux": "linux",
|
|
171
|
+
"darwin": "darwin",
|
|
172
|
+
"freebsd": "freebsd",
|
|
173
|
+
"netbsd": "netbsd",
|
|
174
|
+
"openbsd": "openbsd",
|
|
175
|
+
"dragonflybsd": "dragonflybsd",
|
|
176
|
+
"hpux": "hpux",
|
|
177
|
+
"aix": "aix",
|
|
178
|
+
"solaris": "solaris",
|
|
179
|
+
"zOs": "z_os",
|
|
180
|
+
};
|
|
181
|
+
export const SessionEventNameValues = {
|
|
182
|
+
"sessionStart": "session.start",
|
|
183
|
+
"sessionEnd": "session.end",
|
|
184
|
+
};
|
|
185
|
+
export const SessionStateValues = {
|
|
186
|
+
"active": "active",
|
|
187
|
+
"idle": "idle",
|
|
188
|
+
"ended": "ended",
|
|
189
|
+
"timedOut": "timed_out",
|
|
190
|
+
"invalidated": "invalidated",
|
|
191
|
+
};
|
|
192
|
+
export const DeviceTypeValues = {
|
|
193
|
+
"desktop": "desktop",
|
|
194
|
+
"mobile": "mobile",
|
|
195
|
+
"tablet": "tablet",
|
|
196
|
+
"tv": "tv",
|
|
197
|
+
"console": "console",
|
|
198
|
+
"wearable": "wearable",
|
|
199
|
+
"iot": "iot",
|
|
200
|
+
"bot": "bot",
|
|
201
|
+
"unknown": "unknown",
|
|
202
|
+
};
|
|
203
|
+
export const HealthStatusValues = {
|
|
204
|
+
"healthy": "healthy",
|
|
205
|
+
"degraded": "degraded",
|
|
206
|
+
"unhealthy": "unhealthy",
|
|
207
|
+
};
|
|
208
|
+
export const RunnerResourceLifecycleValues = {
|
|
209
|
+
"pending": "pending",
|
|
210
|
+
"starting": "starting",
|
|
211
|
+
"ready": "ready",
|
|
212
|
+
"stopping": "stopping",
|
|
213
|
+
"stopped": "stopped",
|
|
214
|
+
"failed": "failed",
|
|
215
|
+
};
|
|
216
|
+
export const RunnerResourceKindValues = {
|
|
217
|
+
"collector": "collector",
|
|
218
|
+
"project": "project",
|
|
219
|
+
"command": "command",
|
|
220
|
+
"stdio": "stdio",
|
|
221
|
+
"http": "http",
|
|
222
|
+
"inproc": "inproc",
|
|
223
|
+
};
|
|
224
|
+
export const RunnerLogStreamValues = {
|
|
225
|
+
"stdout": "out",
|
|
226
|
+
"stderr": "err",
|
|
227
|
+
};
|
|
228
|
+
export const McpDataModeValues = {
|
|
229
|
+
"live": "live",
|
|
230
|
+
"demo": "demo",
|
|
231
|
+
};
|
|
232
|
+
export const FetchTelemetryViewValues = {
|
|
233
|
+
"traces": "traces",
|
|
234
|
+
"trace": "trace",
|
|
235
|
+
"logs": "logs",
|
|
236
|
+
"mcpStats": "mcp_stats",
|
|
237
|
+
};
|
package/index.tsp
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// =============================================================================
|
|
4
|
-
// Consumer-facing barrel. Mirrors main.tsp minus local emit routing.
|
|
5
|
-
// The local emitters depend on `file:` packages
|
|
6
|
-
// (@ancplua/typespec-emit-*) which are not shipped to registry consumers and
|
|
7
|
-
// would break TypeSpec import resolution.
|
|
8
|
-
//
|
|
9
|
-
// Use main.tsp inside this repo for local `tsp compile`; downstream consumers
|
|
10
|
-
// reach the public surface through this file via the `.` export.
|
|
11
|
-
// =============================================================================
|
|
1
|
+
// @ancplua/qyl-api-schema — published TypeSpec entry point.
|
|
2
|
+
// Build-only emitter configuration belongs in main.tsp and is intentionally absent here.
|
|
12
3
|
|
|
4
|
+
import "@typespec/events";
|
|
13
5
|
import "@typespec/http";
|
|
14
|
-
import "@typespec/rest";
|
|
15
6
|
import "@typespec/openapi";
|
|
16
|
-
import "@typespec/openapi3";
|
|
17
|
-
import "@typespec/versioning";
|
|
18
7
|
import "@typespec/sse";
|
|
19
|
-
import "@typespec/events";
|
|
20
8
|
|
|
21
9
|
import "./generated/otel-keys.gen.tsp";
|
|
22
10
|
|
|
@@ -28,28 +16,14 @@ import "./otel/enums.tsp";
|
|
|
28
16
|
import "./otel/resource.tsp";
|
|
29
17
|
import "./otel/span.tsp";
|
|
30
18
|
import "./otel/logs.tsp";
|
|
31
|
-
import "./otel/metrics.tsp";
|
|
32
19
|
import "./otel/profiles.tsp";
|
|
33
20
|
|
|
34
|
-
import "./models/genai.tsp";
|
|
35
|
-
import "./models/http.tsp";
|
|
36
|
-
import "./models/rpc.tsp";
|
|
37
|
-
import "./models/messaging.tsp";
|
|
38
|
-
import "./models/db.tsp";
|
|
39
21
|
import "./models/session.tsp";
|
|
40
|
-
import "./models/
|
|
41
|
-
import "./models/
|
|
42
|
-
import "./models/
|
|
43
|
-
import "./models/
|
|
44
|
-
import "./models/deployment.tsp";
|
|
45
|
-
import "./models/system.tsp";
|
|
46
|
-
import "./models/identity.tsp";
|
|
47
|
-
import "./models/control-graph.tsp";
|
|
22
|
+
import "./models/health.tsp";
|
|
23
|
+
import "./models/runner.tsp";
|
|
24
|
+
import "./models/runner-mcp.tsp";
|
|
25
|
+
import "./models/mcp-tools.tsp";
|
|
48
26
|
|
|
49
27
|
import "./api/routes.tsp";
|
|
50
28
|
import "./api/streaming.tsp";
|
|
51
|
-
|
|
52
|
-
using TypeSpec.Http;
|
|
53
|
-
using TypeSpec.Rest;
|
|
54
|
-
using TypeSpec.OpenAPI;
|
|
55
|
-
using TypeSpec.Versioning;
|
|
29
|
+
import "./api/runner.tsp";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
namespace Qyl.Api.Contracts.Health;
|
|
2
|
+
|
|
3
|
+
@doc("Health state reported by a qyl-managed process.")
|
|
4
|
+
enum HealthStatus {
|
|
5
|
+
healthy: "healthy",
|
|
6
|
+
degraded: "degraded",
|
|
7
|
+
unhealthy: "unhealthy",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@doc("One named health-check result.")
|
|
11
|
+
model HealthCheckEntry {
|
|
12
|
+
status: HealthStatus;
|
|
13
|
+
description?: string;
|
|
14
|
+
durationMs: float64;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@doc("Readiness or liveness report returned by /health and /alive.")
|
|
18
|
+
model HealthReport {
|
|
19
|
+
status: HealthStatus;
|
|
20
|
+
totalDurationMs: float64;
|
|
21
|
+
entries: Record<HealthCheckEntry>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import "../common/types.tsp";
|
|
2
|
+
import "../otel/logs.tsp";
|
|
3
|
+
import "../otel/span.tsp";
|
|
4
|
+
import "./session.tsp";
|
|
5
|
+
|
|
6
|
+
using Qyl.Api.Contracts.Common;
|
|
7
|
+
using Qyl.Api.Contracts.Domains.Observe.Session;
|
|
8
|
+
using Qyl.Api.Contracts.OTel.Logs;
|
|
9
|
+
using Qyl.Api.Contracts.OTel.Traces;
|
|
10
|
+
|
|
11
|
+
namespace Qyl.Api.Contracts.Mcp.Tools;
|
|
12
|
+
|
|
13
|
+
@doc("Whether a qyl MCP tool read live collector data or the explicit demo dataset.")
|
|
14
|
+
enum McpDataMode {
|
|
15
|
+
live: "live",
|
|
16
|
+
demo: "demo",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@doc("Data projection requested by the app-only fetch_telemetry tool.")
|
|
20
|
+
enum FetchTelemetryView {
|
|
21
|
+
traces: "traces",
|
|
22
|
+
trace: "trace",
|
|
23
|
+
logs: "logs",
|
|
24
|
+
mcpStats: "mcp_stats",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@doc("Input for display_traces.")
|
|
28
|
+
model DisplayTracesInput {
|
|
29
|
+
@encodedName("application/json", "trace_id")
|
|
30
|
+
traceId?: TraceId;
|
|
31
|
+
@encodedName("application/json", "session_id")
|
|
32
|
+
sessionId?: SessionId;
|
|
33
|
+
@minValue(1)
|
|
34
|
+
@maxValue(100)
|
|
35
|
+
limit?: int32 = 20;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@doc("Structured output for display_traces.")
|
|
39
|
+
model DisplayTracesOutput {
|
|
40
|
+
traces: Trace[];
|
|
41
|
+
@encodedName("application/json", "selected_trace_id")
|
|
42
|
+
selectedTraceId?: TraceId;
|
|
43
|
+
mode: McpDataMode;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@doc("Input for display_mcp_dashboard.")
|
|
47
|
+
model DisplayMcpDashboardInput {
|
|
48
|
+
@minValue(1)
|
|
49
|
+
@maxValue(168)
|
|
50
|
+
hours?: float64 = 24;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@doc("Structured output for display_mcp_dashboard.")
|
|
54
|
+
model DisplayMcpDashboardOutput {
|
|
55
|
+
stats: McpDashboardStats;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@doc("Input for list_traces.")
|
|
59
|
+
model ListTracesInput {
|
|
60
|
+
@minValue(1)
|
|
61
|
+
@maxValue(100)
|
|
62
|
+
limit?: int32 = 20;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@doc("Structured output for list_traces.")
|
|
66
|
+
model ListTracesOutput {
|
|
67
|
+
traces: TraceSummary[];
|
|
68
|
+
mode: McpDataMode;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@doc("Input for get_trace.")
|
|
72
|
+
model GetTraceInput {
|
|
73
|
+
@encodedName("application/json", "trace_id")
|
|
74
|
+
traceId: TraceId;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@doc("Structured output for get_trace.")
|
|
78
|
+
model GetTraceOutput {
|
|
79
|
+
trace: Trace;
|
|
80
|
+
mode: McpDataMode;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@doc("Input for list_sessions.")
|
|
84
|
+
model ListSessionsInput {
|
|
85
|
+
@minValue(1)
|
|
86
|
+
@maxValue(100)
|
|
87
|
+
limit?: int32 = 20;
|
|
88
|
+
@encodedName("application/json", "active_only")
|
|
89
|
+
activeOnly?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@doc("Structured output for list_sessions.")
|
|
93
|
+
model ListSessionsOutput {
|
|
94
|
+
sessions: SessionEntity[];
|
|
95
|
+
mode: McpDataMode;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@doc("Input for search_logs.")
|
|
99
|
+
model SearchLogsInput {
|
|
100
|
+
@encodedName("application/json", "trace_id")
|
|
101
|
+
traceId?: TraceId;
|
|
102
|
+
@encodedName("application/json", "service_name")
|
|
103
|
+
serviceName?: string;
|
|
104
|
+
@encodedName("application/json", "severity_min")
|
|
105
|
+
@minValue(1)
|
|
106
|
+
@maxValue(24)
|
|
107
|
+
severityMin?: int32;
|
|
108
|
+
query?: string;
|
|
109
|
+
@minValue(1)
|
|
110
|
+
@maxValue(200)
|
|
111
|
+
limit?: int32 = 50;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@doc("Structured output for search_logs.")
|
|
115
|
+
model SearchLogsOutput {
|
|
116
|
+
logs: LogRecord[];
|
|
117
|
+
mode: McpDataMode;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@doc("Input for the app-only fetch_telemetry tool.")
|
|
121
|
+
model FetchTelemetryInput {
|
|
122
|
+
view: FetchTelemetryView;
|
|
123
|
+
@encodedName("application/json", "trace_id")
|
|
124
|
+
traceId?: TraceId;
|
|
125
|
+
@encodedName("application/json", "service_name")
|
|
126
|
+
serviceName?: string;
|
|
127
|
+
@encodedName("application/json", "severity_min")
|
|
128
|
+
@minValue(1)
|
|
129
|
+
@maxValue(24)
|
|
130
|
+
severityMin?: int32;
|
|
131
|
+
query?: string;
|
|
132
|
+
@minValue(1)
|
|
133
|
+
@maxValue(200)
|
|
134
|
+
limit?: int32;
|
|
135
|
+
@minValue(1)
|
|
136
|
+
@maxValue(168)
|
|
137
|
+
hours?: float64;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@doc("Structured output for the app-only fetch_telemetry tool.")
|
|
141
|
+
model FetchTelemetryOutput {
|
|
142
|
+
traces?: Trace[];
|
|
143
|
+
trace?: Trace;
|
|
144
|
+
logs?: LogRecord[];
|
|
145
|
+
stats?: McpDashboardStats;
|
|
146
|
+
mode: McpDataMode;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@doc("Aggregate MCP traffic statistics shown by qyl.mcp.")
|
|
150
|
+
model McpDashboardStats {
|
|
151
|
+
window: McpDashboardWindow;
|
|
152
|
+
buckets: McpDashboardBucket[];
|
|
153
|
+
totals: McpDashboardTotals;
|
|
154
|
+
@encodedName("application/json", "by_server")
|
|
155
|
+
byServer: McpNameRequestCount[];
|
|
156
|
+
@encodedName("application/json", "by_transport")
|
|
157
|
+
byTransport: McpNameRequestCount[];
|
|
158
|
+
@encodedName("application/json", "by_method")
|
|
159
|
+
byMethod: McpNameRequestCount[];
|
|
160
|
+
tools: McpToolStats[];
|
|
161
|
+
@encodedName("application/json", "span_count_analyzed")
|
|
162
|
+
@minValue(0)
|
|
163
|
+
spanCountAnalyzed: int32;
|
|
164
|
+
truncated: boolean;
|
|
165
|
+
mode: McpDataMode;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
model McpDashboardWindow {
|
|
169
|
+
start: utcDateTime;
|
|
170
|
+
end: utcDateTime;
|
|
171
|
+
@encodedName("application/json", "bucket_ms")
|
|
172
|
+
@minValue(0)
|
|
173
|
+
bucketMs: float64;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
model McpDashboardBucket {
|
|
177
|
+
start: utcDateTime;
|
|
178
|
+
@minValue(0)
|
|
179
|
+
requests: int32;
|
|
180
|
+
@minValue(0)
|
|
181
|
+
errors: int32;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
model McpDashboardTotals {
|
|
185
|
+
@minValue(0)
|
|
186
|
+
requests: int32;
|
|
187
|
+
@minValue(0)
|
|
188
|
+
errors: int32;
|
|
189
|
+
@encodedName("application/json", "error_rate")
|
|
190
|
+
@minValue(0)
|
|
191
|
+
@maxValue(1)
|
|
192
|
+
errorRate: float64;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
model McpNameRequestCount {
|
|
196
|
+
name: string;
|
|
197
|
+
@minValue(0)
|
|
198
|
+
requests: int32;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
model McpToolStats {
|
|
202
|
+
name: string;
|
|
203
|
+
@minValue(0)
|
|
204
|
+
requests: int32;
|
|
205
|
+
@minValue(0)
|
|
206
|
+
errors: int32;
|
|
207
|
+
@encodedName("application/json", "error_rate")
|
|
208
|
+
@minValue(0)
|
|
209
|
+
@maxValue(1)
|
|
210
|
+
errorRate: float64;
|
|
211
|
+
@encodedName("application/json", "avg_ms")
|
|
212
|
+
@minValue(0)
|
|
213
|
+
avgMs: float64;
|
|
214
|
+
@encodedName("application/json", "p95_ms")
|
|
215
|
+
@minValue(0)
|
|
216
|
+
p95Ms: float64;
|
|
217
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
namespace Qyl.Api.Contracts.Runner.Mcp;
|
|
2
|
+
|
|
3
|
+
@doc("Stable qyl projection of an MCP tool advertised by a runner resource.")
|
|
4
|
+
model RunnerMcpTool {
|
|
5
|
+
name: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
inputSchema: Record<unknown>;
|
|
9
|
+
outputSchema?: Record<unknown>;
|
|
10
|
+
annotations?: Record<unknown>;
|
|
11
|
+
@encodedName("application/json", "_meta")
|
|
12
|
+
metadata?: Record<unknown>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@doc("MCP tools currently advertised by a runner resource.")
|
|
16
|
+
model RunnerMcpToolsResponse {
|
|
17
|
+
tools: RunnerMcpTool[];
|
|
18
|
+
nextCursor?: string;
|
|
19
|
+
@encodedName("application/json", "_meta")
|
|
20
|
+
metadata?: Record<unknown>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@doc("Tool call accepted by the runner's MCP projection.")
|
|
24
|
+
model RunnerMcpToolCallRequest {
|
|
25
|
+
name: string;
|
|
26
|
+
arguments?: Record<unknown>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@doc("One MCP content item projected onto a stable qyl JSON shape.")
|
|
30
|
+
model RunnerMcpContent {
|
|
31
|
+
type: string;
|
|
32
|
+
text?: string;
|
|
33
|
+
data?: string;
|
|
34
|
+
mimeType?: string;
|
|
35
|
+
uri?: url;
|
|
36
|
+
name?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
@minValue(0)
|
|
40
|
+
size?: int64;
|
|
41
|
+
resource?: Record<unknown>;
|
|
42
|
+
annotations?: Record<unknown>;
|
|
43
|
+
@encodedName("application/json", "_meta")
|
|
44
|
+
metadata?: Record<unknown>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@doc("Stable qyl projection of an MCP tool-call result.")
|
|
48
|
+
model RunnerMcpToolCallResponse {
|
|
49
|
+
content: RunnerMcpContent[];
|
|
50
|
+
structuredContent?: Record<unknown>;
|
|
51
|
+
isError: boolean;
|
|
52
|
+
@encodedName("application/json", "_meta")
|
|
53
|
+
metadata?: Record<unknown>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@doc("Resource URI accepted by the runner's MCP projection.")
|
|
57
|
+
model RunnerMcpResourceReadRequest {
|
|
58
|
+
uri: url;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@doc("Text or base64 resource content returned by an MCP server. Exactly one of text or blob is present.")
|
|
62
|
+
model RunnerMcpResourceContent {
|
|
63
|
+
uri: url;
|
|
64
|
+
mimeType?: string;
|
|
65
|
+
text?: string;
|
|
66
|
+
blob?: string;
|
|
67
|
+
@encodedName("application/json", "_meta")
|
|
68
|
+
metadata?: Record<unknown>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@doc("Stable qyl projection of an MCP resources/read result.")
|
|
72
|
+
model RunnerMcpResourceReadResponse {
|
|
73
|
+
contents: RunnerMcpResourceContent[];
|
|
74
|
+
@encodedName("application/json", "_meta")
|
|
75
|
+
metadata?: Record<unknown>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "@typespec/http";
|
|
2
|
+
|
|
3
|
+
using TypeSpec.Http;
|
|
4
|
+
|
|
5
|
+
namespace Qyl.Api.Contracts.Runner;
|
|
6
|
+
|
|
7
|
+
@doc("Lifecycle state of a resource supervised by the local qyl runner.")
|
|
8
|
+
enum RunnerResourceLifecycle {
|
|
9
|
+
pending: "pending",
|
|
10
|
+
starting: "starting",
|
|
11
|
+
ready: "ready",
|
|
12
|
+
stopping: "stopping",
|
|
13
|
+
stopped: "stopped",
|
|
14
|
+
failed: "failed",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@doc("Kind of process or connection supervised by the local qyl runner.")
|
|
18
|
+
enum RunnerResourceKind {
|
|
19
|
+
collector: "collector",
|
|
20
|
+
project: "project",
|
|
21
|
+
command: "command",
|
|
22
|
+
stdio: "stdio",
|
|
23
|
+
http: "http",
|
|
24
|
+
inproc: "inproc",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@doc("Identity reported by a connected MCP server during initialization.")
|
|
28
|
+
model RunnerMcpServerInfo {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@doc("Current client-visible state of one runner resource.")
|
|
34
|
+
model RunnerResourceState {
|
|
35
|
+
name: string;
|
|
36
|
+
lifecycle: RunnerResourceLifecycle;
|
|
37
|
+
timestamp: utcDateTime;
|
|
38
|
+
kind?: RunnerResourceKind;
|
|
39
|
+
@minValue(1)
|
|
40
|
+
@maxValue(65535)
|
|
41
|
+
allocatedPort?: int32;
|
|
42
|
+
endpoint?: url;
|
|
43
|
+
lastError?: string;
|
|
44
|
+
serverInfo?: RunnerMcpServerInfo;
|
|
45
|
+
@minValue(0)
|
|
46
|
+
toolCount?: int32;
|
|
47
|
+
@minValue(0)
|
|
48
|
+
restarts?: int32;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@doc("A runner lifecycle action was accepted and continues asynchronously.")
|
|
52
|
+
model RunnerActionAccepted {
|
|
53
|
+
@statusCode statusCode: 202;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@doc("Origin stream for one captured child-process log line.")
|
|
57
|
+
enum RunnerLogStream {
|
|
58
|
+
stdout: "out",
|
|
59
|
+
stderr: "err",
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@doc("One bounded child-process log line exposed by the runner.")
|
|
63
|
+
model RunnerLogLine {
|
|
64
|
+
resource: string;
|
|
65
|
+
stream: RunnerLogStream;
|
|
66
|
+
line: string;
|
|
67
|
+
}
|
package/models/session.tsp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
//
|
|
2
|
+
// Qyl session API contracts
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// User session telemetry attributes.
|
|
5
5
|
// =============================================================================
|
package/otel/enums.tsp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
//
|
|
2
|
+
// OpenTelemetry JSON projection enumerations
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// All OTel standard enumerations following OTel Semantic Conventions.
|
|
5
5
|
// =============================================================================
|
package/otel/logs.tsp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
//
|
|
2
|
+
// OpenTelemetry log JSON projection
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Structured logging following OTel log data model.
|
|
5
5
|
// =============================================================================
|