@ancplua/qyl-api-schema 3.0.0 → 5.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.
@@ -2,11 +2,13 @@ import "../common/types.tsp";
2
2
  import "../otel/logs.tsp";
3
3
  import "../otel/span.tsp";
4
4
  import "./session.tsp";
5
+ import "./workflow.tsp";
5
6
 
6
7
  using Qyl.Api.Contracts.Common;
7
8
  using Qyl.Api.Contracts.Domains.Observe.Session;
8
9
  using Qyl.Api.Contracts.OTel.Logs;
9
10
  using Qyl.Api.Contracts.OTel.Traces;
11
+ using Qyl.Api.Contracts.Workflow;
10
12
 
11
13
  namespace Qyl.Api.Contracts.Mcp.Tools;
12
14
 
@@ -117,6 +119,76 @@ model SearchLogsOutput {
117
119
  mode: McpDataMode;
118
120
  }
119
121
 
122
+ @doc("Outcome of one CI phase span, projected from its OpenTelemetry span status.")
123
+ enum CiPhaseStatus {
124
+ ok: "ok",
125
+ error: "error",
126
+ unset: "unset",
127
+ }
128
+
129
+ @doc("Input for ci_log.")
130
+ model CiLogInput {
131
+ @doc("Session id of one CI run for a per-leg phase breakdown; omit to list recent runs.")
132
+ @encodedName("application/json", "run_id")
133
+ runId?: SessionId;
134
+
135
+ @doc("Maximum CI runs to list.")
136
+ @minValue(1)
137
+ @maxValue(50)
138
+ limit?: int32 = 10;
139
+ }
140
+
141
+ @doc("One CI run, summarized from the session its telemetry is grouped under.")
142
+ model CiRunSummary {
143
+ @encodedName("application/json", "run_id")
144
+ runId: SessionId;
145
+
146
+ state: SessionState;
147
+
148
+ @encodedName("application/json", "start_time")
149
+ startTime: utcDateTime;
150
+
151
+ @encodedName("application/json", "duration_ms")
152
+ durationMs?: DurationMs;
153
+
154
+ @doc("Spans in the run that ended with an error status.")
155
+ @encodedName("application/json", "error_count")
156
+ @minValue(0)
157
+ errorCount: int32;
158
+
159
+ @doc("Service names observed in the run, at least one of which is CI-emitted.")
160
+ services: string[];
161
+ }
162
+
163
+ @doc("One phase span of a CI run, attributed to the leg that executed it.")
164
+ model CiPhase {
165
+ @doc("Value of the span's ci.leg attribute, falling back to its service name.")
166
+ leg: string;
167
+
168
+ @doc("Span name, which the CI emitter convention sets to the phase name.")
169
+ phase: string;
170
+
171
+ status: CiPhaseStatus;
172
+
173
+ @encodedName("application/json", "duration_ms")
174
+ durationMs: DurationMs;
175
+
176
+ @doc("Span status message, present on a failed phase.")
177
+ message?: string;
178
+ }
179
+
180
+ @doc("Structured output for ci_log: recent runs, or one run's phases.")
181
+ model CiLogOutput {
182
+ runs?: CiRunSummary[];
183
+
184
+ @encodedName("application/json", "run_id")
185
+ runId?: SessionId;
186
+
187
+ phases?: CiPhase[];
188
+
189
+ mode: McpDataMode;
190
+ }
191
+
120
192
  @doc("Input for the app-only fetch_telemetry tool.")
