@runtypelabs/sdk 5.8.0 → 5.9.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.
package/dist/index.d.cts CHANGED
@@ -645,7 +645,7 @@ interface paths {
645
645
  /** @enum {string} */
646
646
  setupMode: "create" | "connect";
647
647
  systemPrompt?: string;
648
- timeoutMs?: number;
648
+ timeoutMs?: number | null;
649
649
  toolPermissions?: {
650
650
  bash?: boolean;
651
651
  edit?: boolean;
@@ -1723,7 +1723,7 @@ interface paths {
1723
1723
  /** @enum {string} */
1724
1724
  setupMode?: "create" | "connect";
1725
1725
  systemPrompt?: string;
1726
- timeoutMs?: number;
1726
+ timeoutMs?: number | null;
1727
1727
  toolPermissions?: {
1728
1728
  bash?: boolean;
1729
1729
  edit?: boolean;
@@ -7090,6 +7090,10 @@ interface paths {
7090
7090
  };
7091
7091
  content: {
7092
7092
  "application/json": {
7093
+ /** @description Present only for Runtype App data-plane sessions: the owning app id. Such sessions authorize `/v1/client/records` but cannot dispatch chat. */
7094
+ app?: {
7095
+ id: string;
7096
+ };
7093
7097
  config: {
7094
7098
  placeholder?: string;
7095
7099
  theme?: unknown;
@@ -7097,7 +7101,8 @@ interface paths {
7097
7101
  };
7098
7102
  /** @description ISO-8601 session idle-expiry timestamp. */
7099
7103
  expiresAt: string;
7100
- flow: {
7104
+ /** @description Resolved flow/agent for this session. Omitted for data-only Runtype App sessions whose manifest declares record namespaces but no flow or agent (the `app` field is present instead). */
7105
+ flow?: {
7101
7106
  description?: string | null;
7102
7107
  /** @description Resolved flow or agent ID for this session. */
7103
7108
  id: string;
@@ -7161,6 +7166,548 @@ interface paths {
7161
7166
  patch?: never;
7162
7167
  trace?: never;
7163
7168
  };
7169
+ "/v1/client/records": {
7170
+ parameters: {
7171
+ query?: never;
7172
+ header?: never;
7173
+ path?: never;
7174
+ cookie?: never;
7175
+ };
7176
+ /**
7177
+ * List app records in a namespace
7178
+ * @description List records in a granted namespace for a Runtype App data-plane session, newest first, cursor-paginated. The namespace must be declared in the app manifest (`data[]`).
7179
+ */
7180
+ get: {
7181
+ parameters: {
7182
+ query: {
7183
+ /** @description Client session id from /client/init. */
7184
+ sessionId: string;
7185
+ /** @description The record namespace to list. */
7186
+ namespace: string;
7187
+ cursor?: string;
7188
+ limit?: string;
7189
+ };
7190
+ header?: never;
7191
+ path?: never;
7192
+ cookie?: never;
7193
+ };
7194
+ requestBody?: never;
7195
+ responses: {
7196
+ /** @description Records page */
7197
+ 200: {
7198
+ headers: {
7199
+ [name: string]: unknown;
7200
+ };
7201
+ content: {
7202
+ "application/json": {
7203
+ data: {
7204
+ createdAt: string;
7205
+ /** @description Record id. */
7206
+ id: string;
7207
+ /** @description Caller-defined record fields. Server provenance is never echoed here. */
7208
+ metadata: {
7209
+ [key: string]: unknown;
7210
+ };
7211
+ /** @description Record name (unique per namespace within the tenant). */
7212
+ name: string;
7213
+ /** @description The record namespace (record `type`). */
7214
+ namespace: string;
7215
+ updatedAt: string;
7216
+ }[];
7217
+ /** @description Opaque cursor for the next page, or null when exhausted. */
7218
+ nextCursor: string | null;
7219
+ };
7220
+ };
7221
+ };
7222
+ /** @description Validation error */
7223
+ 400: {
7224
+ headers: {
7225
+ [name: string]: unknown;
7226
+ };
7227
+ content: {
7228
+ "application/json": components["schemas"]["Error"];
7229
+ };
7230
+ };
7231
+ /** @description Session not found or expired */
7232
+ 401: {
7233
+ headers: {
7234
+ [name: string]: unknown;
7235
+ };
7236
+ content: {
7237
+ "application/json": components["schemas"]["Error"];
7238
+ };
7239
+ };
7240
+ /** @description Not an app token, origin mismatch, or namespace not granted */
7241
+ 403: {
7242
+ headers: {
7243
+ [name: string]: unknown;
7244
+ };
7245
+ content: {
7246
+ "application/json": components["schemas"]["Error"];
7247
+ };
7248
+ };
7249
+ /** @description App has no active version */
7250
+ 409: {
7251
+ headers: {
7252
+ [name: string]: unknown;
7253
+ };
7254
+ content: {
7255
+ "application/json": components["schemas"]["Error"];
7256
+ };
7257
+ };
7258
+ /** @description Internal server error */
7259
+ 500: {
7260
+ headers: {
7261
+ [name: string]: unknown;
7262
+ };
7263
+ content: {
7264
+ "application/json": components["schemas"]["Error"];
7265
+ };
7266
+ };
7267
+ };
7268
+ };
7269
+ put?: never;
7270
+ /**
7271
+ * Create an app record
7272
+ * @description Create a record in a granted namespace from a Runtype App data-plane session. The namespace must have `read-write` access in the app manifest. Provenance (app, version, session) is stamped server-side.
7273
+ */
7274
+ post: {
7275
+ parameters: {
7276
+ query?: never;
7277
+ header?: never;
7278
+ path?: never;
7279
+ cookie?: never;
7280
+ };
7281
+ requestBody: {
7282
+ content: {
7283
+ "application/json": {
7284
+ /** @default {} */
7285
+ metadata?: {
7286
+ [key: string]: unknown;
7287
+ };
7288
+ name?: string;
7289
+ namespace: string;
7290
+ sessionId: string;
7291
+ };
7292
+ };
7293
+ };
7294
+ responses: {
7295
+ /** @description Record created */
7296
+ 201: {
7297
+ headers: {
7298
+ [name: string]: unknown;
7299
+ };
7300
+ content: {
7301
+ "application/json": {
7302
+ createdAt: string;
7303
+ /** @description Record id. */
7304
+ id: string;
7305
+ /** @description Caller-defined record fields. Server provenance is never echoed here. */
7306
+ metadata: {
7307
+ [key: string]: unknown;
7308
+ };
7309
+ /** @description Record name (unique per namespace within the tenant). */
7310
+ name: string;
7311
+ /** @description The record namespace (record `type`). */
7312
+ namespace: string;
7313
+ updatedAt: string;
7314
+ };
7315
+ };
7316
+ };
7317
+ /** @description Validation error or metadata too large */
7318
+ 400: {
7319
+ headers: {
7320
+ [name: string]: unknown;
7321
+ };
7322
+ content: {
7323
+ "application/json": components["schemas"]["Error"];
7324
+ };
7325
+ };
7326
+ /** @description Session not found or expired */
7327
+ 401: {
7328
+ headers: {
7329
+ [name: string]: unknown;
7330
+ };
7331
+ content: {
7332
+ "application/json": components["schemas"]["Error"];
7333
+ };
7334
+ };
7335
+ /** @description Not an app token, origin mismatch, namespace not writable, or per-app record cap reached */
7336
+ 403: {
7337
+ headers: {
7338
+ [name: string]: unknown;
7339
+ };
7340
+ content: {
7341
+ "application/json": components["schemas"]["Error"];
7342
+ };
7343
+ };
7344
+ /** @description App has no active version, or duplicate record name */
7345
+ 409: {
7346
+ headers: {
7347
+ [name: string]: unknown;
7348
+ };
7349
+ content: {
7350
+ "application/json": components["schemas"]["Error"];
7351
+ };
7352
+ };
7353
+ /** @description Write rate limit exceeded (per app or per session) */
7354
+ 429: {
7355
+ headers: {
7356
+ [name: string]: unknown;
7357
+ };
7358
+ content: {
7359
+ "application/json": components["schemas"]["Error"];
7360
+ };
7361
+ };
7362
+ /** @description Internal server error */
7363
+ 500: {
7364
+ headers: {
7365
+ [name: string]: unknown;
7366
+ };
7367
+ content: {
7368
+ "application/json": components["schemas"]["Error"];
7369
+ };
7370
+ };
7371
+ };
7372
+ };
7373
+ delete?: never;
7374
+ options?: never;
7375
+ head?: never;
7376
+ patch?: never;
7377
+ trace?: never;
7378
+ };
7379
+ "/v1/client/records/{id}": {
7380
+ parameters: {
7381
+ query?: never;
7382
+ header?: never;
7383
+ path?: never;
7384
+ cookie?: never;
7385
+ };
7386
+ /**
7387
+ * Get an app record
7388
+ * @description Fetch a single record by id for a Runtype App data-plane session. The record must belong to the app owner and live in a granted namespace.
7389
+ */
7390
+ get: {
7391
+ parameters: {
7392
+ query: {
7393
+ sessionId: string;
7394
+ };
7395
+ header?: never;
7396
+ path: {
7397
+ id: string;
7398
+ };
7399
+ cookie?: never;
7400
+ };
7401
+ requestBody?: never;
7402
+ responses: {
7403
+ /** @description Record */
7404
+ 200: {
7405
+ headers: {
7406
+ [name: string]: unknown;
7407
+ };
7408
+ content: {
7409
+ "application/json": {
7410
+ createdAt: string;
7411
+ /** @description Record id. */
7412
+ id: string;
7413
+ /** @description Caller-defined record fields. Server provenance is never echoed here. */
7414
+ metadata: {
7415
+ [key: string]: unknown;
7416
+ };
7417
+ /** @description Record name (unique per namespace within the tenant). */
7418
+ name: string;
7419
+ /** @description The record namespace (record `type`). */
7420
+ namespace: string;
7421
+ updatedAt: string;
7422
+ };
7423
+ };
7424
+ };
7425
+ /** @description Validation error */
7426
+ 400: {
7427
+ headers: {
7428
+ [name: string]: unknown;
7429
+ };
7430
+ content: {
7431
+ "application/json": components["schemas"]["Error"];
7432
+ };
7433
+ };
7434
+ /** @description Session not found or expired */
7435
+ 401: {
7436
+ headers: {
7437
+ [name: string]: unknown;
7438
+ };
7439
+ content: {
7440
+ "application/json": components["schemas"]["Error"];
7441
+ };
7442
+ };
7443
+ /** @description Not an app token, origin mismatch, or namespace not granted */
7444
+ 403: {
7445
+ headers: {
7446
+ [name: string]: unknown;
7447
+ };
7448
+ content: {
7449
+ "application/json": components["schemas"]["Error"];
7450
+ };
7451
+ };
7452
+ /** @description Record not found */
7453
+ 404: {
7454
+ headers: {
7455
+ [name: string]: unknown;
7456
+ };
7457
+ content: {
7458
+ "application/json": components["schemas"]["Error"];
7459
+ };
7460
+ };
7461
+ /** @description App has no active version */
7462
+ 409: {
7463
+ headers: {
7464
+ [name: string]: unknown;
7465
+ };
7466
+ content: {
7467
+ "application/json": components["schemas"]["Error"];
7468
+ };
7469
+ };
7470
+ /** @description Internal server error */
7471
+ 500: {
7472
+ headers: {
7473
+ [name: string]: unknown;
7474
+ };
7475
+ content: {
7476
+ "application/json": components["schemas"]["Error"];
7477
+ };
7478
+ };
7479
+ };
7480
+ };
7481
+ /**
7482
+ * Update an app record
7483
+ * @description Update a record's metadata and/or name from a Runtype App data-plane session. The record's namespace must have `read-write` access. Server provenance is preserved. PUT is a full metadata replace. Pass `expectedUpdatedAt` (the `updatedAt` from your last read) for optimistic concurrency: a stale token is rejected with 409 and the current record so concurrent writers don't silently clobber each other.
7484
+ */
7485
+ put: {
7486
+ parameters: {
7487
+ query?: never;
7488
+ header?: never;
7489
+ path: {
7490
+ id: string;
7491
+ };
7492
+ cookie?: never;
7493
+ };
7494
+ requestBody: {
7495
+ content: {
7496
+ "application/json": {
7497
+ /**
7498
+ * Format: date-time
7499
+ * @description Optional optimistic-concurrency token. Pass the `updatedAt` from your last read; the update is rejected with 409 (and the current record) if the stored record has changed since. Omit for last-write-wins.
7500
+ */
7501
+ expectedUpdatedAt?: string;
7502
+ metadata?: {
7503
+ [key: string]: unknown;
7504
+ };
7505
+ name?: string;
7506
+ sessionId: string;
7507
+ };
7508
+ };
7509
+ };
7510
+ responses: {
7511
+ /** @description Updated record */
7512
+ 200: {
7513
+ headers: {
7514
+ [name: string]: unknown;
7515
+ };
7516
+ content: {
7517
+ "application/json": {
7518
+ createdAt: string;
7519
+ /** @description Record id. */
7520
+ id: string;
7521
+ /** @description Caller-defined record fields. Server provenance is never echoed here. */
7522
+ metadata: {
7523
+ [key: string]: unknown;
7524
+ };
7525
+ /** @description Record name (unique per namespace within the tenant). */
7526
+ name: string;
7527
+ /** @description The record namespace (record `type`). */
7528
+ namespace: string;
7529
+ updatedAt: string;
7530
+ };
7531
+ };
7532
+ };
7533
+ /** @description Validation error or metadata too large */
7534
+ 400: {
7535
+ headers: {
7536
+ [name: string]: unknown;
7537
+ };
7538
+ content: {
7539
+ "application/json": components["schemas"]["Error"];
7540
+ };
7541
+ };
7542
+ /** @description Session not found or expired */
7543
+ 401: {
7544
+ headers: {
7545
+ [name: string]: unknown;
7546
+ };
7547
+ content: {
7548
+ "application/json": components["schemas"]["Error"];
7549
+ };
7550
+ };
7551
+ /** @description Not an app token, origin mismatch, or namespace not writable */
7552
+ 403: {
7553
+ headers: {
7554
+ [name: string]: unknown;
7555
+ };
7556
+ content: {
7557
+ "application/json": components["schemas"]["Error"];
7558
+ };
7559
+ };
7560
+ /** @description Record not found */
7561
+ 404: {
7562
+ headers: {
7563
+ [name: string]: unknown;
7564
+ };
7565
+ content: {
7566
+ "application/json": components["schemas"]["Error"];
7567
+ };
7568
+ };
7569
+ /** @description App has no active version, duplicate record name, or an optimistic-concurrency conflict (`expectedUpdatedAt` is stale — body carries the current record). */
7570
+ 409: {
7571
+ headers: {
7572
+ [name: string]: unknown;
7573
+ };
7574
+ content: {
7575
+ "application/json": {
7576
+ error: string;
7577
+ hint?: string;
7578
+ /** @description The current server record (present on an optimistic-concurrency conflict). */
7579
+ record?: {
7580
+ createdAt: string;
7581
+ /** @description Record id. */
7582
+ id: string;
7583
+ /** @description Caller-defined record fields. Server provenance is never echoed here. */
7584
+ metadata: {
7585
+ [key: string]: unknown;
7586
+ };
7587
+ /** @description Record name (unique per namespace within the tenant). */
7588
+ name: string;
7589
+ /** @description The record namespace (record `type`). */
7590
+ namespace: string;
7591
+ updatedAt: string;
7592
+ };
7593
+ };
7594
+ };
7595
+ };
7596
+ /** @description Write rate limit exceeded (per app or per session) */
7597
+ 429: {
7598
+ headers: {
7599
+ [name: string]: unknown;
7600
+ };
7601
+ content: {
7602
+ "application/json": components["schemas"]["Error"];
7603
+ };
7604
+ };
7605
+ /** @description Internal server error */
7606
+ 500: {
7607
+ headers: {
7608
+ [name: string]: unknown;
7609
+ };
7610
+ content: {
7611
+ "application/json": components["schemas"]["Error"];
7612
+ };
7613
+ };
7614
+ };
7615
+ };
7616
+ post?: never;
7617
+ /**
7618
+ * Delete an app record
7619
+ * @description Delete a record by id from a Runtype App data-plane session. The record must belong to the app owner and its namespace must have `read-write` access.
7620
+ */
7621
+ delete: {
7622
+ parameters: {
7623
+ query: {
7624
+ sessionId: string;
7625
+ };
7626
+ header?: never;
7627
+ path: {
7628
+ id: string;
7629
+ };
7630
+ cookie?: never;
7631
+ };
7632
+ requestBody?: never;
7633
+ responses: {
7634
+ /** @description Record deleted */
7635
+ 204: {
7636
+ headers: {
7637
+ [name: string]: unknown;
7638
+ };
7639
+ content?: never;
7640
+ };
7641
+ /** @description Validation error */
7642
+ 400: {
7643
+ headers: {
7644
+ [name: string]: unknown;
7645
+ };
7646
+ content: {
7647
+ "application/json": components["schemas"]["Error"];
7648
+ };
7649
+ };
7650
+ /** @description Session not found or expired */
7651
+ 401: {
7652
+ headers: {
7653
+ [name: string]: unknown;
7654
+ };
7655
+ content: {
7656
+ "application/json": components["schemas"]["Error"];
7657
+ };
7658
+ };
7659
+ /** @description Not an app token, origin mismatch, or namespace not writable */
7660
+ 403: {
7661
+ headers: {
7662
+ [name: string]: unknown;
7663
+ };
7664
+ content: {
7665
+ "application/json": components["schemas"]["Error"];
7666
+ };
7667
+ };
7668
+ /** @description Record not found */
7669
+ 404: {
7670
+ headers: {
7671
+ [name: string]: unknown;
7672
+ };
7673
+ content: {
7674
+ "application/json": components["schemas"]["Error"];
7675
+ };
7676
+ };
7677
+ /** @description App has no active version */
7678
+ 409: {
7679
+ headers: {
7680
+ [name: string]: unknown;
7681
+ };
7682
+ content: {
7683
+ "application/json": components["schemas"]["Error"];
7684
+ };
7685
+ };
7686
+ /** @description Write rate limit exceeded (per app or per session) */
7687
+ 429: {
7688
+ headers: {
7689
+ [name: string]: unknown;
7690
+ };
7691
+ content: {
7692
+ "application/json": components["schemas"]["Error"];
7693
+ };
7694
+ };
7695
+ /** @description Internal server error */
7696
+ 500: {
7697
+ headers: {
7698
+ [name: string]: unknown;
7699
+ };
7700
+ content: {
7701
+ "application/json": components["schemas"]["Error"];
7702
+ };
7703
+ };
7704
+ };
7705
+ };
7706
+ options?: never;
7707
+ head?: never;
7708
+ patch?: never;
7709
+ trace?: never;
7710
+ };
7164
7711
  "/v1/client/resume": {
7165
7712
  parameters: {
7166
7713
  query?: never;
@@ -9541,6 +10088,8 @@ interface paths {
9541
10088
  status?: string;
9542
10089
  /** @description Filter by run origin: "suite" = runs linked to an eval suite (CI gates, suite Run button); "adhoc" = suite-less runs (ad-hoc config comparisons, legacy evals). */
9543
10090
  origin?: "suite" | "adhoc";
10091
+ /** @description Filter to runs of a specific eval suite. Server-side, so a suite with sparse runs is not crowded out of the page by other suites. */
10092
+ evalSuiteId?: string;
9544
10093
  };
9545
10094
  header?: never;
9546
10095
  path?: never;
@@ -9559,6 +10108,8 @@ interface paths {
9559
10108
  [key: string]: unknown;
9560
10109
  }[];
9561
10110
  count: number;
10111
+ /** @description True when this page came back full — there may be more rows past it. */
10112
+ hasMore: boolean;
9562
10113
  limit: number;
9563
10114
  offset: number;
9564
10115
  };
@@ -10606,6 +11157,11 @@ interface paths {
10606
11157
  };
10607
11158
  name: string;
10608
11159
  notes?: string;
11160
+ /**
11161
+ * @description Case provenance. Defaults to "manual" when omitted.
11162
+ * @enum {string}
11163
+ */
11164
+ origin?: "manual" | "saved_from_run" | "generated" | "imported" | "fpo";
10609
11165
  }[];
10610
11166
  description?: string;
10611
11167
  flowId?: string;
@@ -10956,6 +11512,11 @@ interface paths {
10956
11512
  };
10957
11513
  name: string;
10958
11514
  notes?: string;
11515
+ /**
11516
+ * @description Case provenance. Defaults to "manual" when omitted.
11517
+ * @enum {string}
11518
+ */
11519
+ origin?: "manual" | "saved_from_run" | "generated" | "imported" | "fpo";
10959
11520
  }[];
10960
11521
  };
10961
11522
  };
@@ -17843,6 +18404,8 @@ interface paths {
17843
18404
  content: {
17844
18405
  "application/json": {
17845
18406
  data: {
18407
+ /** @description True when historical (R2 SQL) logs were unavailable and only recent hot-tier entries are included. Absent on healthy responses. */
18408
+ degraded?: boolean;
17846
18409
  entries: {
17847
18410
  [key: string]: unknown;
17848
18411
  }[];
@@ -18021,6 +18584,8 @@ interface paths {
18021
18584
  byType: {
18022
18585
  [key: string]: number;
18023
18586
  };
18587
+ /** @description True when historical (R2 SQL) counts were unavailable and stats cover only the recent hot-tier window. Absent on healthy responses. */
18588
+ degraded?: boolean;
18024
18589
  histogram: {
18025
18590
  bucket: string;
18026
18591
  count: number;
@@ -38156,6 +38721,12 @@ interface components {
38156
38721
  caseId: string | null;
38157
38722
  name: string;
38158
38723
  outcomes: {
38724
+ /** @description AI graders only: transcript entries the verdict rests on — indices into the run's trace steps (message) or tool calls (tool_call). */
38725
+ evidence?: {
38726
+ index: number;
38727
+ /** @enum {string} */
38728
+ kind: "message" | "tool_call";
38729
+ }[];
38159
38730
  graderIndex: number;
38160
38731
  kind: string;
38161
38732
  passed: boolean;
@@ -38166,6 +38737,11 @@ interface components {
38166
38737
  * @enum {string}
38167
38738
  */
38168
38739
  severity?: "gate" | "soft";
38740
+ /**
38741
+ * @description AI graders only: the judge's binary verdict. insufficient_evidence means the judge declined to guess; it renders as a warning and never fails the case.
38742
+ * @enum {string}
38743
+ */
38744
+ verdict?: "pass" | "fail" | "insufficient_evidence";
38169
38745
  }[];
38170
38746
  /** @description Truncated snapshot of the output that was graded (2000 chars max). */
38171
38747
  outputExcerpt: string;
@@ -39275,6 +39851,12 @@ interface components {
39275
39851
  errored: boolean;
39276
39852
  name: string;
39277
39853
  outcomes: {
39854
+ /** @description AI graders only: transcript entries the verdict rests on — indices into the run's trace steps (message) or tool calls (tool_call). */
39855
+ evidence?: {
39856
+ index: number;
39857
+ /** @enum {string} */
39858
+ kind: "message" | "tool_call";
39859
+ }[];
39278
39860
  graderIndex: number;
39279
39861
  kind: string;
39280
39862
  passed: boolean;
@@ -39285,6 +39867,11 @@ interface components {
39285
39867
  * @enum {string}
39286
39868
  */
39287
39869
  severity?: "gate" | "soft";
39870
+ /**
39871
+ * @description AI graders only: the judge's binary verdict. insufficient_evidence means the judge declined to guess; it renders as a warning and never fails the case.
39872
+ * @enum {string}
39873
+ */
39874
+ verdict?: "pass" | "fail" | "insufficient_evidence";
39288
39875
  }[];
39289
39876
  outputExcerpt: string;
39290
39877
  passed: boolean;
@@ -41835,6 +42422,8 @@ interface LogQueryResult {
41835
42422
  cursor: string | null;
41836
42423
  hasMore: boolean;
41837
42424
  };
42425
+ /** True when historical (R2 SQL) logs were unavailable and only recent hot-tier entries are included. */
42426
+ degraded?: boolean;
41838
42427
  }
41839
42428
  /** Logs are wrapped in a `{ success, data }` envelope by the API. */
41840
42429
  interface LogQueryResponse {
@@ -41853,6 +42442,8 @@ interface LogStatsResult {
41853
42442
  count: number;
41854
42443
  errors: number;
41855
42444
  }>;
42445
+ /** True when historical (R2 SQL) counts were unavailable and stats cover only the recent hot-tier window. */
42446
+ degraded?: boolean;
41856
42447
  }
41857
42448
  interface LogStatsResponse {
41858
42449
  success: boolean;
@@ -42060,8 +42651,17 @@ interface AIGrader {
42060
42651
  criteria: string;
42061
42652
  /** Reference-guided when the case has `expected`. */
42062
42653
  useExpected?: boolean;
42063
- /** Defaults to a cheap routed model at execution time. */
42654
+ /** Defaults to a cheap routed model at execution time. Ignored when `judgeFlowId` is set. */
42064
42655
  model?: string;
42656
+ /**
42657
+ * Custom judge flow: your flow (by id) runs as the judge instead of the
42658
+ * platform judge prompt. It receives `criteria`, `caseName`, `expected`, and
42659
+ * `transcript` as inputs and must output the platform verdict JSON
42660
+ * (`{"reasoning", "verdict": "pass"|"fail"|"insufficient_evidence", "evidence"}`).
42661
+ * A miswired flow (missing, failing, or returning malformed output) resolves
42662
+ * to an insufficient-evidence warning with the error, never a verdict.
42663
+ */
42664
+ judgeFlowId?: string;
42065
42665
  /** Pass cutoff on the 1-5 judge scale (default 4 server-side). Set via `.atLeast(n)`. */
42066
42666
  threshold?: number;
42067
42667
  /** Hard gate (default) vs soft. Set via `.gate()` / `.soft()`. */
@@ -42156,6 +42756,7 @@ declare function cost(maxUsd: number): Gradeable<CheckGrader>;
42156
42756
  declare function judge(criteria: string, opts?: {
42157
42757
  useExpected?: boolean;
42158
42758
  model?: string;
42759
+ judgeFlowId?: string;
42159
42760
  threshold?: number;
42160
42761
  preset?: BuiltInGraderId;
42161
42762
  }): Gradeable<AIGrader>;
@@ -42291,10 +42892,24 @@ interface GraderOutcome {
42291
42892
  passed: boolean;
42292
42893
  /** The grader's severity (absent ⇒ gate). A soft miss only fails under `--strict`. */
42293
42894
  severity?: GraderSeverity;
42294
- /** 0..1 for scaled graders (AI graders normalize their 1-5 to 0..1). */
42895
+ /** 0..1 for scaled graders (AI graders normalize their 1-5 to 0..1). Absent for `insufficient_evidence`. */
42295
42896
  score?: number;
42296
- /** AI-grader verdict, or a check's human-readable reason. */
42897
+ /** AI-grader reasoning (critique-before-verdict), or a check's human-readable reason. */
42297
42898
  reasoning?: string;
42899
+ /**
42900
+ * AI graders only: the trajectory judge's binary verdict.
42901
+ * `insufficient_evidence` means the judge declined to guess — it renders as
42902
+ * a warning and never fails the case.
42903
+ */
42904
+ verdict?: 'pass' | 'fail' | 'insufficient_evidence';
42905
+ /**
42906
+ * AI graders only: transcript entries the verdict rests on — indices into
42907
+ * the run's trace steps (`message`) or tool calls (`tool_call`).
42908
+ */
42909
+ evidence?: Array<{
42910
+ kind: 'message' | 'tool_call';
42911
+ index: number;
42912
+ }>;
42298
42913
  }
42299
42914
  /** One case's run result: pass/fail plus each grader's outcome. */
42300
42915
  interface RunEvalCaseResult {
@@ -43164,6 +43779,8 @@ interface EvalSuiteCase {
43164
43779
  interface EvalSuiteDetail extends EvalSuiteSummary {
43165
43780
  cases: EvalSuiteCase[];
43166
43781
  }
43782
+ /** Case provenance (mirror of `EvalCaseOrigin` in `@runtypelabs/shared`). */
43783
+ type EvalCaseOrigin = 'manual' | 'saved_from_run' | 'generated' | 'imported' | 'fpo';
43167
43784
  /** One case to create. */
43168
43785
  interface EvalSuiteCaseInput {
43169
43786
  name: string;
@@ -43171,6 +43788,8 @@ interface EvalSuiteCaseInput {
43171
43788
  expected?: CaseExpected;
43172
43789
  notes?: string;
43173
43790
  enabled?: boolean;
43791
+ /** Case provenance. Defaults to 'manual' server-side when omitted. */
43792
+ origin?: EvalCaseOrigin;
43174
43793
  }
43175
43794
  /** Input to `client.evals.suites.create`. Exactly one of flowId/agentId. */
43176
43795
  interface CreateEvalSuiteInput {