@ancplua/qyl-api-schema 0.5.5 → 0.5.6
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/api/runner.tsp +9 -6
- package/common/types.tsp +18 -13
- package/generated/json-schema/qyl-api-schema.json +313 -77
- package/generated/openapi/qyl.openapi.json +623 -81
- package/generated/ts-runtime/api.d.ts +58 -21
- package/models/runner-mcp.tsp +89 -20
- package/package.json +5 -2
|
@@ -289,12 +289,21 @@ export declare const FetchTelemetryViewValues: {
|
|
|
289
289
|
readonly mcpStats: "mcp_stats";
|
|
290
290
|
};
|
|
291
291
|
export type FetchTelemetryView = typeof FetchTelemetryViewValues[keyof typeof FetchTelemetryViewValues];
|
|
292
|
-
export type AttributeValue = string | boolean | number |
|
|
292
|
+
export type AttributeValue = string | boolean | number | AttributeBytesValue | AttributeValue[] | AttributeKeyValueListValue;
|
|
293
293
|
export type ApiError = NotFoundError | ValidationError | UnauthorizedError | ForbiddenError | ConflictError | RateLimitError | InternalServerError | BadGatewayError | ServiceUnavailableError;
|
|
294
294
|
export type LogBody = LogBodyString | LogBodyKvList | LogBodyArray | LogBodyBytes;
|
|
295
|
+
export type RunnerMcpResourceContent = RunnerMcpTextResourceContent | RunnerMcpBlobResourceContent;
|
|
296
|
+
export type RunnerMcpContent = RunnerMcpTextContent | RunnerMcpImageContent | RunnerMcpAudioContent | RunnerMcpEmbeddedResourceContent | RunnerMcpResourceLinkContent | RunnerMcpToolUseContent | RunnerMcpToolResultContent;
|
|
295
297
|
export type RunnerResourceEvents = RunnerResourceState;
|
|
296
298
|
export type RunnerLogEvents = RunnerLogLine;
|
|
297
299
|
export type LogEvents = LogStreamEvent | HeartbeatEvent;
|
|
300
|
+
export interface AttributeBytesValue {
|
|
301
|
+
"type": "bytes";
|
|
302
|
+
"base64": string;
|
|
303
|
+
}
|
|
304
|
+
export interface AttributeKeyValueListValue {
|
|
305
|
+
[key: string]: AttributeValue;
|
|
306
|
+
}
|
|
298
307
|
export interface Attribute {
|
|
299
308
|
"key": string;
|
|
300
309
|
"value": AttributeValue;
|
|
@@ -745,33 +754,61 @@ export interface RunnerMcpToolCallRequest {
|
|
|
745
754
|
export interface RunnerMcpTaskMetadata {
|
|
746
755
|
"ttl"?: number;
|
|
747
756
|
}
|
|
748
|
-
export interface
|
|
749
|
-
"
|
|
750
|
-
"
|
|
751
|
-
|
|
757
|
+
export interface RunnerMcpContentMetadata {
|
|
758
|
+
"annotations"?: Record<string, unknown>;
|
|
759
|
+
"_meta"?: Record<string, unknown>;
|
|
760
|
+
}
|
|
761
|
+
export interface RunnerMcpTextContent extends RunnerMcpContentMetadata {
|
|
762
|
+
"type": "text";
|
|
763
|
+
"text": string;
|
|
764
|
+
}
|
|
765
|
+
export interface RunnerMcpImageContent extends RunnerMcpContentMetadata {
|
|
766
|
+
"type": "image";
|
|
767
|
+
"data": string;
|
|
768
|
+
"mimeType": string;
|
|
769
|
+
}
|
|
770
|
+
export interface RunnerMcpAudioContent extends RunnerMcpContentMetadata {
|
|
771
|
+
"type": "audio";
|
|
772
|
+
"data": string;
|
|
773
|
+
"mimeType": string;
|
|
774
|
+
}
|
|
775
|
+
export interface RunnerMcpEmbeddedResourceContent extends RunnerMcpContentMetadata {
|
|
776
|
+
"type": "resource";
|
|
777
|
+
"resource": RunnerMcpResourceContent;
|
|
778
|
+
}
|
|
779
|
+
export interface RunnerMcpTextResourceContent extends RunnerMcpResourceContentMetadata {
|
|
780
|
+
"text": string;
|
|
781
|
+
}
|
|
782
|
+
export interface RunnerMcpResourceContentMetadata {
|
|
783
|
+
"uri": string;
|
|
752
784
|
"mimeType"?: string;
|
|
753
|
-
"
|
|
754
|
-
|
|
785
|
+
"_meta"?: Record<string, unknown>;
|
|
786
|
+
}
|
|
787
|
+
export interface RunnerMcpBlobResourceContent extends RunnerMcpResourceContentMetadata {
|
|
788
|
+
"blob": string;
|
|
789
|
+
}
|
|
790
|
+
export interface RunnerMcpResourceLinkContent extends RunnerMcpContentMetadata {
|
|
791
|
+
"type": "resource_link";
|
|
792
|
+
"uri": string;
|
|
793
|
+
"name": string;
|
|
755
794
|
"title"?: string;
|
|
756
795
|
"description"?: string;
|
|
796
|
+
"mimeType"?: string;
|
|
757
797
|
"size"?: number;
|
|
758
798
|
"icons"?: RunnerMcpIcon[];
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
"
|
|
762
|
-
"
|
|
763
|
-
"
|
|
799
|
+
}
|
|
800
|
+
export interface RunnerMcpToolUseContent extends RunnerMcpContentMetadata {
|
|
801
|
+
"type": "tool_use";
|
|
802
|
+
"id": string;
|
|
803
|
+
"name": string;
|
|
804
|
+
"input": unknown;
|
|
805
|
+
}
|
|
806
|
+
export interface RunnerMcpToolResultContent extends RunnerMcpContentMetadata {
|
|
807
|
+
"type": "tool_result";
|
|
808
|
+
"toolUseId": string;
|
|
809
|
+
"content": RunnerMcpContent[];
|
|
764
810
|
"structuredContent"?: Record<string, unknown>;
|
|
765
811
|
"isError"?: boolean;
|
|
766
|
-
"annotations"?: Record<string, unknown>;
|
|
767
|
-
"_meta"?: Record<string, unknown>;
|
|
768
|
-
}
|
|
769
|
-
export interface RunnerMcpResourceContent {
|
|
770
|
-
"uri": string;
|
|
771
|
-
"mimeType"?: string;
|
|
772
|
-
"text"?: string;
|
|
773
|
-
"blob"?: string;
|
|
774
|
-
"_meta"?: Record<string, unknown>;
|
|
775
812
|
}
|
|
776
813
|
export interface RunnerMcpTask {
|
|
777
814
|
"taskId": string;
|
package/models/runner-mcp.tsp
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import "@typespec/openapi3";
|
|
2
|
+
|
|
3
|
+
using TypeSpec.OpenAPI;
|
|
4
|
+
|
|
1
5
|
namespace Qyl.Api.Contracts.Runner.Mcp;
|
|
2
6
|
|
|
3
7
|
@doc("Icon metadata carried by MCP tools and resource links.")
|
|
@@ -56,29 +60,79 @@ model RunnerMcpTaskMetadata {
|
|
|
56
60
|
ttl?: float64;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
@doc("
|
|
60
|
-
model
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
@doc("Metadata shared by every MCP content variant.")
|
|
64
|
+
model RunnerMcpContentMetadata {
|
|
65
|
+
annotations?: Record<unknown>;
|
|
66
|
+
@encodedName("application/json", "_meta")
|
|
67
|
+
metadata?: Record<unknown>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@doc("Text provided to or returned by an MCP model or tool.")
|
|
71
|
+
model RunnerMcpTextContent extends RunnerMcpContentMetadata {
|
|
72
|
+
type: "text";
|
|
73
|
+
text: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@doc("Base64-encoded image content.")
|
|
77
|
+
model RunnerMcpImageContent extends RunnerMcpContentMetadata {
|
|
78
|
+
type: "image";
|
|
79
|
+
data: bytes;
|
|
80
|
+
mimeType: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@doc("Base64-encoded audio content.")
|
|
84
|
+
model RunnerMcpAudioContent extends RunnerMcpContentMetadata {
|
|
85
|
+
type: "audio";
|
|
86
|
+
data: bytes;
|
|
87
|
+
mimeType: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@doc("A resource embedded in MCP content.")
|
|
91
|
+
model RunnerMcpEmbeddedResourceContent extends RunnerMcpContentMetadata {
|
|
92
|
+
type: "resource";
|
|
93
|
+
resource: RunnerMcpResourceContent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@doc("A link to a resource that an MCP server can read.")
|
|
97
|
+
model RunnerMcpResourceLinkContent extends RunnerMcpContentMetadata {
|
|
98
|
+
type: "resource_link";
|
|
99
|
+
uri: url;
|
|
100
|
+
name: string;
|
|
67
101
|
title?: string;
|
|
68
102
|
description?: string;
|
|
103
|
+
mimeType?: string;
|
|
69
104
|
@minValue(0)
|
|
70
105
|
size?: int64;
|
|
71
106
|
icons?: RunnerMcpIcon[];
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@doc("An MCP sampling request to invoke a tool.")
|
|
110
|
+
model RunnerMcpToolUseContent extends RunnerMcpContentMetadata {
|
|
111
|
+
type: "tool_use";
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
input: unknown;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@doc("The result of an MCP sampling tool invocation.")
|
|
118
|
+
model RunnerMcpToolResultContent extends RunnerMcpContentMetadata {
|
|
119
|
+
type: "tool_result";
|
|
120
|
+
toolUseId: string;
|
|
121
|
+
content: RunnerMcpContent[];
|
|
77
122
|
structuredContent?: Record<unknown>;
|
|
78
123
|
isError?: boolean;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@doc("One MCP content item. The type literal selects the required variant fields.")
|
|
127
|
+
@oneOf
|
|
128
|
+
union RunnerMcpContent {
|
|
129
|
+
text: RunnerMcpTextContent,
|
|
130
|
+
image: RunnerMcpImageContent,
|
|
131
|
+
audio: RunnerMcpAudioContent,
|
|
132
|
+
embeddedResource: RunnerMcpEmbeddedResourceContent,
|
|
133
|
+
resourceLink: RunnerMcpResourceLinkContent,
|
|
134
|
+
toolUse: RunnerMcpToolUseContent,
|
|
135
|
+
toolResult: RunnerMcpToolResultContent,
|
|
82
136
|
}
|
|
83
137
|
|
|
84
138
|
@doc("Lifecycle state of an MCP task returned by a task-augmented tool call.")
|
|
@@ -118,16 +172,31 @@ model RunnerMcpResourceReadRequest {
|
|
|
118
172
|
metadata?: Record<unknown>;
|
|
119
173
|
}
|
|
120
174
|
|
|
121
|
-
@doc("
|
|
122
|
-
model
|
|
175
|
+
@doc("Metadata shared by MCP text and blob resources.")
|
|
176
|
+
model RunnerMcpResourceContentMetadata {
|
|
123
177
|
uri: url;
|
|
124
178
|
mimeType?: string;
|
|
125
|
-
text?: string;
|
|
126
|
-
blob?: string;
|
|
127
179
|
@encodedName("application/json", "_meta")
|
|
128
180
|
metadata?: Record<unknown>;
|
|
129
181
|
}
|
|
130
182
|
|
|
183
|
+
@doc("Text resource content returned by an MCP server.")
|
|
184
|
+
model RunnerMcpTextResourceContent extends RunnerMcpResourceContentMetadata {
|
|
185
|
+
text: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@doc("Base64-encoded resource content returned by an MCP server.")
|
|
189
|
+
model RunnerMcpBlobResourceContent extends RunnerMcpResourceContentMetadata {
|
|
190
|
+
blob: bytes;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@doc("Exactly one MCP text or blob resource variant.")
|
|
194
|
+
@oneOf
|
|
195
|
+
union RunnerMcpResourceContent {
|
|
196
|
+
text: RunnerMcpTextResourceContent,
|
|
197
|
+
blob: RunnerMcpBlobResourceContent,
|
|
198
|
+
}
|
|
199
|
+
|
|
131
200
|
@doc("Stable qyl projection of an MCP resources/read result.")
|
|
132
201
|
model RunnerMcpResourceReadResponse {
|
|
133
202
|
contents: RunnerMcpResourceContent[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancplua/qyl-api-schema",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "TypeSpec source of truth for qyl API contracts. Emits OpenAPI, JSON Schema, Qyl.Api.Contracts DTOs, and TypeScript contract types; not an OpenTelemetry package, storage schema, or server implementation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -89,13 +89,15 @@
|
|
|
89
89
|
"format": "tsp format **/*.tsp",
|
|
90
90
|
"lint": "npm run build:emitters && tsp compile main.tsp --no-emit --warn-as-error",
|
|
91
91
|
"lint:public": "tsp compile index.tsp --no-emit --warn-as-error",
|
|
92
|
-
"verify:routes": "node scripts/verify-route-contracts.mjs"
|
|
92
|
+
"verify:routes": "node scripts/verify-route-contracts.mjs",
|
|
93
|
+
"verify:contracts": "node scripts/verify-contract-fixtures.mjs"
|
|
93
94
|
},
|
|
94
95
|
"peerDependencies": {
|
|
95
96
|
"@typespec/compiler": "^1.13.0 || >=1.13.0-dev.0",
|
|
96
97
|
"@typespec/events": "^0.83.0",
|
|
97
98
|
"@typespec/http": "^1.13.0",
|
|
98
99
|
"@typespec/openapi": "^1.13.0",
|
|
100
|
+
"@typespec/openapi3": "^1.13.0",
|
|
99
101
|
"@typespec/sse": "^0.83.0"
|
|
100
102
|
},
|
|
101
103
|
"devDependencies": {
|
|
@@ -108,6 +110,7 @@
|
|
|
108
110
|
"@typespec/openapi": "1.13.0",
|
|
109
111
|
"@typespec/openapi3": "1.13.0",
|
|
110
112
|
"@typespec/sse": "0.83.0",
|
|
113
|
+
"ajv": "8.20.0",
|
|
111
114
|
"typescript": "6.0.3"
|
|
112
115
|
}
|
|
113
116
|
}
|