@ancplua/qyl-api-schema 0.5.0 → 0.5.2
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 +5 -3
- package/api/runner.tsp +27 -2
- package/common/types.tsp +0 -35
- package/generated/json-schema/qyl-api-schema.json +4016 -0
- package/generated/openapi/qyl.openapi.json +7067 -0
- package/generated/ts-runtime/api.d.ts +205 -5
- package/generated/ts-runtime/api.js +30 -0
- package/index.tsp +1 -0
- package/models/mcp-tools.tsp +217 -0
- package/models/runner-mcp.tsp +92 -3
- package/models/runner.tsp +31 -1
- package/otel/span.tsp +8 -5
- package/package.json +12 -4
|
@@ -247,11 +247,46 @@ export declare const RunnerResourceLifecycleValues: {
|
|
|
247
247
|
readonly failed: "failed";
|
|
248
248
|
};
|
|
249
249
|
export type RunnerResourceLifecycle = typeof RunnerResourceLifecycleValues[keyof typeof RunnerResourceLifecycleValues];
|
|
250
|
+
export declare const RunnerResourceKindValues: {
|
|
251
|
+
readonly collector: "collector";
|
|
252
|
+
readonly project: "project";
|
|
253
|
+
readonly command: "command";
|
|
254
|
+
readonly stdio: "stdio";
|
|
255
|
+
readonly http: "http";
|
|
256
|
+
readonly inproc: "inproc";
|
|
257
|
+
};
|
|
258
|
+
export type RunnerResourceKind = typeof RunnerResourceKindValues[keyof typeof RunnerResourceKindValues];
|
|
250
259
|
export declare const RunnerLogStreamValues: {
|
|
251
260
|
readonly stdout: "out";
|
|
252
261
|
readonly stderr: "err";
|
|
253
262
|
};
|
|
254
263
|
export type RunnerLogStream = typeof RunnerLogStreamValues[keyof typeof RunnerLogStreamValues];
|
|
264
|
+
export declare const RunnerMcpToolTaskSupportValues: {
|
|
265
|
+
readonly forbidden: "forbidden";
|
|
266
|
+
readonly optional: "optional";
|
|
267
|
+
readonly required: "required";
|
|
268
|
+
};
|
|
269
|
+
export type RunnerMcpToolTaskSupport = typeof RunnerMcpToolTaskSupportValues[keyof typeof RunnerMcpToolTaskSupportValues];
|
|
270
|
+
export declare const RunnerMcpTaskStatusValues: {
|
|
271
|
+
readonly working: "working";
|
|
272
|
+
readonly inputRequired: "input_required";
|
|
273
|
+
readonly completed: "completed";
|
|
274
|
+
readonly failed: "failed";
|
|
275
|
+
readonly cancelled: "cancelled";
|
|
276
|
+
};
|
|
277
|
+
export type RunnerMcpTaskStatus = typeof RunnerMcpTaskStatusValues[keyof typeof RunnerMcpTaskStatusValues];
|
|
278
|
+
export declare const McpDataModeValues: {
|
|
279
|
+
readonly live: "live";
|
|
280
|
+
readonly demo: "demo";
|
|
281
|
+
};
|
|
282
|
+
export type McpDataMode = typeof McpDataModeValues[keyof typeof McpDataModeValues];
|
|
283
|
+
export declare const FetchTelemetryViewValues: {
|
|
284
|
+
readonly traces: "traces";
|
|
285
|
+
readonly trace: "trace";
|
|
286
|
+
readonly logs: "logs";
|
|
287
|
+
readonly mcpStats: "mcp_stats";
|
|
288
|
+
};
|
|
289
|
+
export type FetchTelemetryView = typeof FetchTelemetryViewValues[keyof typeof FetchTelemetryViewValues];
|
|
255
290
|
export type AttributeValue = string | boolean | number | string[] | boolean[] | number[];
|
|
256
291
|
export type ApiError = NotFoundError | ValidationError | UnauthorizedError | ForbiddenError | ConflictError | RateLimitError | InternalServerError | BadGatewayError | ServiceUnavailableError;
|
|
257
292
|
export type LogBody = LogBodyString | LogBodyKvList | LogBodyArray | LogBodyBytes;
|
|
@@ -422,9 +457,8 @@ export interface SpanStatus {
|
|
|
422
457
|
"code": SpanStatusCode;
|
|
423
458
|
"message"?: string;
|
|
424
459
|
}
|
|
425
|
-
export interface
|
|
460
|
+
export interface TraceSummary {
|
|
426
461
|
"trace_id": TraceId;
|
|
427
|
-
"spans": Span[];
|
|
428
462
|
"root_span"?: Span;
|
|
429
463
|
"span_count": number;
|
|
430
464
|
"duration_ns": number;
|
|
@@ -433,6 +467,9 @@ export interface Trace {
|
|
|
433
467
|
"services": string[];
|
|
434
468
|
"has_error": boolean;
|
|
435
469
|
}
|
|
470
|
+
export interface Trace extends TraceSummary {
|
|
471
|
+
"spans": Span[];
|
|
472
|
+
}
|
|
436
473
|
export interface SpanQueryFilters {
|
|
437
474
|
"trace_id"?: TraceId;
|
|
438
475
|
"parent_span_id"?: SpanId;
|
|
@@ -651,34 +688,60 @@ export interface HealthReport {
|
|
|
651
688
|
"totalDurationMs": number;
|
|
652
689
|
"entries": Record<string, HealthCheckEntry>;
|
|
653
690
|
}
|
|
691
|
+
export interface RunnerMcpServerInfo {
|
|
692
|
+
"name": string;
|
|
693
|
+
"version": string;
|
|
694
|
+
}
|
|
654
695
|
export interface RunnerResourceState {
|
|
655
696
|
"name": string;
|
|
656
697
|
"lifecycle": RunnerResourceLifecycle;
|
|
657
698
|
"timestamp": string;
|
|
658
|
-
"kind"?:
|
|
699
|
+
"kind"?: RunnerResourceKind;
|
|
659
700
|
"allocatedPort"?: number;
|
|
660
701
|
"endpoint"?: string;
|
|
661
702
|
"lastError"?: string;
|
|
703
|
+
"serverInfo"?: RunnerMcpServerInfo;
|
|
704
|
+
"toolCount"?: number;
|
|
705
|
+
"restarts"?: number;
|
|
662
706
|
}
|
|
663
707
|
export interface RunnerLogLine {
|
|
664
708
|
"resource": string;
|
|
665
709
|
"stream": RunnerLogStream;
|
|
666
710
|
"line": string;
|
|
667
711
|
}
|
|
712
|
+
export interface RunnerMcpIcon {
|
|
713
|
+
"src": string;
|
|
714
|
+
"mimeType"?: string;
|
|
715
|
+
"sizes"?: string[];
|
|
716
|
+
"theme"?: string;
|
|
717
|
+
}
|
|
718
|
+
export interface RunnerMcpToolExecution {
|
|
719
|
+
"taskSupport"?: RunnerMcpToolTaskSupport;
|
|
720
|
+
}
|
|
668
721
|
export interface RunnerMcpTool {
|
|
669
722
|
"name": string;
|
|
670
723
|
"title"?: string;
|
|
671
724
|
"description"?: string;
|
|
672
|
-
"inputSchema"
|
|
725
|
+
"inputSchema": Record<string, unknown>;
|
|
673
726
|
"outputSchema"?: Record<string, unknown>;
|
|
727
|
+
"annotations"?: Record<string, unknown>;
|
|
728
|
+
"execution"?: RunnerMcpToolExecution;
|
|
729
|
+
"icons"?: RunnerMcpIcon[];
|
|
730
|
+
"_meta"?: Record<string, unknown>;
|
|
674
731
|
}
|
|
675
732
|
export interface RunnerMcpToolsResponse {
|
|
676
733
|
"tools": RunnerMcpTool[];
|
|
677
734
|
"nextCursor"?: string;
|
|
735
|
+
"_meta"?: Record<string, unknown>;
|
|
678
736
|
}
|
|
679
737
|
export interface RunnerMcpToolCallRequest {
|
|
680
738
|
"name": string;
|
|
681
739
|
"arguments"?: Record<string, unknown>;
|
|
740
|
+
"task"?: RunnerMcpTaskMetadata;
|
|
741
|
+
"_meta"?: Record<string, unknown>;
|
|
742
|
+
}
|
|
743
|
+
export interface RunnerMcpTaskMetadata {
|
|
744
|
+
"ttl"?: number;
|
|
682
745
|
}
|
|
683
746
|
export interface RunnerMcpContent {
|
|
684
747
|
"type": string;
|
|
@@ -690,14 +753,151 @@ export interface RunnerMcpContent {
|
|
|
690
753
|
"title"?: string;
|
|
691
754
|
"description"?: string;
|
|
692
755
|
"size"?: number;
|
|
693
|
-
"
|
|
756
|
+
"icons"?: RunnerMcpIcon[];
|
|
757
|
+
"resource"?: RunnerMcpResourceContent;
|
|
758
|
+
"id"?: string;
|
|
759
|
+
"input"?: unknown;
|
|
760
|
+
"toolUseId"?: string;
|
|
761
|
+
"content"?: RunnerMcpContent[];
|
|
762
|
+
"structuredContent"?: Record<string, unknown>;
|
|
763
|
+
"isError"?: boolean;
|
|
694
764
|
"annotations"?: Record<string, unknown>;
|
|
695
765
|
"_meta"?: Record<string, unknown>;
|
|
696
766
|
}
|
|
767
|
+
export interface RunnerMcpResourceContent {
|
|
768
|
+
"uri": string;
|
|
769
|
+
"mimeType"?: string;
|
|
770
|
+
"text"?: string;
|
|
771
|
+
"blob"?: string;
|
|
772
|
+
"_meta"?: Record<string, unknown>;
|
|
773
|
+
}
|
|
774
|
+
export interface RunnerMcpTask {
|
|
775
|
+
"taskId": string;
|
|
776
|
+
"status": RunnerMcpTaskStatus;
|
|
777
|
+
"statusMessage"?: string;
|
|
778
|
+
"createdAt": string;
|
|
779
|
+
"lastUpdatedAt": string;
|
|
780
|
+
"ttl"?: number;
|
|
781
|
+
"pollInterval"?: number;
|
|
782
|
+
}
|
|
697
783
|
export interface RunnerMcpToolCallResponse {
|
|
698
784
|
"content": RunnerMcpContent[];
|
|
699
785
|
"structuredContent"?: Record<string, unknown>;
|
|
700
786
|
"isError": boolean;
|
|
787
|
+
"task"?: RunnerMcpTask;
|
|
788
|
+
"_meta"?: Record<string, unknown>;
|
|
789
|
+
}
|
|
790
|
+
export interface RunnerMcpResourceReadRequest {
|
|
791
|
+
"uri": string;
|
|
792
|
+
"_meta"?: Record<string, unknown>;
|
|
793
|
+
}
|
|
794
|
+
export interface RunnerMcpResourceReadResponse {
|
|
795
|
+
"contents": RunnerMcpResourceContent[];
|
|
796
|
+
"_meta"?: Record<string, unknown>;
|
|
797
|
+
}
|
|
798
|
+
export interface DisplayTracesInput {
|
|
799
|
+
"trace_id"?: TraceId;
|
|
800
|
+
"session_id"?: SessionId;
|
|
801
|
+
"limit"?: number;
|
|
802
|
+
}
|
|
803
|
+
export interface DisplayTracesOutput {
|
|
804
|
+
"traces": Trace[];
|
|
805
|
+
"selected_trace_id"?: TraceId;
|
|
806
|
+
"mode": McpDataMode;
|
|
807
|
+
}
|
|
808
|
+
export interface DisplayMcpDashboardInput {
|
|
809
|
+
"hours"?: number;
|
|
810
|
+
}
|
|
811
|
+
export interface DisplayMcpDashboardOutput {
|
|
812
|
+
"stats": McpDashboardStats;
|
|
813
|
+
}
|
|
814
|
+
export interface McpDashboardStats {
|
|
815
|
+
"window": McpDashboardWindow;
|
|
816
|
+
"buckets": McpDashboardBucket[];
|
|
817
|
+
"totals": McpDashboardTotals;
|
|
818
|
+
"by_server": McpNameRequestCount[];
|
|
819
|
+
"by_transport": McpNameRequestCount[];
|
|
820
|
+
"by_method": McpNameRequestCount[];
|
|
821
|
+
"tools": McpToolStats[];
|
|
822
|
+
"span_count_analyzed": number;
|
|
823
|
+
"truncated": boolean;
|
|
824
|
+
"mode": McpDataMode;
|
|
825
|
+
}
|
|
826
|
+
export interface McpDashboardWindow {
|
|
827
|
+
"start": string;
|
|
828
|
+
"end": string;
|
|
829
|
+
"bucket_ms": number;
|
|
830
|
+
}
|
|
831
|
+
export interface McpDashboardBucket {
|
|
832
|
+
"start": string;
|
|
833
|
+
"requests": number;
|
|
834
|
+
"errors": number;
|
|
835
|
+
}
|
|
836
|
+
export interface McpDashboardTotals {
|
|
837
|
+
"requests": number;
|
|
838
|
+
"errors": number;
|
|
839
|
+
"error_rate": number;
|
|
840
|
+
}
|
|
841
|
+
export interface McpNameRequestCount {
|
|
842
|
+
"name": string;
|
|
843
|
+
"requests": number;
|
|
844
|
+
}
|
|
845
|
+
export interface McpToolStats {
|
|
846
|
+
"name": string;
|
|
847
|
+
"requests": number;
|
|
848
|
+
"errors": number;
|
|
849
|
+
"error_rate": number;
|
|
850
|
+
"avg_ms": number;
|
|
851
|
+
"p95_ms": number;
|
|
852
|
+
}
|
|
853
|
+
export interface ListTracesInput {
|
|
854
|
+
"limit"?: number;
|
|
855
|
+
}
|
|
856
|
+
export interface ListTracesOutput {
|
|
857
|
+
"traces": TraceSummary[];
|
|
858
|
+
"mode": McpDataMode;
|
|
859
|
+
}
|
|
860
|
+
export interface GetTraceInput {
|
|
861
|
+
"trace_id": TraceId;
|
|
862
|
+
}
|
|
863
|
+
export interface GetTraceOutput {
|
|
864
|
+
"trace": Trace;
|
|
865
|
+
"mode": McpDataMode;
|
|
866
|
+
}
|
|
867
|
+
export interface ListSessionsInput {
|
|
868
|
+
"limit"?: number;
|
|
869
|
+
"active_only"?: boolean;
|
|
870
|
+
}
|
|
871
|
+
export interface ListSessionsOutput {
|
|
872
|
+
"sessions": SessionEntity[];
|
|
873
|
+
"mode": McpDataMode;
|
|
874
|
+
}
|
|
875
|
+
export interface SearchLogsInput {
|
|
876
|
+
"trace_id"?: TraceId;
|
|
877
|
+
"service_name"?: string;
|
|
878
|
+
"severity_min"?: number;
|
|
879
|
+
"query"?: string;
|
|
880
|
+
"limit"?: number;
|
|
881
|
+
}
|
|
882
|
+
export interface SearchLogsOutput {
|
|
883
|
+
"logs": LogRecord[];
|
|
884
|
+
"mode": McpDataMode;
|
|
885
|
+
}
|
|
886
|
+
export interface FetchTelemetryInput {
|
|
887
|
+
"view": FetchTelemetryView;
|
|
888
|
+
"trace_id"?: TraceId;
|
|
889
|
+
"service_name"?: string;
|
|
890
|
+
"severity_min"?: number;
|
|
891
|
+
"query"?: string;
|
|
892
|
+
"limit"?: number;
|
|
893
|
+
"hours"?: number;
|
|
894
|
+
}
|
|
895
|
+
export interface FetchTelemetryOutput {
|
|
896
|
+
"traces"?: Trace[];
|
|
897
|
+
"trace"?: Trace;
|
|
898
|
+
"logs"?: LogRecord[];
|
|
899
|
+
"stats"?: McpDashboardStats;
|
|
900
|
+
"mode": McpDataMode;
|
|
701
901
|
}
|
|
702
902
|
export interface LogStreamEvent {
|
|
703
903
|
"type": "log";
|
|
@@ -213,7 +213,37 @@ export const RunnerResourceLifecycleValues = {
|
|
|
213
213
|
"stopped": "stopped",
|
|
214
214
|
"failed": "failed",
|
|
215
215
|
};
|
|
216
|
+
export const RunnerResourceKindValues = {
|
|
217
|
+
"collector": "collector",
|
|
218
|
+
"project": "project",
|
|
219
|
+
"command": "command",
|
|
220
|
+
"stdio": "stdio",
|
|
221
|
+
"http": "http",
|
|
222
|
+
"inproc": "inproc",
|
|
223
|
+
};
|
|
216
224
|
export const RunnerLogStreamValues = {
|
|
217
225
|
"stdout": "out",
|
|
218
226
|
"stderr": "err",
|
|
219
227
|
};
|
|
228
|
+
export const RunnerMcpToolTaskSupportValues = {
|
|
229
|
+
"forbidden": "forbidden",
|
|
230
|
+
"optional": "optional",
|
|
231
|
+
"required": "required",
|
|
232
|
+
};
|
|
233
|
+
export const RunnerMcpTaskStatusValues = {
|
|
234
|
+
"working": "working",
|
|
235
|
+
"inputRequired": "input_required",
|
|
236
|
+
"completed": "completed",
|
|
237
|
+
"failed": "failed",
|
|
238
|
+
"cancelled": "cancelled",
|
|
239
|
+
};
|
|
240
|
+
export const McpDataModeValues = {
|
|
241
|
+
"live": "live",
|
|
242
|
+
"demo": "demo",
|
|
243
|
+
};
|
|
244
|
+
export const FetchTelemetryViewValues = {
|
|
245
|
+
"traces": "traces",
|
|
246
|
+
"trace": "trace",
|
|
247
|
+
"logs": "logs",
|
|
248
|
+
"mcpStats": "mcp_stats",
|
|
249
|
+
};
|
package/index.tsp
CHANGED
|
@@ -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
|
+
}
|
package/models/runner-mcp.tsp
CHANGED
|
@@ -1,27 +1,62 @@
|
|
|
1
1
|
namespace Qyl.Api.Contracts.Runner.Mcp;
|
|
2
2
|
|
|
3
|
+
@doc("Icon metadata carried by MCP tools and resource links.")
|
|
4
|
+
model RunnerMcpIcon {
|
|
5
|
+
src: string;
|
|
6
|
+
mimeType?: string;
|
|
7
|
+
sizes?: string[];
|
|
8
|
+
theme?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@doc("Task-augmentation support advertised for an MCP tool.")
|
|
12
|
+
enum RunnerMcpToolTaskSupport {
|
|
13
|
+
forbidden: "forbidden",
|
|
14
|
+
optional: "optional",
|
|
15
|
+
required: "required",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@doc("Execution metadata advertised for an MCP tool.")
|
|
19
|
+
model RunnerMcpToolExecution {
|
|
20
|
+
taskSupport?: RunnerMcpToolTaskSupport;
|
|
21
|
+
}
|
|
22
|
+
|
|
3
23
|
@doc("Stable qyl projection of an MCP tool advertised by a runner resource.")
|
|
4
24
|
model RunnerMcpTool {
|
|
5
25
|
name: string;
|
|
6
26
|
title?: string;
|
|
7
27
|
description?: string;
|
|
8
|
-
inputSchema
|
|
28
|
+
inputSchema: Record<unknown>;
|
|
9
29
|
outputSchema?: Record<unknown>;
|
|
30
|
+
annotations?: Record<unknown>;
|
|
31
|
+
execution?: RunnerMcpToolExecution;
|
|
32
|
+
icons?: RunnerMcpIcon[];
|
|
33
|
+
@encodedName("application/json", "_meta")
|
|
34
|
+
metadata?: Record<unknown>;
|
|
10
35
|
}
|
|
11
36
|
|
|
12
37
|
@doc("MCP tools currently advertised by a runner resource.")
|
|
13
38
|
model RunnerMcpToolsResponse {
|
|
14
39
|
tools: RunnerMcpTool[];
|
|
15
40
|
nextCursor?: string;
|
|
41
|
+
@encodedName("application/json", "_meta")
|
|
42
|
+
metadata?: Record<unknown>;
|
|
16
43
|
}
|
|
17
44
|
|
|
18
45
|
@doc("Tool call accepted by the runner's MCP projection.")
|
|
19
46
|
model RunnerMcpToolCallRequest {
|
|
20
47
|
name: string;
|
|
21
48
|
arguments?: Record<unknown>;
|
|
49
|
+
task?: RunnerMcpTaskMetadata;
|
|
50
|
+
@encodedName("application/json", "_meta")
|
|
51
|
+
metadata?: Record<unknown>;
|
|
22
52
|
}
|
|
23
53
|
|
|
24
|
-
@doc("
|
|
54
|
+
@doc("Task-augmentation metadata accepted on an MCP tool call. ttl is encoded as milliseconds.")
|
|
55
|
+
model RunnerMcpTaskMetadata {
|
|
56
|
+
ttl?: float64;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@doc("One MCP content item projected onto a stable qyl JSON shape. Variant-specific required fields follow its type discriminator.")
|
|
25
60
|
model RunnerMcpContent {
|
|
26
61
|
type: string;
|
|
27
62
|
text?: string;
|
|
@@ -33,15 +68,69 @@ model RunnerMcpContent {
|
|
|
33
68
|
description?: string;
|
|
34
69
|
@minValue(0)
|
|
35
70
|
size?: int64;
|
|
36
|
-
|
|
71
|
+
icons?: RunnerMcpIcon[];
|
|
72
|
+
resource?: RunnerMcpResourceContent;
|
|
73
|
+
id?: string;
|
|
74
|
+
input?: unknown;
|
|
75
|
+
toolUseId?: string;
|
|
76
|
+
content?: RunnerMcpContent[];
|
|
77
|
+
structuredContent?: Record<unknown>;
|
|
78
|
+
isError?: boolean;
|
|
37
79
|
annotations?: Record<unknown>;
|
|
38
80
|
@encodedName("application/json", "_meta")
|
|
39
81
|
metadata?: Record<unknown>;
|
|
40
82
|
}
|
|
41
83
|
|
|
84
|
+
@doc("Lifecycle state of an MCP task returned by a task-augmented tool call.")
|
|
85
|
+
enum RunnerMcpTaskStatus {
|
|
86
|
+
working: "working",
|
|
87
|
+
inputRequired: "input_required",
|
|
88
|
+
completed: "completed",
|
|
89
|
+
failed: "failed",
|
|
90
|
+
cancelled: "cancelled",
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@doc("Task returned by an MCP task-augmented tool call. ttl and pollInterval are encoded as milliseconds.")
|
|
94
|
+
model RunnerMcpTask {
|
|
95
|
+
taskId: string;
|
|
96
|
+
status: RunnerMcpTaskStatus;
|
|
97
|
+
statusMessage?: string;
|
|
98
|
+
createdAt: utcDateTime;
|
|
99
|
+
lastUpdatedAt: utcDateTime;
|
|
100
|
+
ttl?: float64;
|
|
101
|
+
pollInterval?: float64;
|
|
102
|
+
}
|
|
103
|
+
|
|
42
104
|
@doc("Stable qyl projection of an MCP tool-call result.")
|
|
43
105
|
model RunnerMcpToolCallResponse {
|
|
44
106
|
content: RunnerMcpContent[];
|
|
45
107
|
structuredContent?: Record<unknown>;
|
|
46
108
|
isError: boolean;
|
|
109
|
+
task?: RunnerMcpTask;
|
|
110
|
+
@encodedName("application/json", "_meta")
|
|
111
|
+
metadata?: Record<unknown>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@doc("Resource URI accepted by the runner's MCP projection.")
|
|
115
|
+
model RunnerMcpResourceReadRequest {
|
|
116
|
+
uri: url;
|
|
117
|
+
@encodedName("application/json", "_meta")
|
|
118
|
+
metadata?: Record<unknown>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@doc("Text or base64 resource content returned by an MCP server. Exactly one of text or blob is present.")
|
|
122
|
+
model RunnerMcpResourceContent {
|
|
123
|
+
uri: url;
|
|
124
|
+
mimeType?: string;
|
|
125
|
+
text?: string;
|
|
126
|
+
blob?: string;
|
|
127
|
+
@encodedName("application/json", "_meta")
|
|
128
|
+
metadata?: Record<unknown>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@doc("Stable qyl projection of an MCP resources/read result.")
|
|
132
|
+
model RunnerMcpResourceReadResponse {
|
|
133
|
+
contents: RunnerMcpResourceContent[];
|
|
134
|
+
@encodedName("application/json", "_meta")
|
|
135
|
+
metadata?: Record<unknown>;
|
|
47
136
|
}
|