@runtypelabs/sdk 5.8.0 → 5.8.1

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.cjs CHANGED
@@ -6395,7 +6395,7 @@ var Runtype = class {
6395
6395
 
6396
6396
  // src/version.ts
6397
6397
  var FALLBACK_VERSION = "0.0.0";
6398
- var SDK_VERSION = "5.8.0".length > 0 ? "5.8.0" : FALLBACK_VERSION;
6398
+ var SDK_VERSION = "5.8.1".length > 0 ? "5.8.1" : FALLBACK_VERSION;
6399
6399
  var RUNTYPE_CLIENT_KIND = "sdk";
6400
6400
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
6401
6401
 
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
  };
@@ -43164,6 +43725,8 @@ interface EvalSuiteCase {
43164
43725
  interface EvalSuiteDetail extends EvalSuiteSummary {
43165
43726
  cases: EvalSuiteCase[];
43166
43727
  }
43728
+ /** Case provenance (mirror of `EvalCaseOrigin` in `@runtypelabs/shared`). */
43729
+ type EvalCaseOrigin = 'manual' | 'saved_from_run' | 'generated' | 'imported' | 'fpo';
43167
43730
  /** One case to create. */
43168
43731
  interface EvalSuiteCaseInput {
43169
43732
  name: string;
@@ -43171,6 +43734,8 @@ interface EvalSuiteCaseInput {
43171
43734
  expected?: CaseExpected;
43172
43735
  notes?: string;
43173
43736
  enabled?: boolean;
43737
+ /** Case provenance. Defaults to 'manual' server-side when omitted. */
43738
+ origin?: EvalCaseOrigin;
43174
43739
  }
43175
43740
  /** Input to `client.evals.suites.create`. Exactly one of flowId/agentId. */
43176
43741
  interface CreateEvalSuiteInput {
package/dist/index.d.ts 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
  };
@@ -43164,6 +43725,8 @@ interface EvalSuiteCase {
43164
43725
  interface EvalSuiteDetail extends EvalSuiteSummary {
43165
43726
  cases: EvalSuiteCase[];
43166
43727
  }
43728
+ /** Case provenance (mirror of `EvalCaseOrigin` in `@runtypelabs/shared`). */
43729
+ type EvalCaseOrigin = 'manual' | 'saved_from_run' | 'generated' | 'imported' | 'fpo';
43167
43730
  /** One case to create. */
43168
43731
  interface EvalSuiteCaseInput {
43169
43732
  name: string;
@@ -43171,6 +43734,8 @@ interface EvalSuiteCaseInput {
43171
43734
  expected?: CaseExpected;
43172
43735
  notes?: string;
43173
43736
  enabled?: boolean;
43737
+ /** Case provenance. Defaults to 'manual' server-side when omitted. */
43738
+ origin?: EvalCaseOrigin;
43174
43739
  }
43175
43740
  /** Input to `client.evals.suites.create`. Exactly one of flowId/agentId. */
43176
43741
  interface CreateEvalSuiteInput {
package/dist/index.mjs CHANGED
@@ -6208,7 +6208,7 @@ var Runtype = class {
6208
6208
 
6209
6209
  // src/version.ts
6210
6210
  var FALLBACK_VERSION = "0.0.0";
6211
- var SDK_VERSION = "5.8.0".length > 0 ? "5.8.0" : FALLBACK_VERSION;
6211
+ var SDK_VERSION = "5.8.1".length > 0 ? "5.8.1" : FALLBACK_VERSION;
6212
6212
  var RUNTYPE_CLIENT_KIND = "sdk";
6213
6213
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
6214
6214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "5.8.0",
3
+ "version": "5.8.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",