@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/models/runner.tsp CHANGED
@@ -1,3 +1,7 @@
1
+ import "@typespec/http";
2
+
3
+ using TypeSpec.Http;
4
+
1
5
  namespace Qyl.Api.Contracts.Runner;
2
6
 
3
7
  @doc("Lifecycle state of a resource supervised by the local qyl runner.")
@@ -10,17 +14,43 @@ enum RunnerResourceLifecycle {
10
14
  failed: "failed",
11
15
  }
12
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
+
13
33
  @doc("Current client-visible state of one runner resource.")
14
34
  model RunnerResourceState {
15
35
  name: string;
16
36
  lifecycle: RunnerResourceLifecycle;
17
37
  timestamp: utcDateTime;
18
- kind?: string;
38
+ kind?: RunnerResourceKind;
19
39
  @minValue(1)
20
40
  @maxValue(65535)
21
41
  allocatedPort?: int32;
22
42
  endpoint?: url;
23
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;
24
54
  }
25
55
 
26
56
  @doc("Origin stream for one captured child-process log line.")
package/otel/span.tsp CHANGED
@@ -147,16 +147,13 @@ model SpanLink {
147
147
  // Trace Model (Collection of Spans)
148
148
  // =============================================================================
149
149
 
150
- @doc("Complete trace containing all related spans")
151
- model Trace {
150
+ @doc("Trace summary without the full span collection")
151
+ model TraceSummary {
152
152
  @doc("Trace identifier")
153
153
  @key
154
154
  @encodedName("application/json", "trace_id")
155
155
  traceId: TraceId;
156
156
 
157
- @doc("All spans in this trace")
158
- spans: Span[];
159
-
160
157
  @doc("Root span of the trace")
161
158
  @encodedName("application/json", "root_span")
162
159
  rootSpan?: Span;
@@ -185,6 +182,12 @@ model Trace {
185
182
  hasError: boolean;
186
183
  }
187
184
 
185
+ @doc("Complete trace containing all related spans")
186
+ model Trace extends TraceSummary {
187
+ @doc("All spans in this trace")
188
+ spans: Span[];
189
+ }
190
+
188
191
  // =============================================================================
189
192
  // Span Query Filters
190
193
  // =============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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": {
@@ -37,6 +37,12 @@
37
37
  "types": "./generated/ts-runtime/api.d.ts",
38
38
  "import": "./generated/ts-runtime/api.js",
39
39
  "default": "./generated/ts-runtime/api.js"
40
+ },
41
+ "./openapi": {
42
+ "default": "./generated/openapi/qyl.openapi.json"
43
+ },
44
+ "./json-schema": {
45
+ "default": "./generated/json-schema/qyl-api-schema.json"
40
46
  }
41
47
  },
42
48
  "files": [
@@ -50,6 +56,7 @@
50
56
  "models/health.tsp",
51
57
  "models/runner-mcp.tsp",
52
58
  "models/runner.tsp",
59
+ "models/mcp-tools.tsp",
53
60
  "models/session.tsp",
54
61
  "otel/enums.tsp",
55
62
  "otel/logs.tsp",
@@ -60,6 +67,8 @@
60
67
  "generated/otel-keys.gen.tsp",
61
68
  "generated/ts-runtime/api.d.ts",
62
69
  "generated/ts-runtime/api.js",
70
+ "generated/openapi/qyl.openapi.json",
71
+ "generated/json-schema/qyl-api-schema.json",
63
72
  "README.md",
64
73
  "LICENSE"
65
74
  ],
@@ -72,9 +81,10 @@
72
81
  "clean:generated": "node scripts/clean-generated.mjs",
73
82
  "build:emitters": "tsc -p emitters/csharp && tsc -p emitters/ts-types",
74
83
  "build:ts-runtime": "tsc -p tsconfig.contracts.json",
84
+ "build:json-schema": "node scripts/openapi-to-json-schema.mjs",
75
85
  "prepare": "npm run build:emitters",
76
86
  "prepack": "npm run compile",
77
- "compile": "npm run clean:generated && npm run build:emitters && tsp compile main.tsp && npm run build:ts-runtime",
87
+ "compile": "npm run clean:generated && npm run build:emitters && tsp compile main.tsp && npm run build:json-schema && npm run build:ts-runtime",
78
88
  "watch": "tsp compile main.tsp --watch",
79
89
  "format": "tsp format **/*.tsp",
80
90
  "lint": "npm run build:emitters && tsp compile main.tsp --no-emit --warn-as-error",
@@ -84,7 +94,6 @@
84
94
  "@typespec/compiler": "^1.13.0 || >=1.13.0-dev.0",
85
95
  "@typespec/events": "^0.83.0",
86
96
  "@typespec/http": "^1.13.0",
87
- "@typespec/json-schema": "^1.13.0",
88
97
  "@typespec/openapi": "^1.13.0",
89
98
  "@typespec/sse": "^0.83.0"
90
99
  },
@@ -95,7 +104,6 @@
95
104
  "@typespec/compiler": "1.13.0",
96
105
  "@typespec/events": "0.83.0",
97
106
  "@typespec/http": "1.13.0",
98
- "@typespec/json-schema": "1.13.0",
99
107
  "@typespec/openapi": "1.13.0",
100
108
  "@typespec/openapi3": "1.13.0",
101
109
  "@typespec/sse": "0.83.0",