@ancplua/qyl-api-schema 11.6.0 → 12.0.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.
@@ -9,6 +9,7 @@
9
9
  import "@typespec/http";
10
10
  import "@typespec/openapi";
11
11
  import "../common/types.tsp";
12
+ import "../common/pagination.tsp";
12
13
  import "../common/resource.tsp";
13
14
  import "../otel/enums.tsp";
14
15
  import "../otel/span.tsp";
@@ -17,6 +18,7 @@ import "./metrics.tsp";
17
18
 
18
19
  using TypeSpec.OpenAPI;
19
20
  using Qyl.Api.Contracts.Common;
21
+ using Qyl.Api.Contracts.Common.Pagination;
20
22
  using Qyl.Api.Contracts.OTel.Enums;
21
23
  using Qyl.Api.Contracts.OTel.Logs;
22
24
  using Qyl.Api.Contracts.OTel.Metrics;
@@ -164,10 +166,8 @@ model SavedQueryRunRequest {
164
166
  @encodedName("application/json", "end_time")
165
167
  endTime?: utcDateTime;
166
168
 
167
- @doc("Page size for trace and log runs.")
168
- @minValue(1)
169
- @maxValue(1000)
170
- limit?: int32 = 100;
169
+ @doc("Page size for trace and log runs; 100 when omitted.")
170
+ limit?: PageLimit = 100;
171
171
 
172
172
  @doc("`next_cursor` of a previous run of the same saved query.")
173
173
  cursor?: Cursor;
@@ -178,9 +178,11 @@ model SavedTraceQueryRun {
178
178
  signal: "traces";
179
179
  items: TraceSummary[];
180
180
 
181
+ @doc("Pass back as `cursor` for the next page of the same run. Absent on the last page.")
181
182
  @encodedName("application/json", "next_cursor")
182
183
  nextCursor?: Cursor;
183
184
 
185
+ @doc("Whether more items follow this page. `next_cursor` is present exactly when this is true.")
184
186
  @encodedName("application/json", "has_more")
185
187
  hasMore: boolean;
186
188
  }
@@ -190,9 +192,11 @@ model SavedLogQueryRun {
190
192
  signal: "logs";
191
193
  items: LogRecord[];
192
194
 
195
+ @doc("Pass back as `cursor` for the next page of the same run. Absent on the last page.")
193
196
  @encodedName("application/json", "next_cursor")
194
197
  nextCursor?: Cursor;
195
198
 
199
+ @doc("Whether more items follow this page. `next_cursor` is present exactly when this is true.")
196
200
  @encodedName("application/json", "has_more")
197
201
  hasMore: boolean;
198
202
  }
@@ -460,9 +460,12 @@ model WorkbenchProtocolEvent {
460
460
 
461
461
  @doc("Cursor page of chronological MCP protocol diagnostic events.")
462
462
  model WorkbenchProtocolEventPage {
463
+ @pageItems
463
464
  events: WorkbenchProtocolEvent[];
465
+ @doc("Cursor of the next page, passed back as the `cursor` query parameter. Absent on the last page.")
464
466
  @encodedName("application/json", "next_cursor")
465
- nextCursor?: string;
467
+ @continuationToken
468
+ nextCursor?: Cursor;
466
469
  }
467
470
 
468
471
  @doc("How consequential the workbench considers an MCP tool invocation.")
@@ -617,9 +620,12 @@ model WorkbenchExecutionCancelRequest {
617
620
 
618
621
  @doc("Cursor page of MCP execution records.")
619
622
  model WorkbenchExecutionPage {
623
+ @pageItems
620
624
  executions: WorkbenchExecutionRecord[];
625
+ @doc("Cursor of the next page, passed back as the `cursor` query parameter. Absent on the last page.")
621
626
  @encodedName("application/json", "next_cursor")
622
- nextCursor?: string;
627
+ @continuationToken
628
+ nextCursor?: Cursor;
623
629
  }
624
630
 
625
631
  @doc("Whether correlated Qyl observability evidence was available.")
@@ -820,10 +826,13 @@ model WorkbenchTestCaseUpdateRequest {
820
826
 
821
827
  @doc("Cursor page of reusable MCP test cases.")
822
828
  model WorkbenchTestCasePage {
829
+ @pageItems
823
830
  @encodedName("application/json", "test_cases")
824
831
  testCases: WorkbenchTestCase[];
832
+ @doc("Cursor of the next page, passed back as the `cursor` query parameter. Absent on the last page.")
825
833
  @encodedName("application/json", "next_cursor")
826
- nextCursor?: string;
834
+ @continuationToken
835
+ nextCursor?: Cursor;
827
836
  }
828
837
 
829
838
  @doc("Reusable ordered group of MCP test cases.")
@@ -879,9 +888,12 @@ model WorkbenchTestSuiteUpdateRequest {
879
888
 
880
889
  @doc("Cursor page of reusable MCP test suites.")
881
890
  model WorkbenchTestSuitePage {
891
+ @pageItems
882
892
  suites: WorkbenchTestSuite[];
893
+ @doc("Cursor of the next page, passed back as the `cursor` query parameter. Absent on the last page.")
883
894
  @encodedName("application/json", "next_cursor")
884
- nextCursor?: string;
895
+ @continuationToken
896
+ nextCursor?: Cursor;
885
897
  }
886
898
 
887
899
  @doc("Request to execute one test case or suite asynchronously.")
@@ -1044,9 +1056,12 @@ model WorkbenchEvaluationRunAccepted {
1044
1056
 
1045
1057
  @doc("Cursor page of MCP evaluation runs.")
1046
1058
  model WorkbenchEvaluationRunPage {
1059
+ @pageItems
1047
1060
  runs: WorkbenchEvaluationRun[];
1061
+ @doc("Cursor of the next page, passed back as the `cursor` query parameter. Absent on the last page.")
1048
1062
  @encodedName("application/json", "next_cursor")
1049
- nextCursor?: string;
1063
+ @continuationToken
1064
+ nextCursor?: Cursor;
1050
1065
  }
1051
1066
 
1052
1067
  @doc("Request to compare a baseline MCP evaluation run with a candidate run.")
package/otel/span.tsp CHANGED
@@ -188,55 +188,6 @@ model Trace extends TraceSummary {
188
188
  spans: Span[];
189
189
  }
190
190
 
191
- // =============================================================================
192
- // Span Query Filters
193
- // =============================================================================
194
-
195
- @doc("Filter parameters for querying spans")
196
- model SpanQueryFilters {
197
- @doc("Filter by trace ID")
198
- @query("trace_id")
199
- @encodedName("application/json", "trace_id")
200
- traceId?: TraceId;
201
-
202
- @doc("Filter by parent span ID")
203
- @query("parent_span_id")
204
- @encodedName("application/json", "parent_span_id")
205
- parentSpanId?: SpanId;
206
-
207
- @doc("Filter by span name (supports wildcards)")
208
- @query
209
- name?: string;
210
-
211
- @doc("Filter by span kind")
212
- @query
213
- kind?: SpanKind;
214
-
215
- @doc("Filter by service name")
216
- @query("service_name")
217
- @encodedName("application/json", "service_name")
218
- serviceName?: string;
219
-
220
- @doc("Filter by status code")
221
- @query("status_code")
222
- @encodedName("application/json", "status_code")
223
- statusCode?: SpanStatusCode;
224
-
225
- @doc("Minimum duration in nanoseconds")
226
- @query("min_duration_ns")
227
- @encodedName("application/json", "min_duration_ns")
228
- minDurationNs?: DurationNs;
229
-
230
- @doc("Maximum duration in nanoseconds")
231
- @query("max_duration_ns")
232
- @encodedName("application/json", "max_duration_ns")
233
- maxDurationNs?: DurationNs;
234
-
235
- @doc("Filter by attribute key-value pair")
236
- @query
237
- attribute?: string;
238
- }
239
-
240
191
  // =============================================================================
241
192
  // Span Aggregations
242
193
  // =============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "11.6.0",
3
+ "version": "12.0.0",
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
  "workspaces": [
@@ -110,7 +110,8 @@
110
110
  "build:json-schema": "node scripts/openapi-to-json-schema.mjs",
111
111
  "emit:contract-revision": "node scripts/emit-contract-revision.mjs",
112
112
  "prepare": "bun run build:emitters",
113
- "prepack": "bun run compile",
113
+ "prepack": "bun run compile && node scripts/stamp-openapi-version.mjs",
114
+ "postpack": "node scripts/stamp-openapi-version.mjs --reset",
114
115
  "compile": "bun run clean:generated && bun run build:emitters && tsp compile main.tsp && bun run emit:contract-revision && bun run build:json-schema && bun run build:ts-runtime && bun run build:runtime && bun run build:zod-runtime",
115
116
  "format": "tsp format **/*.tsp",
116
117
  "lint": "bun run build:emitters && tsp compile main.tsp --no-emit --warn-as-error",