121
193
  model FetchTelemetryInput {
122
194
  view: FetchTelemetryView;
@@ -146,6 +218,157 @@ model FetchTelemetryOutput {
146
218
  mode: McpDataMode;
147
219
  }
148
220
 
221
+ @doc("Input for list_workflow_runs.")
222
+ model ListWorkflowRunsInput {
223
+ status?: WorkflowRunStatus;
224
+
225
+ cursor?: string;
226
+
227
+ @minValue(1)
228
+ @maxValue(100)
229
+ limit?: int32 = 20;
230
+ }
231
+
232
+ @doc("Structured output for list_workflow_runs.")
233
+ model ListWorkflowRunsOutput {
234
+ runs: WorkflowRun[];
235
+
236
+ @encodedName("application/json", "next_cursor")
237
+ nextCursor?: string;
238
+
239
+ @encodedName("application/json", "has_more")
240
+ hasMore: boolean;
241
+
242
+ mode: McpDataMode;
243
+ }
244
+
245
+ @doc("Input for get_workflow_graph.")
246
+ model GetWorkflowGraphInput {
247
+ @encodedName("application/json", "run_id")
248
+ runId: WorkflowRunId;
249
+
250
+ @encodedName("application/json", "node_cursor")
251
+ nodeCursor?: string;
252
+
253
+ @encodedName("application/json", "node_limit")
254
+ @minValue(1)
255
+ @maxValue(1000)
256
+ nodeLimit?: int32 = 250;
257
+
258
+ @encodedName("application/json", "edge_cursor")
259
+ edgeCursor?: string;
260
+
261
+ @encodedName("application/json", "edge_limit")
262
+ @minValue(1)
263
+ @maxValue(2000)
264
+ edgeLimit?: int32 = 500;
265
+ }
266
+
267
+ @doc("Structured output for get_workflow_graph.")
268
+ model GetWorkflowGraphOutput {
269
+ graph: WorkflowGraphSnapshot;
270
+ mode: McpDataMode;
271
+ }
272
+
273
+ @doc("Input for display_workflow_graph. Omit run_id to select the most recent run.")
274
+ model DisplayWorkflowGraphInput {
275
+ @encodedName("application/json", "run_id")
276
+ runId?: WorkflowRunId;
277
+
278
+ @encodedName("application/json", "node_cursor")
279
+ nodeCursor?: string;
280
+
281
+ @encodedName("application/json", "node_limit")
282
+ @minValue(1)
283
+ @maxValue(1000)
284
+ nodeLimit?: int32 = 250;
285
+
286
+ @encodedName("application/json", "edge_cursor")
287
+ edgeCursor?: string;
288
+
289
+ @encodedName("application/json", "edge_limit")
290
+ @minValue(1)
291
+ @maxValue(2000)
292
+ edgeLimit?: int32 = 500;
293
+ }
294
+
295
+ @doc("Structured output for display_workflow_graph.")
296
+ model DisplayWorkflowGraphOutput {
297
+ graph: WorkflowGraphSnapshot;
298
+
299
+ @encodedName("application/json", "live_controls_available")
300
+ liveControlsAvailable: boolean;
301
+
302
+ mode: McpDataMode;
303
+ }
304
+
305
+ @doc("Input for the app-only fetch_workflow_graph_updates tool.")
306
+ model FetchWorkflowGraphUpdatesInput {
307
+ @encodedName("application/json", "run_id")
308
+ runId: WorkflowRunId;
309
+
310
+ @encodedName("application/json", "after_sequence")
311
+ afterSequence: WorkflowSequence;
312
+
313
+ @minValue(1)
314
+ @maxValue(1000)
315
+ limit?: int32 = 250;
316
+
317
+ @encodedName("application/json", "wait_ms")
318
+ @minValue(0)
319
+ @maxValue(30000)
320
+ waitMs?: int32 = 20000;
321
+
322
+ @encodedName("application/json", "node_cursor")
323
+ nodeCursor?: string;
324
+
325
+ @encodedName("application/json", "node_limit")
326
+ @minValue(1)
327
+ @maxValue(1000)
328
+ nodeLimit?: int32 = 250;
329
+
330
+ @encodedName("application/json", "edge_cursor")
331
+ edgeCursor?: string;
332
+
333
+ @encodedName("application/json", "edge_limit")
334
+ @minValue(1)
335
+ @maxValue(2000)
336
+ edgeLimit?: int32 = 500;
337
+
338
+ @doc("Optional captured payload to retrieve lazily for the selected run.")
339
+ @encodedName("application/json", "content_ref")
340
+ contentRef?: WorkflowContentRef;
341
+ }
342
+
343
+ @doc("Structured output for the app-only fetch_workflow_graph_updates tool.")
344
+ model FetchWorkflowGraphUpdatesOutput {
345
+ page: WorkflowEventPage;
346
+ graph?: WorkflowGraphSnapshot;
347
+ content?: WorkflowContent;
348
+ mode: McpDataMode;
349
+ }
350
+
351
+ @doc("Input for control_workflow_run.")
352
+ model ControlWorkflowRunInput {
353
+ @encodedName("application/json", "run_id")
354
+ runId: WorkflowRunId;
355
+
356
+ action: WorkflowControlAction;
357
+
358
+ @encodedName("application/json", "idempotency_key")
359
+ @minLength(1)
360
+ @maxLength(160)
361
+ idempotencyKey: string;
362
+
363
+ @maxLength(32768)
364
+ input?: string;
365
+ }
366
+
367
+ @doc("Structured output for control_workflow_run.")
368
+ model ControlWorkflowRunOutput {
369
+ command: WorkflowControlCommand;
370
+ }
371
+
149
372
  @doc("Aggregate MCP traffic statistics shown by qyl.mcp.")
150
373
  model McpDashboardStats {
151
374
  window: McpDashboardWindow;