@ancplua/qyl-api-schema 5.1.0 → 7.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.
@@ -34,12 +34,21 @@ export type WorkbenchSuiteId = string & {
34
34
  export type WorkbenchEvaluationExportId = string & {
35
35
  readonly __brand: "WorkbenchEvaluationExportId";
36
36
  };
37
+ export type WorkflowGeneration = string & {
38
+ readonly __brand: "WorkflowGeneration";
39
+ };
40
+ export type WorkflowJournalPosition = string & {
41
+ readonly __brand: "WorkflowJournalPosition";
42
+ };
37
43
  export type WorkflowRunId = string & {
38
44
  readonly __brand: "WorkflowRunId";
39
45
  };
40
46
  export type WorkflowAttemptId = string & {
41
47
  readonly __brand: "WorkflowAttemptId";
42
48
  };
49
+ export type WorkflowRunCursor = string & {
50
+ readonly __brand: "WorkflowRunCursor";
51
+ };
43
52
  export type WorkflowContentRef = string & {
44
53
  readonly __brand: "WorkflowContentRef";
45
54
  };
@@ -55,6 +64,15 @@ export type WorkflowToolCallId = string & {
55
64
  export type WorkflowNodeId = string & {
56
65
  readonly __brand: "WorkflowNodeId";
57
66
  };
67
+ export type WorkflowEdgeId = string & {
68
+ readonly __brand: "WorkflowEdgeId";
69
+ };
70
+ export type WorkflowNodeCursor = string & {
71
+ readonly __brand: "WorkflowNodeCursor";
72
+ };
73
+ export type WorkflowEdgeCursor = string & {
74
+ readonly __brand: "WorkflowEdgeCursor";
75
+ };
58
76
  export type WorkflowCommandId = string & {
59
77
  readonly __brand: "WorkflowCommandId";
60
78
  };
@@ -455,6 +473,18 @@ export declare const WorkflowControlStatusValues: {
455
473
  readonly failed: "failed";
456
474
  };
457
475
  export type WorkflowControlStatus = typeof WorkflowControlStatusValues[keyof typeof WorkflowControlStatusValues];
476
+ export declare const WorkflowCursorKindValues: {
477
+ readonly node: "node";
478
+ readonly edge: "edge";
479
+ };
480
+ export type WorkflowCursorKind = typeof WorkflowCursorKindValues[keyof typeof WorkflowCursorKindValues];
481
+ export declare const WorkflowCursorFailureReasonValues: {
482
+ readonly invalid: "invalid";
483
+ readonly wrongRun: "wrong_run";
484
+ readonly wrongGeneration: "wrong_generation";
485
+ readonly stale: "stale";
486
+ };
487
+ export type WorkflowCursorFailureReason = typeof WorkflowCursorFailureReasonValues[keyof typeof WorkflowCursorFailureReasonValues];
458
488
  export declare const WorkflowAttemptStatusValues: {
459
489
  readonly pending: "pending";
460
490
  readonly running: "running";
@@ -510,6 +540,7 @@ export type WorkbenchEvaluationExportPayload = WorkbenchEvaluationJsonExportPayl
510
540
  export type WorkbenchProtocolEvents = WorkbenchProtocolEvent;
511
541
  export type WorkbenchExecutionUpdateEvents = WorkbenchExecutionRecord;
512
542
  export type WorkflowEdgeProvenance = RecordedWorkflowEdgeProvenance | DerivedWorkflowEdgeProvenance;
543
+ export type WorkflowProjectionStatus = CommittedWorkflowProjectionStatus | RebuildingWorkflowProjectionStatus | UnavailableWorkflowProjectionStatus | CorruptWorkflowProjectionStatus;
513
544
  export type WorkflowStreamEvents = WorkflowJournalEvent | WorkflowHeartbeatEvent | WorkflowCursorGapEvent;
514
545
  export type LogEvents = LogStreamEvent | HeartbeatEvent;
515
546
  export interface AttributeBytesValue {
@@ -1355,14 +1386,36 @@ export interface WorkbenchEvaluationExportArtifact {
1355
1386
  export interface WorkbenchEvaluationExportAccepted {
1356
1387
  "export": WorkbenchEvaluationExport;
1357
1388
  }
1389
+ export interface CommittedWorkflowProjectionStatus {
1390
+ "state": "committed";
1391
+ "generation": WorkflowGeneration;
1392
+ "journal_position": WorkflowJournalPosition;
1393
+ }
1394
+ export interface RebuildingWorkflowProjectionStatus {
1395
+ "state": "rebuilding";
1396
+ "generation": WorkflowGeneration;
1397
+ "target_journal_position": WorkflowJournalPosition;
1398
+ "retry_after_ms": number;
1399
+ }
1400
+ export interface UnavailableWorkflowProjectionStatus {
1401
+ "state": "unavailable";
1402
+ "generation"?: WorkflowGeneration;
1403
+ "retry_after_ms": number;
1404
+ }
1405
+ export interface CorruptWorkflowProjectionStatus {
1406
+ "state": "corrupt";
1407
+ "generation"?: WorkflowGeneration;
1408
+ "reason": "corrupt_derived_state" | "incompatible_derived_state";
1409
+ }
1358
1410
  export interface WorkflowRun {
1359
1411
  "run_id": WorkflowRunId;
1412
+ "generation": WorkflowGeneration;
1360
1413
  "thread_id"?: string;
1361
1414
  "title"?: string;
1362
1415
  "status": WorkflowRunStatus;
1363
1416
  "started_at": string;
1364
1417
  "ended_at"?: string;
1365
- "latest_journal_sequence": string;
1418
+ "latest_journal_sequence": WorkflowJournalPosition;
1366
1419
  "active_attempt_id"?: WorkflowAttemptId;
1367
1420
  "metadata"?: Record<string, unknown>;
1368
1421
  }
@@ -1375,7 +1428,7 @@ export interface WorkflowRunCreateRequest {
1375
1428
  }
1376
1429
  export interface WorkflowRunPage {
1377
1430
  "items": WorkflowRun[];
1378
- "next_cursor"?: string;
1431
+ "next_cursor"?: WorkflowRunCursor;
1379
1432
  "has_more": boolean;
1380
1433
  }
1381
1434
  export interface WorkflowContentChunk {
@@ -1408,18 +1461,18 @@ export interface WorkflowEventBatchAppendResponse {
1408
1461
  "accepted_count": number;
1409
1462
  "duplicate_count": number;
1410
1463
  "acknowledged_source_sequence": string;
1411
- "first_journal_sequence"?: string;
1412
- "last_journal_sequence"?: string;
1464
+ "first_journal_sequence"?: WorkflowJournalPosition;
1465
+ "last_journal_sequence"?: WorkflowJournalPosition;
1413
1466
  }
1414
1467
  export interface WorkflowJournalEvent extends WorkflowEventAppend {
1415
1468
  "run_id": WorkflowRunId;
1416
1469
  "client_id": string;
1417
- "journal_sequence": string;
1470
+ "journal_sequence": WorkflowJournalPosition;
1418
1471
  }
1419
1472
  export interface WorkflowEventPage {
1420
1473
  "events": WorkflowJournalEvent[];
1421
- "next_sequence": string;
1422
- "high_water_mark": string;
1474
+ "next_sequence": WorkflowJournalPosition;
1475
+ "high_water_mark": WorkflowJournalPosition;
1423
1476
  "cursor_gap": boolean;
1424
1477
  }
1425
1478
  export interface RecordedWorkflowEdgeProvenance {
@@ -1439,7 +1492,6 @@ export interface WorkflowGraphNode {
1439
1492
  "status": string;
1440
1493
  "attempt_id"?: WorkflowAttemptId;
1441
1494
  "agent_id"?: WorkflowAgentId;
1442
- "parent_node_id"?: WorkflowNodeId;
1443
1495
  "started_at"?: string;
1444
1496
  "ended_at"?: string;
1445
1497
  "duration_ms"?: number;
@@ -1447,7 +1499,7 @@ export interface WorkflowGraphNode {
1447
1499
  "attributes"?: Record<string, unknown>;
1448
1500
  }
1449
1501
  export interface WorkflowGraphEdge {
1450
- "edge_id": string;
1502
+ "edge_id": WorkflowEdgeId;
1451
1503
  "source_node_id": WorkflowNodeId;
1452
1504
  "target_node_id": WorkflowNodeId;
1453
1505
  "kind": WorkflowEdgeKind;
@@ -1464,12 +1516,13 @@ export interface WorkflowGraphStatistics {
1464
1516
  }
1465
1517
  export interface WorkflowGraphSnapshot {
1466
1518
  "run": WorkflowRun;
1519
+ "projection_status": WorkflowProjectionStatus;
1467
1520
  "nodes": WorkflowGraphNode[];
1468
1521
  "edges": WorkflowGraphEdge[];
1469
1522
  "statistics": WorkflowGraphStatistics;
1470
- "journal_sequence": string;
1471
- "next_node_cursor"?: string;
1472
- "next_edge_cursor"?: string;
1523
+ "journal_sequence": WorkflowJournalPosition;
1524
+ "next_node_cursor"?: WorkflowNodeCursor;
1525
+ "next_edge_cursor"?: WorkflowEdgeCursor;
1473
1526
  "has_more_nodes": boolean;
1474
1527
  "has_more_edges": boolean;
1475
1528
  "total_node_count": number;
@@ -1510,15 +1563,33 @@ export interface WorkflowControlStatusUpdateRequest {
1510
1563
  }
1511
1564
  export interface WorkflowHeartbeatEvent {
1512
1565
  "type": "heartbeat";
1513
- "high_water_mark": string;
1566
+ "high_water_mark": WorkflowJournalPosition;
1514
1567
  "timestamp": string;
1515
1568
  }
1516
1569
  export interface WorkflowCursorGapEvent {
1517
1570
  "type": "cursor_gap";
1518
- "oldest_available_sequence": string;
1519
- "high_water_mark": string;
1571
+ "oldest_available_sequence": WorkflowJournalPosition;
1572
+ "high_water_mark": WorkflowJournalPosition;
1520
1573
  "timestamp": string;
1521
1574
  }
1575
+ export interface WorkflowCursorError extends ProblemDetails {
1576
+ "title": "Invalid Workflow Cursor";
1577
+ "cursor_kind": WorkflowCursorKind;
1578
+ "reason": WorkflowCursorFailureReason;
1579
+ "current_generation"?: WorkflowGeneration;
1580
+ }
1581
+ export interface WorkflowRunDeletedError extends ProblemDetails {
1582
+ "title": "Workflow Run Deleted";
1583
+ "run_id": WorkflowRunId;
1584
+ }
1585
+ export interface WorkflowProjectionUnavailableError extends ProblemDetails {
1586
+ "title": "Workflow Projection Unavailable";
1587
+ "projection_status": WorkflowProjectionStatus;
1588
+ }
1589
+ export interface WorkflowProjectionCorruptError extends ProblemDetails {
1590
+ "title": "Workflow Projection Corrupt";
1591
+ "projection_status": WorkflowProjectionStatus;
1592
+ }
1522
1593
  export interface DisplayTracesInput {
1523
1594
  "trace_id"?: TraceId;
1524
1595
  "session_id"?: SessionId;
@@ -1650,20 +1721,20 @@ export interface FetchTelemetryOutput {
1650
1721
  }
1651
1722
  export interface ListWorkflowRunsInput {
1652
1723
  "status"?: WorkflowRunStatus;
1653
- "cursor"?: string;
1724
+ "cursor"?: WorkflowRunCursor;
1654
1725
  "limit"?: number;
1655
1726
  }
1656
1727
  export interface ListWorkflowRunsOutput {
1657
1728
  "runs": WorkflowRun[];
1658
- "next_cursor"?: string;
1729
+ "next_cursor"?: WorkflowRunCursor;
1659
1730
  "has_more": boolean;
1660
1731
  "mode": McpDataMode;
1661
1732
  }
1662
1733
  export interface GetWorkflowGraphInput {
1663
1734
  "run_id": WorkflowRunId;
1664
- "node_cursor"?: string;
1735
+ "node_cursor"?: WorkflowNodeCursor;
1665
1736
  "node_limit"?: number;
1666
- "edge_cursor"?: string;
1737
+ "edge_cursor"?: WorkflowEdgeCursor;
1667
1738
  "edge_limit"?: number;
1668
1739
  }
1669
1740
  export interface GetWorkflowGraphOutput {
@@ -1672,9 +1743,9 @@ export interface GetWorkflowGraphOutput {
1672
1743
  }
1673
1744
  export interface DisplayWorkflowGraphInput {
1674
1745
  "run_id"?: WorkflowRunId;
1675
- "node_cursor"?: string;
1746
+ "node_cursor"?: WorkflowNodeCursor;
1676
1747
  "node_limit"?: number;
1677
- "edge_cursor"?: string;
1748
+ "edge_cursor"?: WorkflowEdgeCursor;
1678
1749
  "edge_limit"?: number;
1679
1750
  }
1680
1751
  export interface DisplayWorkflowGraphOutput {
@@ -1684,12 +1755,12 @@ export interface DisplayWorkflowGraphOutput {
1684
1755
  }
1685
1756
  export interface FetchWorkflowGraphUpdatesInput {
1686
1757
  "run_id": WorkflowRunId;
1687
- "after_sequence": string;
1758
+ "after_sequence": WorkflowJournalPosition;
1688
1759
  "limit"?: number;
1689
1760
  "wait_ms"?: number;
1690
- "node_cursor"?: string;
1761
+ "node_cursor"?: WorkflowNodeCursor;
1691
1762
  "node_limit"?: number;
1692
- "edge_cursor"?: string;
1763
+ "edge_cursor"?: WorkflowEdgeCursor;
1693
1764
  "edge_limit"?: number;
1694
1765
  "content_ref"?: WorkflowContentRef;
1695
1766
  }
@@ -353,6 +353,16 @@ export const WorkflowControlStatusValues = {
353
353
  "rejected": "rejected",
354
354
  "failed": "failed",
355
355
  };
356
+ export const WorkflowCursorKindValues = {
357
+ "node": "node",
358
+ "edge": "edge",
359
+ };
360
+ export const WorkflowCursorFailureReasonValues = {
361
+ "invalid": "invalid",
362
+ "wrongRun": "wrong_run",
363
+ "wrongGeneration": "wrong_generation",
364
+ "stale": "stale",
365
+ };
356
366
  export const WorkflowAttemptStatusValues = {
357
367
  "pending": "pending",
358
368
  "running": "running",
@@ -392,4 +402,4 @@ export const FetchTelemetryViewValues = {
392
402
  };
393
403
  // --- contract revision (scripts/emit-contract-revision.mjs) ---
394
404
  /** Revision of the API contract these types were emitted from; compare against HealthReport.contract_revision. */
395
- export const CONTRACT_REVISION = "sha256:9d94fe8f5c913e4b";
405
+ export const CONTRACT_REVISION = "sha256:53278018c62ed547";
@@ -222,7 +222,7 @@ model FetchTelemetryOutput {
222
222
  model ListWorkflowRunsInput {
223
223
  status?: WorkflowRunStatus;
224
224
 
225
- cursor?: string;
225
+ cursor?: WorkflowRunCursor;
226
226
 
227
227
  @minValue(1)
228
228
  @maxValue(100)
@@ -234,7 +234,7 @@ model ListWorkflowRunsOutput {
234
234
  runs: WorkflowRun[];
235
235
 
236
236
  @encodedName("application/json", "next_cursor")
237
- nextCursor?: string;
237
+ nextCursor?: WorkflowRunCursor;
238
238
 
239
239
  @encodedName("application/json", "has_more")
240
240
  hasMore: boolean;
@@ -247,16 +247,18 @@ model GetWorkflowGraphInput {
247
247
  @encodedName("application/json", "run_id")
248
248
  runId: WorkflowRunId;
249
249
 
250
+ @doc("Opaque node continuation. Reuse it unchanged from the preceding snapshot's next_node_cursor; do not parse, construct, or modify it.")
250
251
  @encodedName("application/json", "node_cursor")
251
- nodeCursor?: string;
252
+ nodeCursor?: WorkflowNodeCursor;
252
253
 
253
254
  @encodedName("application/json", "node_limit")
254
255
  @minValue(1)
255
256
  @maxValue(1000)
256
257
  nodeLimit?: int32 = 250;
257
258
 
259
+ @doc("Opaque edge continuation. Reuse it unchanged from the preceding snapshot's next_edge_cursor; do not parse, construct, or modify it.")
258
260
  @encodedName("application/json", "edge_cursor")
259
- edgeCursor?: string;
261
+ edgeCursor?: WorkflowEdgeCursor;
260
262
 
261
263
  @encodedName("application/json", "edge_limit")
262
264
  @minValue(1)
@@ -275,16 +277,18 @@ model DisplayWorkflowGraphInput {
275
277
  @encodedName("application/json", "run_id")
276
278
  runId?: WorkflowRunId;
277
279
 
280
+ @doc("Opaque node continuation. Reuse it unchanged from the preceding snapshot's next_node_cursor; do not parse, construct, or modify it.")
278
281
  @encodedName("application/json", "node_cursor")
279
- nodeCursor?: string;
282
+ nodeCursor?: WorkflowNodeCursor;
280
283
 
281
284
  @encodedName("application/json", "node_limit")
282
285
  @minValue(1)
283
286
  @maxValue(1000)
284
287
  nodeLimit?: int32 = 250;
285
288
 
289
+ @doc("Opaque edge continuation. Reuse it unchanged from the preceding snapshot's next_edge_cursor; do not parse, construct, or modify it.")
286
290
  @encodedName("application/json", "edge_cursor")
287
- edgeCursor?: string;
291
+ edgeCursor?: WorkflowEdgeCursor;
288
292
 
289
293
  @encodedName("application/json", "edge_limit")
290
294
  @minValue(1)
@@ -308,7 +312,7 @@ model FetchWorkflowGraphUpdatesInput {
308
312
  runId: WorkflowRunId;
309
313
 
310
314
  @encodedName("application/json", "after_sequence")
311
- afterSequence: WorkflowSequence;
315
+ afterSequence: WorkflowJournalPosition;
312
316
 
313
317
  @minValue(1)
314
318
  @maxValue(1000)
@@ -319,16 +323,18 @@ model FetchWorkflowGraphUpdatesInput {
319
323
  @maxValue(30000)
320
324
  waitMs?: int32 = 20000;
321
325
 
326
+ @doc("Opaque node continuation. Reuse it unchanged from the preceding snapshot's next_node_cursor; do not parse, construct, or modify it.")
322
327
  @encodedName("application/json", "node_cursor")
323
- nodeCursor?: string;
328
+ nodeCursor?: WorkflowNodeCursor;
324
329
 
325
330
  @encodedName("application/json", "node_limit")
326
331
  @minValue(1)
327
332
  @maxValue(1000)
328
333
  nodeLimit?: int32 = 250;
329
334
 
335
+ @doc("Opaque edge continuation. Reuse it unchanged from the preceding snapshot's next_edge_cursor; do not parse, construct, or modify it.")
330
336
  @encodedName("application/json", "edge_cursor")
331
- edgeCursor?: string;
337
+ edgeCursor?: WorkflowEdgeCursor;
332
338
 
333
339
  @encodedName("application/json", "edge_limit")
334
340
  @minValue(1)
@@ -9,6 +9,17 @@ namespace Qyl.Api.Contracts.Workflow;
9
9
  @maxLength(128)
10
10
  scalar WorkflowRunId extends string;
11
11
 
12
+ @doc("Opaque incarnation identifier for one workflow run's projected state.")
13
+ @pattern("^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$")
14
+ @minLength(32)
15
+ @maxLength(32)
16
+ scalar WorkflowGeneration extends string;
17
+
18
+ @doc("Opaque workflow-run list continuation scoped to the project and status filter. Reuse it unchanged; clients must not parse or construct it.")
19
+ @minLength(1)
20
+ @maxLength(512)
21
+ scalar WorkflowRunCursor extends string;
22
+
12
23
  @doc("Stable identifier of one workflow attempt.")
13
24
  @minLength(1)
14
25
  @maxLength(128)
@@ -34,11 +45,26 @@ scalar WorkflowEventId extends string;
34
45
  @maxLength(128)
35
46
  scalar WorkflowCommandId extends string;
36
47
 
37
- @doc("Stable identifier of one graph node.")
48
+ @doc("Stable identifier of one graph node. Canonical tuples structurally distinguish run scope from attempt scope, escape colon as \\c and backslash as \\\\, and never infer scope from a literal component value. A canonical identifier over 192 Unicode scalar values is replaced by its kind, a tilde, and the full lowercase 64-hex SHA-256 of the length-prefixed canonical tuple.")
38
49
  @minLength(1)
39
50
  @maxLength(192)
40
51
  scalar WorkflowNodeId extends string;
41
52
 
53
+ @doc("Stable identifier of one graph edge. Endpoint tuples preserve the nodes' structural run-versus-attempt scope and ordinal component boundaries, escape colon as \\c and backslash as \\\\, and never infer scope from a literal component value. A canonical identifier over 192 Unicode scalar values is replaced by its edge kind, a tilde, and the full lowercase 64-hex SHA-256 of the length-prefixed canonical tuple.")
54
+ @minLength(1)
55
+ @maxLength(192)
56
+ scalar WorkflowEdgeId extends string;
57
+
58
+ @doc("Opaque node-page continuation scoped to one workflow run and generation. Reuse it unchanged; clients must not parse or construct it.")
59
+ @minLength(1)
60
+ @maxLength(1536)
61
+ scalar WorkflowNodeCursor extends string;
62
+
63
+ @doc("Opaque edge-page continuation scoped to one workflow run and generation. Reuse it unchanged; clients must not parse or construct it.")
64
+ @minLength(1)
65
+ @maxLength(1536)
66
+ scalar WorkflowEdgeCursor extends string;
67
+
42
68
  @doc("Content-addressed reference to a captured workflow payload.")
43
69
  @pattern("^sha256:[a-f0-9]{64}$")
44
70
  @minLength(71)
@@ -50,6 +76,11 @@ scalar WorkflowContentRef extends string;
50
76
  @encode(string)
51
77
  scalar WorkflowSequence extends uint64;
52
78
 
79
+ @doc("Collector-assigned position in the authoritative workflow journal, encoded without JavaScript precision loss.")
80
+ @minValue(0)
81
+ @encode(string)
82
+ scalar WorkflowJournalPosition extends uint64;
83
+
53
84
  @doc("Current lifecycle of a workflow run.")
54
85
  enum WorkflowRunStatus {
55
86
  active: "active",
@@ -165,11 +196,60 @@ enum WorkflowContentEncoding {
165
196
  base64: "base64",
166
197
  }
167
198
 
199
+ @doc("A valid committed projection that can be served to readers.")
200
+ model CommittedWorkflowProjectionStatus {
201
+ state: "committed";
202
+ generation: WorkflowGeneration;
203
+
204
+ @encodedName("application/json", "journal_position")
205
+ journalPosition: WorkflowJournalPosition;
206
+ }
207
+
208
+ @doc("The requested generation is being reconstructed from its authoritative journal.")
209
+ model RebuildingWorkflowProjectionStatus {
210
+ state: "rebuilding";
211
+ generation: WorkflowGeneration;
212
+
213
+ @encodedName("application/json", "target_journal_position")
214
+ targetJournalPosition: WorkflowJournalPosition;
215
+
216
+ @encodedName("application/json", "retry_after_ms")
217
+ @minValue(1)
218
+ retryAfterMs: int32;
219
+ }
220
+
221
+ @doc("Projection work is temporarily unavailable after a retryable storage failure.")
222
+ model UnavailableWorkflowProjectionStatus {
223
+ state: "unavailable";
224
+ generation?: WorkflowGeneration;
225
+
226
+ @encodedName("application/json", "retry_after_ms")
227
+ @minValue(1)
228
+ retryAfterMs: int32;
229
+ }
230
+
231
+ @doc("Derived projection state is corrupt or incompatible and cannot currently be served.")
232
+ model CorruptWorkflowProjectionStatus {
233
+ state: "corrupt";
234
+ generation?: WorkflowGeneration;
235
+ reason: "corrupt_derived_state" | "incompatible_derived_state";
236
+ }
237
+
238
+ @doc("Closed public availability state for one workflow projection. Storage paths, hashes, fingerprints, and database errors remain private.")
239
+ union WorkflowProjectionStatus {
240
+ committed: CommittedWorkflowProjectionStatus,
241
+ rebuilding: RebuildingWorkflowProjectionStatus,
242
+ unavailable: UnavailableWorkflowProjectionStatus,
243
+ corrupt: CorruptWorkflowProjectionStatus,
244
+ }
245
+
168
246
  @doc("One immutable workflow run.")
169
247
  model WorkflowRun {
170
248
  @encodedName("application/json", "run_id")
171
249
  runId: WorkflowRunId;
172
250
 
251
+ generation: WorkflowGeneration;
252
+
173
253
  @encodedName("application/json", "thread_id")
174
254
  threadId?: string;
175
255
 
@@ -183,7 +263,7 @@ model WorkflowRun {
183
263
  endedAt?: utcDateTime;
184
264
 
185
265
  @encodedName("application/json", "latest_journal_sequence")
186
- latestJournalSequence: WorkflowSequence;
266
+ latestJournalSequence: WorkflowJournalPosition;
187
267
 
188
268
  @encodedName("application/json", "active_attempt_id")
189
269
  activeAttemptId?: WorkflowAttemptId;
@@ -212,7 +292,7 @@ model WorkflowRunPage {
212
292
  items: WorkflowRun[];
213
293
 
214
294
  @encodedName("application/json", "next_cursor")
215
- nextCursor?: string;
295
+ nextCursor?: WorkflowRunCursor;
216
296
 
217
297
  @encodedName("application/json", "has_more")
218
298
  hasMore: boolean;
@@ -301,10 +381,10 @@ model WorkflowEventBatchAppendResponse {
301
381
  acknowledgedSourceSequence: WorkflowSequence;
302
382
 
303
383
  @encodedName("application/json", "first_journal_sequence")
304
- firstJournalSequence?: WorkflowSequence;
384
+ firstJournalSequence?: WorkflowJournalPosition;
305
385
 
306
386
  @encodedName("application/json", "last_journal_sequence")
307
- lastJournalSequence?: WorkflowSequence;
387
+ lastJournalSequence?: WorkflowJournalPosition;
308
388
  }
309
389
 
310
390
  @doc("One immutable event after collector journal sequence assignment.")
@@ -316,7 +396,7 @@ model WorkflowJournalEvent extends WorkflowEventAppend {
316
396
  clientId: string;
317
397
 
318
398
  @encodedName("application/json", "journal_sequence")
319
- journalSequence: WorkflowSequence;
399
+ journalSequence: WorkflowJournalPosition;
320
400
  }
321
401
 
322
402
  @doc("A bounded page of workflow journal events.")
@@ -324,10 +404,10 @@ model WorkflowEventPage {
324
404
  events: WorkflowJournalEvent[];
325
405
 
326
406
  @encodedName("application/json", "next_sequence")
327
- nextSequence: WorkflowSequence;
407
+ nextSequence: WorkflowJournalPosition;
328
408
 
329
409
  @encodedName("application/json", "high_water_mark")
330
- highWaterMark: WorkflowSequence;
410
+ highWaterMark: WorkflowJournalPosition;
331
411
 
332
412
  @encodedName("application/json", "cursor_gap")
333
413
  cursorGap: boolean;
@@ -375,9 +455,6 @@ model WorkflowGraphNode {
375
455
  @encodedName("application/json", "agent_id")
376
456
  agentId?: WorkflowAgentId;
377
457
 
378
- @encodedName("application/json", "parent_node_id")
379
- parentNodeId?: WorkflowNodeId;
380
-
381
458
  @encodedName("application/json", "started_at")
382
459
  startedAt?: utcDateTime;
383
460
 
@@ -393,10 +470,10 @@ model WorkflowGraphNode {
393
470
  attributes?: Record<unknown>;
394
471
  }
395
472
 
396
- @doc("One typed edge in the deterministic workflow graph projection.")
473
+ @doc("One typed edge in the deterministic workflow graph projection. Data, Control, and Gate edges are causal dependencies. Temporal edges describe observed order, Resource edges describe resource use, and Conflict edges describe contention; Temporal, Resource, and Conflict edges are excluded from critical-path causality.")
397
474
  model WorkflowGraphEdge {
398
475
  @encodedName("application/json", "edge_id")
399
- edgeId: string;
476
+ edgeId: WorkflowEdgeId;
400
477
 
401
478
  @encodedName("application/json", "source_node_id")
402
479
  sourceNodeId: WorkflowNodeId;
@@ -408,7 +485,7 @@ model WorkflowGraphEdge {
408
485
  provenance: WorkflowEdgeProvenance;
409
486
  }
410
487
 
411
- @doc("Work and critical-path statistics for a workflow graph.")
488
+ @doc("Work and critical-path statistics for a workflow graph. Every ToolCall, Wait, Gate, and duration-bearing Message or Item contributes an independently weighted interval even when it has no Agent owner. An Agent contributes its own-work fragments: its interval minus the union of precisely owned child intervals clipped to the Agent interval. Precisely owned children are Control-linked Agent and ToolCall nodes, Temporal-linked Wait nodes, Gate-linked Gate nodes, and Data-linked duration-bearing Message or Item nodes. Peak concurrency sweeps every positive independently weighted or Agent own-work fragment. Critical-path analysis uses only Data, Control, and Gate edges, condenses each causal strongly connected component, charges every component member exactly once, and expands selected component members in ordinal node-id order.")
412
489
  model WorkflowGraphStatistics {
413
490
  @encodedName("application/json", "t1_ms")
414
491
  t1Ms: DurationMs;
@@ -437,18 +514,23 @@ model WorkflowGraphStatistics {
437
514
  @doc("Deterministic graph projection at one journal cursor.")
438
515
  model WorkflowGraphSnapshot {
439
516
  run: WorkflowRun;
517
+
518
+ @encodedName("application/json", "projection_status")
519
+ projectionStatus: WorkflowProjectionStatus;
440
520
  nodes: WorkflowGraphNode[];
441
521
  edges: WorkflowGraphEdge[];
442
522
  statistics: WorkflowGraphStatistics;
443
523
 
444
524
  @encodedName("application/json", "journal_sequence")
445
- journalSequence: WorkflowSequence;
525
+ journalSequence: WorkflowJournalPosition;
446
526
 
447
527
  @encodedName("application/json", "next_node_cursor")
448
- nextNodeCursor?: string;
528
+ @doc("Opaque node continuation for the next page. Reuse it unchanged as node_cursor on the next graph request; do not parse, construct, or modify it.")
529
+ nextNodeCursor?: WorkflowNodeCursor;
449
530
 
450
531
  @encodedName("application/json", "next_edge_cursor")
451
- nextEdgeCursor?: string;
532
+ @doc("Opaque edge continuation for the next page. Reuse it unchanged as edge_cursor on the next graph request; do not parse, construct, or modify it.")
533
+ nextEdgeCursor?: WorkflowEdgeCursor;
452
534
 
453
535
  @encodedName("application/json", "has_more_nodes")
454
536
  hasMoreNodes: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "5.1.0",
3
+ "version": "7.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
  "repository": {