@madewithremy/admin 0.1.7 → 0.1.9

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.ts CHANGED
@@ -808,7 +808,7 @@ interface CrashesStatsParams {
808
808
  * @example
809
809
  * const { errors } = await admin.crashes.list({ sort: 'frequent', limit: 10 });
810
810
  */
811
- declare function list$9(ctx: AdminContext, params?: CrashesListParams): Promise<CrashesListResult>;
811
+ declare function list$a(ctx: AdminContext, params?: CrashesListParams): Promise<CrashesListResult>;
812
812
  /**
813
813
  * Individual crash events for one fingerprint, cursor-paginated.
814
814
  *
@@ -829,7 +829,7 @@ declare function occurrences(ctx: AdminContext, fingerprint: string, params?: Cr
829
829
  * @example
830
830
  * const event = await admin.crashes.get('evt_xyz789');
831
831
  */
832
- declare function get$6(ctx: AdminContext, eventId: string): Promise<CrashesGetResult>;
832
+ declare function get$8(ctx: AdminContext, eventId: string): Promise<CrashesGetResult>;
833
833
  /**
834
834
  * Bucketed time series of total crash occurrence volume for the app.
835
835
  *
@@ -847,7 +847,7 @@ type crashes_CrashesStatsParams = CrashesStatsParams;
847
847
  declare const crashes_occurrences: typeof occurrences;
848
848
  declare const crashes_stats: typeof stats;
849
849
  declare namespace crashes {
850
- export { type crashes_CrashesListParams as CrashesListParams, type crashes_CrashesOccurrencesParams as CrashesOccurrencesParams, type crashes_CrashesStatsParams as CrashesStatsParams, get$6 as get, list$9 as list, crashes_occurrences as occurrences, crashes_stats as stats };
850
+ export { type crashes_CrashesListParams as CrashesListParams, type crashes_CrashesOccurrencesParams as CrashesOccurrencesParams, type crashes_CrashesStatsParams as CrashesStatsParams, get$8 as get, list$a as list, crashes_occurrences as occurrences, crashes_stats as stats };
851
851
  }
852
852
 
853
853
  /**
@@ -942,7 +942,7 @@ interface CronListParams {
942
942
  * const { jobs } = await admin.cron.list({ runs: 50 });
943
943
  * const blocked = jobs.filter((j) => j.status === 'blocked');
944
944
  */
945
- declare function list$8(ctx: AdminContext, params?: CronListParams): Promise<CronOverviewResult>;
945
+ declare function list$9(ctx: AdminContext, params?: CronListParams): Promise<CronOverviewResult>;
946
946
  /**
947
947
  * Trigger a job now (does not affect its schedule).
948
948
  *
@@ -957,12 +957,11 @@ declare function list$8(ctx: AdminContext, params?: CronListParams): Promise<Cro
957
957
  * @example
958
958
  * const { requestId } = await admin.cron.run('dailyDigest');
959
959
  */
960
- declare function run(ctx: AdminContext, route: string): Promise<CronRunResult>;
960
+ declare function run$1(ctx: AdminContext, route: string): Promise<CronRunResult>;
961
961
 
962
962
  type cron_CronListParams = CronListParams;
963
- declare const cron_run: typeof run;
964
963
  declare namespace cron {
965
- export { type cron_CronListParams as CronListParams, list$8 as list, cron_run as run };
964
+ export { type cron_CronListParams as CronListParams, list$9 as list, run$1 as run };
966
965
  }
967
966
 
968
967
  /**
@@ -1060,6 +1059,648 @@ declare namespace data {
1060
1059
  export { type data_LiftFromLiveParams as LiftFromLiveParams, data_liftFromDev as liftFromDev, data_liftFromLive as liftFromLive };
1061
1060
  }
1062
1061
 
1062
+ /**
1063
+ * Response types for bulk ingestion jobs.
1064
+ *
1065
+ * Transcribed from youai-api:
1066
+ * src/http/routes/V2Apps/manage/dataSourceJobs.ts (jobView)
1067
+ * src/common/DataSources/jobs/types.ts
1068
+ */
1069
+ /**
1070
+ * Where a job's documents come from. `store` is every object under a prefix of
1071
+ * one of the app's file stores (what `files put` fills); `manifest` is a JSONL
1072
+ * object the CLI uploaded, one `{ url, filename?, externalId?, metadata? }` per
1073
+ * line, for documents that live behind URLs; `connector` is a sync of the S3
1074
+ * bucket the source is connected to (`datasources sync`); `remap` runs the
1075
+ * live mapper over the source's own raw copies (`datasources remap`); `replay`
1076
+ * runs an earlier job's quarantined objects through the current mapper
1077
+ * (`datasources jobs replay`).
1078
+ */
1079
+ type DataSourceJobSource = {
1080
+ type: 'store';
1081
+ store: string;
1082
+ access: 'private' | 'public';
1083
+ prefix: string;
1084
+ } | {
1085
+ type: 'manifest';
1086
+ key: string;
1087
+ } | {
1088
+ type: 'connector';
1089
+ connectorId: string;
1090
+ } | {
1091
+ /** A random draw of another source's documents (`datasources sample`). */
1092
+ type: 'sample';
1093
+ fromDataSourceId: string;
1094
+ size: number;
1095
+ filter: Record<string, unknown> | null;
1096
+ stratify: string | null;
1097
+ } | {
1098
+ type: 'remap';
1099
+ } | {
1100
+ type: 'replay';
1101
+ fromJobId: string;
1102
+ kind: 'skip' | 'error' | null;
1103
+ };
1104
+ /**
1105
+ * planning → planned → running ⇄ paused → done | failed | cancelled.
1106
+ * `planned` waits for `approve` (or was started with `approve: true` and a
1107
+ * gate refused; the job's `error` says which).
1108
+ */
1109
+ type DataSourceJobState = 'planning' | 'planned' | 'running' | 'paused' | 'done' | 'failed' | 'cancelled';
1110
+ /**
1111
+ * What the corpus would cost before any of it is spent. Every number is an
1112
+ * extrapolation from a sample of about a hundred objects; credits are ledger
1113
+ * credits (nano-dollars) at today's catalog rates.
1114
+ */
1115
+ interface DataSourceJobPlan {
1116
+ objects: number;
1117
+ bytes: number;
1118
+ sample: {
1119
+ documents: number;
1120
+ failed: number;
1121
+ avgChunks: number;
1122
+ avgTokens: number;
1123
+ avgPages: number;
1124
+ modelExtractionShare: number;
1125
+ secondsPerDocument: number;
1126
+ };
1127
+ /**
1128
+ * Mapped sources only: what the mapper did with the sampled objects. The
1129
+ * skip share is the baseline the run's skip gate pauses against.
1130
+ */
1131
+ mapping: {
1132
+ objects: number;
1133
+ documentsPerObject: number;
1134
+ passthroughShare: number;
1135
+ skipShare: number;
1136
+ errorShare: number;
1137
+ deleteShare: number;
1138
+ secondsPerObject: number;
1139
+ } | null;
1140
+ projected: {
1141
+ documents: number;
1142
+ chunks: number;
1143
+ tokens: number;
1144
+ points: number;
1145
+ artifactBytes: number;
1146
+ credits: {
1147
+ embedding: number;
1148
+ extraction: number;
1149
+ contextual: number;
1150
+ total: number;
1151
+ };
1152
+ };
1153
+ capacity: {
1154
+ placement: 'shared' | 'dedicated';
1155
+ resourceId: string | null;
1156
+ maxPoints: number;
1157
+ heldPoints: number;
1158
+ /** False means approve is refused until the source moves or the resource grows. */
1159
+ fits: boolean;
1160
+ };
1161
+ durationMinutes: number;
1162
+ warnings: string[];
1163
+ computedAt: string;
1164
+ }
1165
+ interface DataSourceJob {
1166
+ id: string;
1167
+ dataSourceId: string;
1168
+ pipelineId: string;
1169
+ source: DataSourceJobSource;
1170
+ /**
1171
+ * Objects the mapper skipped or failed on. Counted on `jobs status`; on the
1172
+ * list and on unmapped sources' jobs both are zero.
1173
+ */
1174
+ quarantine: {
1175
+ skipped: number;
1176
+ errors: number;
1177
+ };
1178
+ state: DataSourceJobState;
1179
+ autoApprove: boolean;
1180
+ plan: DataSourceJobPlan | null;
1181
+ budgetCredits: number | null;
1182
+ budgetDollars: number | null;
1183
+ maxInflightBatches: number;
1184
+ limitObjects: number | null;
1185
+ enumerationDone: boolean;
1186
+ counts: {
1187
+ objectsSeen: number;
1188
+ bytesSeen: number;
1189
+ objectsDispatched: number;
1190
+ documentsDone: number;
1191
+ documentsSkipped: number;
1192
+ documentsFailed: number;
1193
+ chunks: number;
1194
+ embedTokens: number;
1195
+ extractionPages: number;
1196
+ };
1197
+ /** Model spend so far at catalog rates — an estimate, not the ledger. */
1198
+ estimatedCredits: number;
1199
+ estimatedDollars: number;
1200
+ /** Recent per-document failures, newest first, at most twenty. */
1201
+ samples: {
1202
+ ref: string;
1203
+ message: string;
1204
+ at: string;
1205
+ }[];
1206
+ error: string | null;
1207
+ /**
1208
+ * Why a running job stopped: the owner, the budget, repeated batch
1209
+ * failures, or (mapped sources) a skip share far above the plan's.
1210
+ */
1211
+ pauseReason: 'user' | 'budget' | 'errors' | 'skips' | null;
1212
+ stalled: boolean;
1213
+ createdAt: string;
1214
+ startedAt: string | null;
1215
+ finishedAt: string | null;
1216
+ lastProgressAt: string | null;
1217
+ }
1218
+ /** GET /datasources/jobs */
1219
+ interface DataSourceJobsListResult {
1220
+ jobs: DataSourceJob[];
1221
+ }
1222
+ /** GET /datasources/jobs/:id */
1223
+ interface DataSourceJobGetResult {
1224
+ job: DataSourceJob;
1225
+ dataSource: {
1226
+ id: string;
1227
+ slug: string;
1228
+ };
1229
+ batches: Record<'pending' | 'queued' | 'running' | 'done' | 'failed' | 'cancelled', number>;
1230
+ }
1231
+ /** POST /datasources/jobs and the four controls */
1232
+ interface DataSourceJobResult {
1233
+ job: DataSourceJob;
1234
+ }
1235
+ /** POST /datasources/jobs/manifest-token */
1236
+ interface DataSourceJobManifestTokenResult {
1237
+ key: string;
1238
+ upload: {
1239
+ key: string;
1240
+ uploadUrl: string;
1241
+ uploadFields: Record<string, string>;
1242
+ };
1243
+ }
1244
+
1245
+ /**
1246
+ * Response types for S3 connectors on data sources.
1247
+ *
1248
+ * Transcribed from youai-api:
1249
+ * src/http/routes/V2Apps/manage/dataSourceConnectors.ts (connectorView)
1250
+ * src/common/Db/v2Apps/V2DataSourceConnectorsDao.ts
1251
+ */
1252
+
1253
+ /**
1254
+ * What to do when a key disappears from the bucket. `mirror`: its document is
1255
+ * removed at the end of the next full sync. `keep`: the document stays.
1256
+ */
1257
+ type DataSourceConnectorDeletions = 'mirror' | 'keep';
1258
+ interface DataSourceConnectorPolicy {
1259
+ deletions: DataSourceConnectorDeletions;
1260
+ /** Ceiling a sync auto-approves under; null = the plan's own 1.5× headroom. */
1261
+ budgetDollarsPerSync: number | null;
1262
+ }
1263
+ /** App-secret NAMES that hold the keys. Values never leave the platform. */
1264
+ interface DataSourceConnectorCredentials {
1265
+ accessKeyIdSecret: string;
1266
+ secretAccessKeySecret: string;
1267
+ }
1268
+ interface DataSourceConnector {
1269
+ id: string;
1270
+ type: 's3';
1271
+ bucket: string;
1272
+ region: string;
1273
+ /** Key prefix listed under; '' for the whole bucket. */
1274
+ prefix: string;
1275
+ /** S3-compatible endpoint, or null for AWS. */
1276
+ endpoint: string | null;
1277
+ credentials: DataSourceConnectorCredentials;
1278
+ policy: DataSourceConnectorPolicy;
1279
+ lastSyncJobId: string | null;
1280
+ lastSyncedAt: string | null;
1281
+ lastError: string | null;
1282
+ /** Only on GET: how many customer keys the index tracks. */
1283
+ objects?: {
1284
+ live: number;
1285
+ deleted: number;
1286
+ };
1287
+ createdAt: string;
1288
+ updatedAt: string;
1289
+ }
1290
+ /** POST /datasources/connector, POST /datasources/connector/remove */
1291
+ interface DataSourceConnectorResult {
1292
+ connector: DataSourceConnector;
1293
+ }
1294
+ /** GET /datasources/connector?slug= */
1295
+ interface DataSourceConnectorGetResult {
1296
+ connector: DataSourceConnector | null;
1297
+ }
1298
+ /** POST /datasources/sync */
1299
+ interface DataSourceSyncResult {
1300
+ job: DataSourceJob;
1301
+ }
1302
+
1303
+ /**
1304
+ * Response types for warming, sampling and retrieval evals.
1305
+ *
1306
+ * Transcribed from youai-api:
1307
+ * src/http/routes/V2Apps/manage/dataSourceEvals.ts (setView, runView)
1308
+ * src/common/DataSources/evals/types.ts
1309
+ */
1310
+
1311
+ /** An index reload in flight after an eviction, or its last failure. */
1312
+ interface DataSourcesHydration {
1313
+ copied: number;
1314
+ total: number;
1315
+ startedAt: string;
1316
+ error: string | null;
1317
+ }
1318
+ /** POST /datasources/hydrate */
1319
+ interface DataSourcesHydrateResult {
1320
+ /** True when the points were already there and nothing was started. */
1321
+ resident: boolean;
1322
+ hydration: DataSourcesHydration | null;
1323
+ }
1324
+ /** POST /datasources/sample */
1325
+ interface DataSourcesSampleResult {
1326
+ dataSource: {
1327
+ id: string;
1328
+ slug: string;
1329
+ sampleOf: string;
1330
+ pipelineVersion: number;
1331
+ };
1332
+ job: DataSourceJob;
1333
+ }
1334
+ /** `queued` until a worker claims the generation; hand-written sets start `ready`. */
1335
+ type EvalSetState = 'queued' | 'generating' | 'ready' | 'failed';
1336
+ type EvalQueryStyle = 'cloze' | 'question';
1337
+ interface EvalSet {
1338
+ id: string;
1339
+ dataSourceId: string;
1340
+ name: string;
1341
+ description: string | null;
1342
+ state: EvalSetState;
1343
+ generation: {
1344
+ style: EvalQueryStyle;
1345
+ size: number;
1346
+ modelId: string | null;
1347
+ seed: number;
1348
+ tags: string[];
1349
+ } | null;
1350
+ queryCount: number;
1351
+ /** Model spend generating questions (estimate); zero for cloze. */
1352
+ estimatedCredits: number;
1353
+ estimatedDollars: number;
1354
+ error: string | null;
1355
+ createdAt: string;
1356
+ updatedAt: string;
1357
+ }
1358
+ /** What should come back for a query; the content hash is what crosses sources. */
1359
+ interface EvalExpectation {
1360
+ contentHash: string;
1361
+ documentId: string;
1362
+ chunkIndex: number | null;
1363
+ filename: string | null;
1364
+ }
1365
+ interface EvalQuery {
1366
+ id: string;
1367
+ setId: string;
1368
+ query: string;
1369
+ expected: EvalExpectation[];
1370
+ passage: string | null;
1371
+ tags: string[];
1372
+ origin: 'generated' | 'user';
1373
+ createdAt: string;
1374
+ }
1375
+ /** Partial retrieval config plus mode, merged over the target's own. */
1376
+ interface EvalRetrieval {
1377
+ mode?: 'hybrid' | 'semantic' | 'lexical';
1378
+ hybrid?: boolean;
1379
+ rerank?: {
1380
+ enabled?: boolean;
1381
+ modelId?: string | null;
1382
+ candidates?: number;
1383
+ };
1384
+ adaptive?: {
1385
+ enabled?: boolean;
1386
+ gap?: number;
1387
+ };
1388
+ topK?: number;
1389
+ }
1390
+ type EvalRunState = 'queued' | 'running' | 'done' | 'failed';
1391
+ interface EvalAggregates {
1392
+ queries: number;
1393
+ scored: number;
1394
+ unresolvable: number;
1395
+ errors: number;
1396
+ recall: {
1397
+ at1: number;
1398
+ at5: number;
1399
+ at10: number;
1400
+ };
1401
+ chunkRecall: {
1402
+ at5: number;
1403
+ at10: number;
1404
+ queries: number;
1405
+ } | null;
1406
+ mrr: number;
1407
+ ndcg10: number;
1408
+ latency: {
1409
+ p50: number;
1410
+ p95: number;
1411
+ mean: number;
1412
+ };
1413
+ estimatedCredits: number;
1414
+ estimatedCreditsPerQuery: number;
1415
+ rerankedShare: number;
1416
+ /** Which branch found the expected document, over hits in the top 10. */
1417
+ branches: {
1418
+ denseOnly: number;
1419
+ lexicalOnly: number;
1420
+ both: number;
1421
+ unexplained: number;
1422
+ };
1423
+ byTag: Record<string, {
1424
+ queries: number;
1425
+ recallAt5: number;
1426
+ mrr: number;
1427
+ }>;
1428
+ truncatedTo: number | null;
1429
+ computedAt: string;
1430
+ }
1431
+ interface EvalRun {
1432
+ id: string;
1433
+ setId: string;
1434
+ dataSourceId: string;
1435
+ pipelineVersion: number;
1436
+ label: string | null;
1437
+ retrieval: EvalRetrieval;
1438
+ state: EvalRunState;
1439
+ completed: number;
1440
+ total: number;
1441
+ aggregates: EvalAggregates | null;
1442
+ estimatedCredits: number;
1443
+ estimatedDollars: number;
1444
+ error: string | null;
1445
+ createdAt: string;
1446
+ startedAt: string | null;
1447
+ finishedAt: string | null;
1448
+ }
1449
+ /** One row of a run's dataset. */
1450
+ interface EvalQueryResult {
1451
+ queryId: string;
1452
+ query: string;
1453
+ tags: string[];
1454
+ resolvable: boolean;
1455
+ documentRank: number | null;
1456
+ chunkRank: number | null;
1457
+ matchedVia: 'dense' | 'lexical' | 'both' | null;
1458
+ retrieved: {
1459
+ documentId: string;
1460
+ contentHash: string | null;
1461
+ chunkIndex: number | null;
1462
+ score: number;
1463
+ retrievalRank: number | null;
1464
+ matchedVia: 'dense' | 'lexical' | 'both' | null;
1465
+ }[];
1466
+ reranked: boolean;
1467
+ latencyMs: number;
1468
+ estimatedCredits: number;
1469
+ error: string | null;
1470
+ }
1471
+ interface EvalSetResult {
1472
+ set: EvalSet;
1473
+ }
1474
+ interface EvalSetsListResult {
1475
+ sets: EvalSet[];
1476
+ }
1477
+ interface EvalSetGetResult {
1478
+ set: EvalSet;
1479
+ dataSource: {
1480
+ id: string;
1481
+ slug: string;
1482
+ } | null;
1483
+ queries?: EvalQuery[];
1484
+ }
1485
+ interface EvalQueriesAddResult {
1486
+ added: number;
1487
+ queryCount: number;
1488
+ }
1489
+ interface EvalQueriesListResult {
1490
+ queries: EvalQuery[];
1491
+ }
1492
+ interface EvalRunResult {
1493
+ run: EvalRun;
1494
+ queries?: EvalQueryResult[];
1495
+ }
1496
+ interface EvalRunsListResult {
1497
+ runs: EvalRun[];
1498
+ }
1499
+ interface EvalCompareResult {
1500
+ a: EvalRun;
1501
+ b: EvalRun;
1502
+ /** Aggregate deltas, b minus a, for every numeric field. */
1503
+ delta: Record<string, unknown>;
1504
+ /** Per-query movement when both runs share a set; null otherwise. */
1505
+ queries: {
1506
+ wins: {
1507
+ queryId: string;
1508
+ query: string;
1509
+ rankA: number | null;
1510
+ rankB: number | null;
1511
+ }[];
1512
+ losses: {
1513
+ queryId: string;
1514
+ query: string;
1515
+ rankA: number | null;
1516
+ rankB: number | null;
1517
+ }[];
1518
+ unchanged: number;
1519
+ } | null;
1520
+ }
1521
+
1522
+ /**
1523
+ * Response types for data-source mappers: inspecting raw objects, testing a
1524
+ * mapper, remapping, and a job's quarantine.
1525
+ *
1526
+ * Transcribed from youai-api:
1527
+ * src/http/routes/V2Apps/manage/dataSourceMappers.ts
1528
+ * src/common/DataSources/mapping.ts (mapperView, buildInspectReport)
1529
+ */
1530
+
1531
+ /**
1532
+ * The mapper a source runs: the file it was compiled from, its version, and
1533
+ * the build it came from. The build fields are null for a tunnel run of local
1534
+ * source (`map test --dev`).
1535
+ */
1536
+ interface DataSourceMapper {
1537
+ path: string;
1538
+ /** The compiled bundle key, or `dev:<sessionId>` for a tunnel run; stamped on the documents it produces. */
1539
+ mapperKey: string;
1540
+ timeoutMs: number;
1541
+ releaseId: string | null;
1542
+ branch: string | null;
1543
+ commitSha: string | null;
1544
+ /** When this bundle became the source's active mapper. */
1545
+ activatedAt: string | null;
1546
+ }
1547
+ /** POST /datasources/mapper/deploy */
1548
+ interface DataSourceMapDeployResult {
1549
+ dataSource: {
1550
+ id: string;
1551
+ slug: string;
1552
+ };
1553
+ mapper: DataSourceMapper;
1554
+ /** False when the source already ran this bundle. */
1555
+ changed: boolean;
1556
+ }
1557
+ /** Which objects an inspect or map test looked at. */
1558
+ type DataSourceObjectSelection = {
1559
+ kind: 'store';
1560
+ store: string;
1561
+ access: 'private' | 'public';
1562
+ prefix: string;
1563
+ } | {
1564
+ kind: 'connector';
1565
+ };
1566
+ interface DataSourceInspectReport {
1567
+ objects: number;
1568
+ bytes: number;
1569
+ /** True when the listing stopped at the limit. */
1570
+ truncated: boolean;
1571
+ byExtension: {
1572
+ extension: string;
1573
+ count: number;
1574
+ bytes: number;
1575
+ }[];
1576
+ /** Keys grouped by shape, digit runs and ids collapsed: `2024/#/{uuid}.json`. */
1577
+ clusters: {
1578
+ pattern: string;
1579
+ extension: string;
1580
+ count: number;
1581
+ bytes: number;
1582
+ examples: string[];
1583
+ }[];
1584
+ sizeBuckets: {
1585
+ label: string;
1586
+ count: number;
1587
+ }[];
1588
+ /** Up to ten objects read (first 256 KB each). */
1589
+ samples: {
1590
+ key: string;
1591
+ size: number | null;
1592
+ contentType: string | null;
1593
+ encoding: 'utf-8' | 'binary';
1594
+ empty: boolean;
1595
+ /** Top-level keys when the head parsed as a JSON object. */
1596
+ jsonKeys: string[] | null;
1597
+ /** Line count for text that was not one JSON object (JSONL, CSV, ...). */
1598
+ lines: number | null;
1599
+ textLength: number;
1600
+ head: string;
1601
+ }[];
1602
+ /** Distinct top-level JSON key sets across the samples, most common first. */
1603
+ jsonSignatures: {
1604
+ keys: string[];
1605
+ count: number;
1606
+ }[];
1607
+ }
1608
+ /** POST /datasources/inspect */
1609
+ interface DataSourceInspectResult {
1610
+ selection: DataSourceObjectSelection;
1611
+ report: DataSourceInspectReport;
1612
+ }
1613
+ /** One mapped document as a map test previews it (markdown truncated). */
1614
+ interface DataSourceMapTestDocument {
1615
+ externalId: string;
1616
+ title: string;
1617
+ metadata: Record<string, string | number | boolean> | null;
1618
+ replaces: string[];
1619
+ markdownBytes: number;
1620
+ preview: string;
1621
+ }
1622
+ type DataSourceMapTestOutcome = {
1623
+ kind: 'documents';
1624
+ documents: DataSourceMapTestDocument[];
1625
+ } | {
1626
+ kind: 'passthrough';
1627
+ metadata: Record<string, string | number | boolean> | null;
1628
+ } | {
1629
+ kind: 'skip';
1630
+ reason: string;
1631
+ } | {
1632
+ kind: 'deletes';
1633
+ externalIds: string[];
1634
+ } | {
1635
+ kind: 'error';
1636
+ message: string;
1637
+ stack?: string;
1638
+ };
1639
+ /** POST /datasources/map-test */
1640
+ interface DataSourceMapTestResult {
1641
+ mapper: DataSourceMapper;
1642
+ /** The mapper ran from local source through the dev session. */
1643
+ dev: boolean;
1644
+ objects: number;
1645
+ /** Documents produced across every `documents` outcome. */
1646
+ produced: number;
1647
+ counts: {
1648
+ documents: number;
1649
+ passthrough: number;
1650
+ skip: number;
1651
+ deletes: number;
1652
+ error: number;
1653
+ };
1654
+ results: {
1655
+ key: string;
1656
+ outcome: DataSourceMapTestOutcome;
1657
+ durationMs: number;
1658
+ }[];
1659
+ }
1660
+ /** POST /datasources/remap, POST /datasources/jobs/:id/replay */
1661
+ interface DataSourceRemapResult {
1662
+ job: DataSourceJob;
1663
+ mapper: DataSourceMapper;
1664
+ dataSource: {
1665
+ id: string;
1666
+ slug: string;
1667
+ };
1668
+ }
1669
+ /** One object a job's mapper did not turn into documents. */
1670
+ interface DataSourceQuarantinedObject {
1671
+ id: string;
1672
+ /** The key or URL the object was known by. */
1673
+ ref: string;
1674
+ kind: 'skip' | 'error';
1675
+ reason: string;
1676
+ /** False when the object's raw copy never landed — a replay cannot reach it. */
1677
+ replayable: boolean;
1678
+ at: string;
1679
+ }
1680
+ /** GET /datasources/jobs/:id/quarantine */
1681
+ interface DataSourceQuarantineResult {
1682
+ job: {
1683
+ id: string;
1684
+ state: string;
1685
+ };
1686
+ dataSource: {
1687
+ id: string;
1688
+ slug: string;
1689
+ };
1690
+ counts: {
1691
+ skipped: number;
1692
+ errors: number;
1693
+ };
1694
+ /** Reasons by frequency, most common first. */
1695
+ reasons: {
1696
+ kind: 'skip' | 'error';
1697
+ reason: string;
1698
+ count: number;
1699
+ }[];
1700
+ objects: DataSourceQuarantinedObject[];
1701
+ nextCursor: string | null;
1702
+ }
1703
+
1063
1704
  /**
1064
1705
  * Response types for the data-sources management API.
1065
1706
  *
@@ -1071,6 +1712,7 @@ declare namespace data {
1071
1712
  *
1072
1713
  * 204/empty responses surface as `{ ok: true; status: number }` (readBody in api.ts).
1073
1714
  */
1715
+
1074
1716
  /**
1075
1717
  * Chunking settings pinned at pipeline creation.
1076
1718
  * Any change requires a revectorize, not a config update.
@@ -1241,6 +1883,8 @@ interface DataSourcesDocumentsResult {
1241
1883
  type DataSourcesUploadTokenResult = {
1242
1884
  alreadyCurrent: true;
1243
1885
  document: DataSourcesDocument;
1886
+ /** Mapped sources: every document this mapper version produced from the bytes. */
1887
+ documents?: DataSourcesDocument[];
1244
1888
  } | {
1245
1889
  alreadyCurrent: false;
1246
1890
  contentType: string;
@@ -1250,10 +1894,20 @@ type DataSourcesUploadTokenResult = {
1250
1894
  uploadFields: Record<string, string>;
1251
1895
  };
1252
1896
  };
1253
- /** POST /datasources/documents — confirm an uploaded document and queue a build. */
1897
+ /**
1898
+ * POST /datasources/documents — confirm an uploaded object and queue its
1899
+ * builds. On a mapped source the object is a raw copy and the mapper decides
1900
+ * what it becomes: `documents` holds everything produced, `document` the first
1901
+ * of them (null only for a `deletes` outcome).
1902
+ */
1254
1903
  interface DataSourcesDocumentConfirmResult {
1255
- document: DataSourcesDocument;
1904
+ document: DataSourcesDocument | null;
1905
+ documents: DataSourcesDocument[];
1906
+ /** Whether any document was queued for a build. */
1256
1907
  queued: boolean;
1908
+ outcome: 'unmapped' | 'documents' | 'passthrough' | 'deletes';
1909
+ /** Documents removed or superseded as a result. */
1910
+ removed: number;
1257
1911
  }
1258
1912
  /** Build progress counts used in several list and status shapes. */
1259
1913
  interface DataSourcesBuildProgress {
@@ -1317,6 +1971,16 @@ interface DataSourcesListEntry {
1317
1971
  placement: DataSourcesPlacement | null;
1318
1972
  /** A move in flight, or its last failure. */
1319
1973
  migration: DataSourcesMigration | null;
1974
+ /** The bulk ingestion job in flight on this source, if any. */
1975
+ job: DataSourceJob | null;
1976
+ /** The S3 bucket this source follows, if it is connected to one. */
1977
+ connector: DataSourceConnector | null;
1978
+ /** An index reload in flight after an eviction, or its last failure. */
1979
+ hydration: DataSourcesHydration | null;
1980
+ /** The source this one was sampled from (`datasources sample`), or null. */
1981
+ sampleOf: string | null;
1982
+ /** The mapper the live release declares for this source, or null. */
1983
+ mapper: DataSourceMapper | null;
1320
1984
  createdAt: string;
1321
1985
  }
1322
1986
  /** GET /datasources — all data sources for the app. */
@@ -1478,6 +2142,27 @@ interface DataSourcesDocumentDeleteResult {
1478
2142
  ok: true;
1479
2143
  status: number;
1480
2144
  }
2145
+ /**
2146
+ * Which documents a bulk removal selects: the row-level half of the search
2147
+ * filter (`metadata`, `filename`, `documentIds`) plus `externalIdPrefix`, the
2148
+ * identity a bulk job or connector recorded (a customer's key prefix, say).
2149
+ * Chunk-level fields and an empty selector are refused.
2150
+ */
2151
+ interface DataSourcesDocumentSelector {
2152
+ metadata?: Record<string, string | number | boolean | (string | number | boolean)[] | {
2153
+ gte?: number;
2154
+ lte?: number;
2155
+ }>;
2156
+ filename?: string | string[];
2157
+ documentIds?: string[];
2158
+ externalIdPrefix?: string;
2159
+ }
2160
+ /** POST /datasources/documents/delete-many — one page of up to 1,000. */
2161
+ interface DataSourcesDocumentDeleteManyResult {
2162
+ deleted: number;
2163
+ /** Still matching after this page; call again while > 0. */
2164
+ remaining: number;
2165
+ }
1481
2166
 
1482
2167
  /**
1483
2168
  * Data-sources operations: document ingestion, corpus search, pipeline
@@ -1490,7 +2175,7 @@ interface DataSourcesDocumentDeleteResult {
1490
2175
  */
1491
2176
 
1492
2177
  /** @internal Consumed by the CLI skin; waitForIngest documents the default. */
1493
- declare const DEFAULT_WAIT_TIMEOUT_MS$1: number;
2178
+ declare const DEFAULT_WAIT_TIMEOUT_MS$3: number;
1494
2179
  /**
1495
2180
  * The per-document summary projection used by waitForIngest, status, and the
1496
2181
  * revectorize watch loop in the skin. Exported so the skin can reuse it for
@@ -1528,7 +2213,15 @@ interface AddDocumentResult {
1528
2213
  filename: string;
1529
2214
  skipped: boolean;
1530
2215
  queued?: boolean;
1531
- document: DataSourcesDocument;
2216
+ /**
2217
+ * The document, or the first of them on a mapped source. Null only when the
2218
+ * source's mapper answered `deletes` for the file.
2219
+ */
2220
+ document: DataSourcesDocument | null;
2221
+ /** Every document the file became — one on an unmapped source. */
2222
+ documents: DataSourcesDocument[];
2223
+ /** How the source took the file; absent when it was already current. */
2224
+ outcome?: 'unmapped' | 'documents' | 'passthrough' | 'deletes';
1532
2225
  }
1533
2226
  /**
1534
2227
  * Add one document to a data source.
@@ -1587,6 +2280,24 @@ interface WaitForIngestResult {
1587
2280
  * if (result.status === 'error') { ... }
1588
2281
  */
1589
2282
  declare function waitForIngest(ctx: AdminContext, params: WaitForIngestParams): Promise<WaitForIngestResult>;
2283
+ interface WaitForCandidateParams {
2284
+ slug: string;
2285
+ /** Defaults to DEFAULT_WAIT_TIMEOUT_MS (15 min). */
2286
+ timeoutMs?: number;
2287
+ /** Receives `rebuilding… X/Y done (Ns)`. */
2288
+ onProgress?: (message: string) => void;
2289
+ }
2290
+ interface WaitForCandidateResult {
2291
+ status: 'ready' | 'error' | 'timeout';
2292
+ documents: SummarizedDocument[];
2293
+ /** Present only on status === 'timeout'. */
2294
+ error?: string;
2295
+ }
2296
+ /**
2297
+ * Poll a candidate version (`revectorize`) until every document has built.
2298
+ * `error` means at least one failed; `promote` with `force` accepts that.
2299
+ */
2300
+ declare function waitForCandidate(ctx: AdminContext, params: WaitForCandidateParams): Promise<WaitForCandidateResult>;
1590
2301
  interface DocumentsParams {
1591
2302
  /** Data source slug. */
1592
2303
  slug: string;
@@ -1630,7 +2341,7 @@ declare function allDocuments(ctx: AdminContext, params: Omit<DocumentsParams, '
1630
2341
  * @example
1631
2342
  * const { dataSources } = await admin.dataSources.list();
1632
2343
  */
1633
- declare function list$7(ctx: AdminContext): Promise<DataSourcesListResult>;
2344
+ declare function list$8(ctx: AdminContext): Promise<DataSourcesListResult>;
1634
2345
  interface SearchParams {
1635
2346
  /** Data source slug. */
1636
2347
  slug: string;
@@ -1885,6 +2596,29 @@ interface RmParams {
1885
2596
  * await admin.dataSources.rm({ slug: 'policies', documentId });
1886
2597
  */
1887
2598
  declare function rm(ctx: AdminContext, params: RmParams): Promise<DataSourcesDocumentDeleteResult>;
2599
+ interface RmWhereParams {
2600
+ /** Data source slug. */
2601
+ slug: string;
2602
+ filter: DataSourcesDocumentSelector;
2603
+ }
2604
+ /**
2605
+ * Remove one page (up to 1,000) of the documents matching a selector, across
2606
+ * every pipeline version, and report how many still match. Loop while
2607
+ * `remaining > 0`; `rmWhereAll` does that.
2608
+ *
2609
+ * @throws AdminApiError `data_source_not_found` (404), `invalid_filter` (400),
2610
+ * `data_source_busy` (422) while a job is in flight, `data_source_migrating`
2611
+ * (422) during a move.
2612
+ * @example
2613
+ * await admin.dataSources.rmWhere({ slug: 'archive', filter: { metadata: { year: 2019 } } });
2614
+ */
2615
+ declare function rmWhere(ctx: AdminContext, params: RmWhereParams): Promise<DataSourcesDocumentDeleteManyResult>;
2616
+ /** `rmWhere` until nothing matches. Reports each page through `onProgress`. */
2617
+ declare function rmWhereAll(ctx: AdminContext, params: RmWhereParams & {
2618
+ onProgress?: (message: string) => void;
2619
+ }): Promise<{
2620
+ deleted: number;
2621
+ }>;
1888
2622
  /**
1889
2623
  * Delete a whole data source — every version, every document, and every byte.
1890
2624
  *
@@ -1909,8 +2643,11 @@ type dataSources_MoveParams = MoveParams;
1909
2643
  type dataSources_PromoteParams = PromoteParams;
1910
2644
  type dataSources_RevectorizeParams = RevectorizeParams;
1911
2645
  type dataSources_RmParams = RmParams;
2646
+ type dataSources_RmWhereParams = RmWhereParams;
1912
2647
  type dataSources_SearchParams = SearchParams;
1913
2648
  type dataSources_SummarizedDocument = SummarizedDocument;
2649
+ type dataSources_WaitForCandidateParams = WaitForCandidateParams;
2650
+ type dataSources_WaitForCandidateResult = WaitForCandidateResult;
1914
2651
  type dataSources_WaitForIngestParams = WaitForIngestParams;
1915
2652
  type dataSources_WaitForIngestResult = WaitForIngestResult;
1916
2653
  type dataSources_WaitForMoveParams = WaitForMoveParams;
@@ -1926,12 +2663,584 @@ declare const dataSources_move: typeof move;
1926
2663
  declare const dataSources_promote: typeof promote;
1927
2664
  declare const dataSources_revectorize: typeof revectorize;
1928
2665
  declare const dataSources_rm: typeof rm;
2666
+ declare const dataSources_rmWhere: typeof rmWhere;
2667
+ declare const dataSources_rmWhereAll: typeof rmWhereAll;
1929
2668
  declare const dataSources_search: typeof search;
1930
2669
  declare const dataSources_summarize: typeof summarize;
2670
+ declare const dataSources_waitForCandidate: typeof waitForCandidate;
1931
2671
  declare const dataSources_waitForIngest: typeof waitForIngest;
1932
2672
  declare const dataSources_waitForMove: typeof waitForMove;
1933
2673
  declare namespace dataSources {
1934
- export { type dataSources_AddDocumentParams as AddDocumentParams, type dataSources_AddDocumentResult as AddDocumentResult, type dataSources_ConfigSetParams as ConfigSetParams, type dataSources_CreateParams as CreateParams, DEFAULT_WAIT_TIMEOUT_MS$1 as DEFAULT_WAIT_TIMEOUT_MS, dataSources_DOCUMENTS_IDS_MAX as DOCUMENTS_IDS_MAX, type dataSources_DocumentsParams as DocumentsParams, type dataSources_DropParams as DropParams, type dataSources_MoveParams as MoveParams, type dataSources_PromoteParams as PromoteParams, type dataSources_RevectorizeParams as RevectorizeParams, type dataSources_RmParams as RmParams, type dataSources_SearchParams as SearchParams, type dataSources_SummarizedDocument as SummarizedDocument, type dataSources_WaitForIngestParams as WaitForIngestParams, type dataSources_WaitForIngestResult as WaitForIngestResult, type dataSources_WaitForMoveParams as WaitForMoveParams, type dataSources_WaitForMoveResult as WaitForMoveResult, dataSources_addDocument as addDocument, dataSources_allDocuments as allDocuments, dataSources_configGet as configGet, dataSources_configSet as configSet, create$1 as create, dataSources_deleteSource as deleteSource, dataSources_documents as documents, dataSources_drop as drop, list$7 as list, dataSources_move as move, dataSources_promote as promote, dataSources_revectorize as revectorize, dataSources_rm as rm, dataSources_search as search, dataSources_summarize as summarize, dataSources_waitForIngest as waitForIngest, dataSources_waitForMove as waitForMove };
2674
+ export { type dataSources_AddDocumentParams as AddDocumentParams, type dataSources_AddDocumentResult as AddDocumentResult, type dataSources_ConfigSetParams as ConfigSetParams, type dataSources_CreateParams as CreateParams, DEFAULT_WAIT_TIMEOUT_MS$3 as DEFAULT_WAIT_TIMEOUT_MS, dataSources_DOCUMENTS_IDS_MAX as DOCUMENTS_IDS_MAX, type dataSources_DocumentsParams as DocumentsParams, type dataSources_DropParams as DropParams, type dataSources_MoveParams as MoveParams, type dataSources_PromoteParams as PromoteParams, type dataSources_RevectorizeParams as RevectorizeParams, type dataSources_RmParams as RmParams, type dataSources_RmWhereParams as RmWhereParams, type dataSources_SearchParams as SearchParams, type dataSources_SummarizedDocument as SummarizedDocument, type dataSources_WaitForCandidateParams as WaitForCandidateParams, type dataSources_WaitForCandidateResult as WaitForCandidateResult, type dataSources_WaitForIngestParams as WaitForIngestParams, type dataSources_WaitForIngestResult as WaitForIngestResult, type dataSources_WaitForMoveParams as WaitForMoveParams, type dataSources_WaitForMoveResult as WaitForMoveResult, dataSources_addDocument as addDocument, dataSources_allDocuments as allDocuments, dataSources_configGet as configGet, dataSources_configSet as configSet, create$1 as create, dataSources_deleteSource as deleteSource, dataSources_documents as documents, dataSources_drop as drop, list$8 as list, dataSources_move as move, dataSources_promote as promote, dataSources_revectorize as revectorize, dataSources_rm as rm, dataSources_rmWhere as rmWhere, dataSources_rmWhereAll as rmWhereAll, dataSources_search as search, dataSources_summarize as summarize, dataSources_waitForCandidate as waitForCandidate, dataSources_waitForIngest as waitForIngest, dataSources_waitForMove as waitForMove };
2675
+ }
2676
+
2677
+ /**
2678
+ * Bulk ingestion jobs: load a corpus into a data source from a file-store
2679
+ * prefix or a manifest of URLs, with a plan (cost, size, duration) shown
2680
+ * before anything is spent.
2681
+ *
2682
+ * Ops are pure (ctx, params) → typed result. The CLI skin in
2683
+ * commands/dataSourceJobs.ts owns flags, progress printing and exit codes.
2684
+ */
2685
+
2686
+ /** @internal Consumed by the CLI skin. */
2687
+ declare const DEFAULT_WAIT_TIMEOUT_MS$2: number;
2688
+ interface StartParams {
2689
+ /** Data source slug. Created on first use, like `add`. */
2690
+ slug: string;
2691
+ source: DataSourceJobSource;
2692
+ /** Run as soon as the plan passes the gates, without a separate approve. */
2693
+ approve?: boolean;
2694
+ /** Stop when estimated spend reaches this; default 1.5× the projection. */
2695
+ budgetDollars?: number;
2696
+ /** Batches in flight at once (default 8, max 64). */
2697
+ concurrency?: number;
2698
+ /** Process only the first N objects — a sample of the corpus. */
2699
+ limit?: number;
2700
+ }
2701
+ /**
2702
+ * Start a job. The platform enumerates the source, reads a sample, and writes
2703
+ * a plan; the job then waits in `planned` for `approve` unless `approve` was
2704
+ * set. Nothing is embedded until it runs.
2705
+ *
2706
+ * @throws AdminApiError `data_source_busy` (422) — a move, a candidate
2707
+ * version or another job is in flight; `invalid_source` (400).
2708
+ * @example
2709
+ * const { job } = await admin.dataSourceJobs.start({
2710
+ * slug: 'archive',
2711
+ * source: { type: 'store', store: 'raw', access: 'private', prefix: '2024/' },
2712
+ * });
2713
+ */
2714
+ declare function start(ctx: AdminContext, params: StartParams): Promise<DataSourceJobResult>;
2715
+ interface UploadManifestParams {
2716
+ slug: string;
2717
+ /** JSONL: one `{ url, filename?, externalId?, metadata? }` per line. */
2718
+ content: Buffer;
2719
+ }
2720
+ /**
2721
+ * Upload a manifest for `start` with a `manifest` source. Returns the key to
2722
+ * pass as `source.key`.
2723
+ */
2724
+ declare function uploadManifest(ctx: AdminContext, params: UploadManifestParams): Promise<{
2725
+ key: string;
2726
+ }>;
2727
+ interface ListParams$1 {
2728
+ /** Only this source's jobs; omit for every job on the app. */
2729
+ slug?: string;
2730
+ }
2731
+ declare function list$7(ctx: AdminContext, params?: ListParams$1): Promise<DataSourceJobsListResult>;
2732
+ interface JobIdParams {
2733
+ id: string;
2734
+ }
2735
+ /** @throws AdminApiError `job_not_found` (404). */
2736
+ declare function get$7(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobGetResult>;
2737
+ /**
2738
+ * Approve a planned job: the yes to the plan's spend. Refused when the
2739
+ * projection does not fit the source's placement or the workspace cannot
2740
+ * cover it.
2741
+ *
2742
+ * @throws AdminApiError `job_not_found` (404), `invalid_transition` (422),
2743
+ * `plan_requires_dedicated` (422), `plan_exceeds_capacity` (422),
2744
+ * `insufficient_credits` (402).
2745
+ */
2746
+ declare function approve(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
2747
+ /** Stop dispatching batches; the ones in flight finish. */
2748
+ declare function pause(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
2749
+ /** Continue from the checkpoint; failed batches with attempts left are retried. */
2750
+ declare function resume$1(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
2751
+ /** End the job. Documents already indexed stay. */
2752
+ declare function cancel(ctx: AdminContext, params: JobIdParams): Promise<DataSourceJobResult>;
2753
+ interface WaitParams$1 {
2754
+ id: string;
2755
+ /** Default one hour. */
2756
+ timeoutMs?: number;
2757
+ onProgress?: (message: string) => void;
2758
+ }
2759
+ type WaitResult = {
2760
+ status: 'done';
2761
+ job: DataSourceJob;
2762
+ }
2763
+ /** The plan is ready but the job will not run on its own: a gate refused, or it waits for approval. */
2764
+ | {
2765
+ status: 'planned';
2766
+ job: DataSourceJob;
2767
+ error: string;
2768
+ } | {
2769
+ status: 'failed';
2770
+ job: DataSourceJob;
2771
+ error: string;
2772
+ } | {
2773
+ status: 'timeout';
2774
+ job: DataSourceJob;
2775
+ error: string;
2776
+ };
2777
+ /**
2778
+ * Poll until the job leaves `planning`: the plan is ready (`done`), or a gate
2779
+ * refused it (`planned` with the job's error), or it could not be planned.
2780
+ */
2781
+ declare function waitForPlan(ctx: AdminContext, params: WaitParams$1): Promise<WaitResult>;
2782
+ /**
2783
+ * Poll until the job reaches a terminal state, pauses, or settles in `planned`
2784
+ * with nothing about to move it: a gate refused an auto-approved plan, or the
2785
+ * plan waits for an approval nobody asked this wait to give. A pause is
2786
+ * reported as `failed` with the pause reason, since nothing more will happen
2787
+ * without the owner.
2788
+ */
2789
+ declare function waitForJob(ctx: AdminContext, params: WaitParams$1): Promise<WaitResult>;
2790
+ /** One line of progress in the job's own terms. */
2791
+ declare function describeProgress(job: DataSourceJob, start: number): string;
2792
+
2793
+ type dataSourceJobs_JobIdParams = JobIdParams;
2794
+ type dataSourceJobs_StartParams = StartParams;
2795
+ type dataSourceJobs_UploadManifestParams = UploadManifestParams;
2796
+ type dataSourceJobs_WaitResult = WaitResult;
2797
+ declare const dataSourceJobs_approve: typeof approve;
2798
+ declare const dataSourceJobs_cancel: typeof cancel;
2799
+ declare const dataSourceJobs_describeProgress: typeof describeProgress;
2800
+ declare const dataSourceJobs_pause: typeof pause;
2801
+ declare const dataSourceJobs_start: typeof start;
2802
+ declare const dataSourceJobs_uploadManifest: typeof uploadManifest;
2803
+ declare const dataSourceJobs_waitForJob: typeof waitForJob;
2804
+ declare const dataSourceJobs_waitForPlan: typeof waitForPlan;
2805
+ declare namespace dataSourceJobs {
2806
+ export { DEFAULT_WAIT_TIMEOUT_MS$2 as DEFAULT_WAIT_TIMEOUT_MS, type dataSourceJobs_JobIdParams as JobIdParams, type ListParams$1 as ListParams, type dataSourceJobs_StartParams as StartParams, type dataSourceJobs_UploadManifestParams as UploadManifestParams, type WaitParams$1 as WaitParams, type dataSourceJobs_WaitResult as WaitResult, dataSourceJobs_approve as approve, dataSourceJobs_cancel as cancel, dataSourceJobs_describeProgress as describeProgress, get$7 as get, list$7 as list, dataSourceJobs_pause as pause, resume$1 as resume, dataSourceJobs_start as start, dataSourceJobs_uploadManifest as uploadManifest, dataSourceJobs_waitForJob as waitForJob, dataSourceJobs_waitForPlan as waitForPlan };
2807
+ }
2808
+
2809
+ /**
2810
+ * S3 connectors: make a bucket the customer owns the origin of a data source,
2811
+ * and keep the source in sync with it.
2812
+ *
2813
+ * Ops are pure (ctx, params) → typed result. The CLI skin in
2814
+ * commands/dataSourceConnectors.ts owns flags, progress and exit codes.
2815
+ */
2816
+
2817
+ interface ConnectParams {
2818
+ /** Data source slug. Created on first use, like `add`. */
2819
+ slug: string;
2820
+ bucket: string;
2821
+ /** AWS region of the bucket, e.g. `us-east-1`. */
2822
+ region: string;
2823
+ /** Key prefix to follow; omit for the whole bucket. */
2824
+ prefix?: string;
2825
+ /** S3-compatible endpoint (https; http for localhost). Omit for AWS. */
2826
+ endpoint?: string;
2827
+ /** NAME of the app secret holding the access key id. */
2828
+ accessKeyIdSecret: string;
2829
+ /** NAME of the app secret holding the secret access key. */
2830
+ secretAccessKeySecret: string;
2831
+ /** Default `mirror`. */
2832
+ deletions?: DataSourceConnectorDeletions;
2833
+ /** Ceiling a sync auto-approves under. */
2834
+ budgetDollarsPerSync?: number;
2835
+ }
2836
+ /**
2837
+ * Connect a source to a bucket. The two secrets must already exist on the app
2838
+ * (`secrets set`), and the keys must be able to list the prefix — both are
2839
+ * checked before anything is recorded. Calling again with the same bucket,
2840
+ * region, prefix and endpoint updates credentials and policy in place; a
2841
+ * different origin is refused until the source is disconnected.
2842
+ *
2843
+ * @throws AdminApiError `invalid_connector` (400), `connector_secret_missing`
2844
+ * (422), `connector_probe_failed` (422), `connector_exists` (422).
2845
+ * @example
2846
+ * await admin.dataSourceConnectors.connect({
2847
+ * slug: 'archive', bucket: 'acme-docs', region: 'us-east-1', prefix: 'contracts/',
2848
+ * accessKeyIdSecret: 'ARCHIVE_S3_KEY', secretAccessKeySecret: 'ARCHIVE_S3_SECRET',
2849
+ * });
2850
+ */
2851
+ declare function connect(ctx: AdminContext, params: ConnectParams): Promise<DataSourceConnectorResult>;
2852
+ /** The source's connector with its object counts, or `connector: null`. */
2853
+ declare function get$6(ctx: AdminContext, params: {
2854
+ slug: string;
2855
+ }): Promise<DataSourceConnectorGetResult>;
2856
+ /**
2857
+ * Stop following the bucket. The documents stay; only the connector and its
2858
+ * object index go.
2859
+ *
2860
+ * @throws AdminApiError `connector_not_found` (422), `data_source_busy` (422)
2861
+ * while a job is in flight.
2862
+ */
2863
+ declare function disconnect(ctx: AdminContext, params: {
2864
+ slug: string;
2865
+ }): Promise<DataSourceConnectorResult & {
2866
+ removed: true;
2867
+ }>;
2868
+ interface SyncParams {
2869
+ slug: string;
2870
+ /** Override the connector's per-sync budget for this run, in dollars. */
2871
+ budgetDollars?: number;
2872
+ }
2873
+ /**
2874
+ * Start a sync: list the bucket, diff by ETag, run a job over what changed.
2875
+ * Auto-approved under the connector's per-sync budget; a plan over it (or over
2876
+ * the placement's capacity) waits in `planned` for `dataSourceJobs.approve`.
2877
+ * Block on the result with `dataSourceJobs.waitForJob`.
2878
+ *
2879
+ * @throws AdminApiError `connector_not_found` (422), `data_source_busy` (422).
2880
+ */
2881
+ declare function sync(ctx: AdminContext, params: SyncParams): Promise<DataSourceSyncResult>;
2882
+
2883
+ type dataSourceConnectors_ConnectParams = ConnectParams;
2884
+ type dataSourceConnectors_SyncParams = SyncParams;
2885
+ declare const dataSourceConnectors_connect: typeof connect;
2886
+ declare const dataSourceConnectors_disconnect: typeof disconnect;
2887
+ declare const dataSourceConnectors_sync: typeof sync;
2888
+ declare namespace dataSourceConnectors {
2889
+ export { type dataSourceConnectors_ConnectParams as ConnectParams, type dataSourceConnectors_SyncParams as SyncParams, dataSourceConnectors_connect as connect, dataSourceConnectors_disconnect as disconnect, get$6 as get, dataSourceConnectors_sync as sync };
2890
+ }
2891
+
2892
+ /**
2893
+ * Warming an index, sampling a source, and retrieval evals: query sets, runs,
2894
+ * comparisons. Ops are pure (ctx, params) → typed result; the CLI skin in
2895
+ * commands/dataSourceEvals.ts owns flags, progress printing and exit codes.
2896
+ */
2897
+
2898
+ /** @internal Consumed by the CLI skin. */
2899
+ declare const DEFAULT_WAIT_TIMEOUT_MS$1: number;
2900
+ /**
2901
+ * Warm a source's index if it is cold. A search on a large cold index answers
2902
+ * `index_warming` until the reload lands; call this before a demo, or after an
2903
+ * eviction you know about. Answers `resident: true` when nothing was needed.
2904
+ */
2905
+ declare function hydrate(ctx: AdminContext, params: {
2906
+ slug: string;
2907
+ }): Promise<DataSourcesHydrateResult>;
2908
+ interface WaitForHydrationParams {
2909
+ slug: string;
2910
+ timeoutMs?: number;
2911
+ onProgress?: (message: string) => void;
2912
+ }
2913
+ type WaitForHydrationResult = {
2914
+ status: 'done';
2915
+ source: DataSourcesListEntry;
2916
+ } | {
2917
+ status: 'failed';
2918
+ source: DataSourcesListEntry;
2919
+ error: string;
2920
+ } | {
2921
+ status: 'timeout';
2922
+ source: DataSourcesListEntry;
2923
+ error: string;
2924
+ };
2925
+ /** Poll the source list until its `hydration` clears, fails, or the timeout elapses. */
2926
+ declare function waitForHydration(ctx: AdminContext, params: WaitForHydrationParams): Promise<WaitForHydrationResult>;
2927
+ interface SampleParams {
2928
+ /** The source to draw from. */
2929
+ slug: string;
2930
+ /** Documents to draw (at most 2,000). */
2931
+ size: number;
2932
+ /** Slug for the sample; default `<slug>-sample`. */
2933
+ as?: string;
2934
+ /** Scope the draw: metadata equality, or the full document selector. */
2935
+ filter?: Record<string, unknown>;
2936
+ /** Metadata key to stratify on, proportional per value. */
2937
+ stratify?: string;
2938
+ placement?: {
2939
+ resourceId: string;
2940
+ } | 'shared';
2941
+ }
2942
+ /**
2943
+ * Draw a sample of a source into a new source with the same pinned config.
2944
+ * The copy is a job (auto-approved; extraction is reused by content hash, so
2945
+ * the plan is chunk + embed only). Documents keep their content hashes, which
2946
+ * is what lets an eval set built on the sample score the parent too.
2947
+ *
2948
+ * @throws AdminApiError `invalid_size` (400), `slug_in_use` (422),
2949
+ * `data_source_limit` (422), `data_source_busy` (422).
2950
+ */
2951
+ declare function sample(ctx: AdminContext, params: SampleParams): Promise<DataSourcesSampleResult>;
2952
+ interface CreateSetParams {
2953
+ slug: string;
2954
+ /** Lowercase [a-z0-9_-], unique per source. */
2955
+ name: string;
2956
+ description?: string;
2957
+ /** Queries to generate from the corpus; 0 (default) makes an empty set to add to. */
2958
+ size?: number;
2959
+ /** `cloze` (default, free) or `question` (a chat model writes them). */
2960
+ style?: EvalQueryStyle;
2961
+ /** Chat model for `question`; default the source's contextual model or the platform's. */
2962
+ modelId?: string;
2963
+ tags?: string[];
2964
+ /** Makes generation reproducible; default the current time. */
2965
+ seed?: number;
2966
+ }
2967
+ /**
2968
+ * Create a query set, generating queries from the corpus when `size` is set.
2969
+ * Generation runs in the background; the set is `generating` until it is
2970
+ * `ready` (see `waitForSet`).
2971
+ *
2972
+ * @throws AdminApiError `eval_set_exists` (422), `invalid_name` (400).
2973
+ */
2974
+ declare function createSet(ctx: AdminContext, params: CreateSetParams): Promise<EvalSetResult>;
2975
+ declare function listSets(ctx: AdminContext, params?: {
2976
+ slug?: string;
2977
+ }): Promise<EvalSetsListResult>;
2978
+ declare function getSet(ctx: AdminContext, params: {
2979
+ id: string;
2980
+ queries?: boolean;
2981
+ }): Promise<EvalSetGetResult>;
2982
+ declare function deleteSet(ctx: AdminContext, params: {
2983
+ id: string;
2984
+ }): Promise<{
2985
+ deleted: true;
2986
+ set: EvalSet;
2987
+ }>;
2988
+ interface QueryInput {
2989
+ query: string;
2990
+ /** Which documents should come back; each reference must exist on the set's source. */
2991
+ expect: {
2992
+ documentIds?: string[];
2993
+ filenames?: string[];
2994
+ externalIds?: string[];
2995
+ contentHashes?: string[];
2996
+ };
2997
+ passage?: string;
2998
+ tags?: string[];
2999
+ }
3000
+ /**
3001
+ * Add hand-written queries (≤ 500 per call). Every reference is resolved
3002
+ * before anything is written; an unknown filename refuses the whole call by
3003
+ * name (`expected_document_not_found`).
3004
+ */
3005
+ declare function addQueries(ctx: AdminContext, params: {
3006
+ id: string;
3007
+ queries: QueryInput[];
3008
+ }): Promise<EvalQueriesAddResult>;
3009
+ declare function listQueries(ctx: AdminContext, params: {
3010
+ id: string;
3011
+ }): Promise<EvalQueriesListResult>;
3012
+ declare function deleteQuery(ctx: AdminContext, params: {
3013
+ id: string;
3014
+ queryId: string;
3015
+ }): Promise<{
3016
+ deleted: string;
3017
+ queryCount: number;
3018
+ }>;
3019
+ interface RunParams {
3020
+ setId: string;
3021
+ /** Target source; default the set's own. Expectations resolve by content hash. */
3022
+ slug?: string;
3023
+ /** Evaluate the target's candidate version instead of the active one. */
3024
+ candidate?: boolean;
3025
+ label?: string;
3026
+ retrieval?: EvalRetrieval;
3027
+ }
3028
+ /**
3029
+ * Score a set against a target. Runs in the background; block with
3030
+ * `waitForRun`. Each query is a real search (embedding + rerank spend).
3031
+ *
3032
+ * @throws AdminApiError `eval_set_not_ready` (422), `eval_set_empty` (422),
3033
+ * `no_candidate_pipeline` (404), `invalid_retrieval` (400).
3034
+ */
3035
+ declare function run(ctx: AdminContext, params: RunParams): Promise<EvalRunResult>;
3036
+ declare function listRuns(ctx: AdminContext, params?: {
3037
+ setId?: string;
3038
+ slug?: string;
3039
+ }): Promise<EvalRunsListResult>;
3040
+ declare function getRun$1(ctx: AdminContext, params: {
3041
+ id: string;
3042
+ queries?: boolean;
3043
+ worst?: number;
3044
+ }): Promise<EvalRunResult>;
3045
+ /** Two runs side by side: aggregate deltas, and per-query wins/losses when they share a set. */
3046
+ declare function compare(ctx: AdminContext, params: {
3047
+ a: string;
3048
+ b: string;
3049
+ }): Promise<EvalCompareResult>;
3050
+ interface WaitParams {
3051
+ id: string;
3052
+ timeoutMs?: number;
3053
+ onProgress?: (message: string) => void;
3054
+ }
3055
+ type WaitForRunResult = {
3056
+ status: 'done';
3057
+ run: EvalRun;
3058
+ } | {
3059
+ status: 'failed';
3060
+ run: EvalRun;
3061
+ error: string;
3062
+ } | {
3063
+ status: 'timeout';
3064
+ run: EvalRun;
3065
+ error: string;
3066
+ };
3067
+ declare function waitForRun(ctx: AdminContext, params: WaitParams): Promise<WaitForRunResult>;
3068
+ type WaitForSetResult = {
3069
+ status: 'done';
3070
+ set: EvalSet;
3071
+ } | {
3072
+ status: 'failed';
3073
+ set: EvalSet;
3074
+ error: string;
3075
+ } | {
3076
+ status: 'timeout';
3077
+ set: EvalSet;
3078
+ error: string;
3079
+ };
3080
+ /** Poll until generation lands (`ready`) or fails; a set waits `queued` for a worker first. */
3081
+ declare function waitForSet(ctx: AdminContext, params: WaitParams): Promise<WaitForSetResult>;
3082
+
3083
+ type dataSourceEvals_CreateSetParams = CreateSetParams;
3084
+ type dataSourceEvals_QueryInput = QueryInput;
3085
+ type dataSourceEvals_RunParams = RunParams;
3086
+ type dataSourceEvals_SampleParams = SampleParams;
3087
+ type dataSourceEvals_WaitForHydrationParams = WaitForHydrationParams;
3088
+ type dataSourceEvals_WaitForHydrationResult = WaitForHydrationResult;
3089
+ type dataSourceEvals_WaitForRunResult = WaitForRunResult;
3090
+ type dataSourceEvals_WaitForSetResult = WaitForSetResult;
3091
+ type dataSourceEvals_WaitParams = WaitParams;
3092
+ declare const dataSourceEvals_addQueries: typeof addQueries;
3093
+ declare const dataSourceEvals_compare: typeof compare;
3094
+ declare const dataSourceEvals_createSet: typeof createSet;
3095
+ declare const dataSourceEvals_deleteQuery: typeof deleteQuery;
3096
+ declare const dataSourceEvals_deleteSet: typeof deleteSet;
3097
+ declare const dataSourceEvals_getSet: typeof getSet;
3098
+ declare const dataSourceEvals_hydrate: typeof hydrate;
3099
+ declare const dataSourceEvals_listQueries: typeof listQueries;
3100
+ declare const dataSourceEvals_listRuns: typeof listRuns;
3101
+ declare const dataSourceEvals_listSets: typeof listSets;
3102
+ declare const dataSourceEvals_run: typeof run;
3103
+ declare const dataSourceEvals_sample: typeof sample;
3104
+ declare const dataSourceEvals_waitForHydration: typeof waitForHydration;
3105
+ declare const dataSourceEvals_waitForRun: typeof waitForRun;
3106
+ declare const dataSourceEvals_waitForSet: typeof waitForSet;
3107
+ declare namespace dataSourceEvals {
3108
+ export { type dataSourceEvals_CreateSetParams as CreateSetParams, DEFAULT_WAIT_TIMEOUT_MS$1 as DEFAULT_WAIT_TIMEOUT_MS, type dataSourceEvals_QueryInput as QueryInput, type dataSourceEvals_RunParams as RunParams, type dataSourceEvals_SampleParams as SampleParams, type dataSourceEvals_WaitForHydrationParams as WaitForHydrationParams, type dataSourceEvals_WaitForHydrationResult as WaitForHydrationResult, type dataSourceEvals_WaitForRunResult as WaitForRunResult, type dataSourceEvals_WaitForSetResult as WaitForSetResult, type dataSourceEvals_WaitParams as WaitParams, dataSourceEvals_addQueries as addQueries, dataSourceEvals_compare as compare, dataSourceEvals_createSet as createSet, dataSourceEvals_deleteQuery as deleteQuery, dataSourceEvals_deleteSet as deleteSet, getRun$1 as getRun, dataSourceEvals_getSet as getSet, dataSourceEvals_hydrate as hydrate, dataSourceEvals_listQueries as listQueries, dataSourceEvals_listRuns as listRuns, dataSourceEvals_listSets as listSets, dataSourceEvals_run as run, dataSourceEvals_sample as sample, dataSourceEvals_waitForHydration as waitForHydration, dataSourceEvals_waitForRun as waitForRun, dataSourceEvals_waitForSet as waitForSet };
3109
+ }
3110
+
3111
+ /**
3112
+ * Data-source mappers: the loop around customer code that turns raw objects
3113
+ * into documents — inspect the objects, test the mapper, make a build's mapper
3114
+ * the source's active one, remap after a fix, read and replay what a job
3115
+ * quarantined.
3116
+ *
3117
+ * Ops are pure (ctx, params) → typed result. The CLI skin in
3118
+ * commands/dataSourceMappers.ts owns flags, progress and exit codes.
3119
+ */
3120
+
3121
+ /** Which objects to look at: a prefix of an app file store, or the connected bucket. */
3122
+ type ObjectSelection = {
3123
+ store: string;
3124
+ access?: 'private' | 'public';
3125
+ prefix?: string;
3126
+ } | {
3127
+ connector: true;
3128
+ };
3129
+ interface InspectParams {
3130
+ /** Required for a connector selection; optional for a store. */
3131
+ slug?: string;
3132
+ selection: ObjectSelection;
3133
+ /** Only these keys. */
3134
+ keys?: string[];
3135
+ /** Objects to list (default 5,000, max 50,000). */
3136
+ limit?: number;
3137
+ }
3138
+ /**
3139
+ * Profile raw objects before writing a mapper: counts and bytes by extension
3140
+ * and by key shape, size buckets, and ten sampled heads with their JSON key
3141
+ * signatures. Read-only.
3142
+ *
3143
+ * @throws AdminApiError `invalid_source` (400), `connector_not_found` (422).
3144
+ */
3145
+ declare function inspect(ctx: AdminContext, params: InspectParams): Promise<DataSourceInspectResult>;
3146
+ interface MapTestParams {
3147
+ slug: string;
3148
+ selection: ObjectSelection;
3149
+ keys?: string[];
3150
+ /** Objects to map (default 20, max 200). */
3151
+ limit?: number;
3152
+ /** Run the LOCAL mapper through the app's dev session instead of the live bundle. */
3153
+ dev?: boolean;
3154
+ }
3155
+ /**
3156
+ * Run the source's mapper over real objects and return the outcomes — nothing
3157
+ * is ingested. With `dev` the mapper runs from local source through the
3158
+ * running dev session, which is how a mapper is checked before a deploy.
3159
+ *
3160
+ * @throws AdminApiError `no_mapper` (422), `no_dev_session` (422),
3161
+ * `invalid_source` (400).
3162
+ */
3163
+ declare function mapTest(ctx: AdminContext, params: MapTestParams): Promise<DataSourceMapTestResult>;
3164
+ interface RemapParams {
3165
+ slug: string;
3166
+ /** Pause when estimated spend reaches this; default the plan's headroom. */
3167
+ budgetDollars?: number;
3168
+ /** Only the first N raw objects. */
3169
+ limit?: number;
3170
+ }
3171
+ interface MapDeployParams {
3172
+ slug: string;
3173
+ /**
3174
+ * The release to take the mapper from. Default: the newest built release —
3175
+ * live or the head of any branch — that carries a compiled mapper for the
3176
+ * slug.
3177
+ */
3178
+ releaseId?: string;
3179
+ }
3180
+ /**
3181
+ * Make a built release's compiled mapper the source's active mapper — what
3182
+ * jobs, syncs and `add()` run from now on. A branch build is enough: the app
3183
+ * need never have been published. Publishing to main also activates the
3184
+ * mapper main declares. Idempotent (`changed: false` when already active).
3185
+ *
3186
+ * @throws AdminApiError `no_built_mapper` (422) when no build carries a
3187
+ * compiled mapper for the slug, `release_not_found` (404).
3188
+ */
3189
+ declare function mapDeploy(ctx: AdminContext, params: MapDeployParams): Promise<DataSourceMapDeployResult>;
3190
+ /**
3191
+ * Run the active mapper over every raw object the source holds a copy of.
3192
+ * Auto-approved: unchanged markdown is skipped by hash, so a remap after a
3193
+ * metadata tweak costs frames and little else. Block on the job with
3194
+ * `dataSourceJobs.waitForJob`.
3195
+ *
3196
+ * @throws AdminApiError `no_mapper` (422), `nothing_to_remap` (422),
3197
+ * `data_source_busy` (422).
3198
+ */
3199
+ declare function remap(ctx: AdminContext, params: RemapParams): Promise<DataSourceRemapResult>;
3200
+ interface QuarantineParams {
3201
+ id: string;
3202
+ kind?: 'skip' | 'error';
3203
+ /** Only objects quarantined with exactly this reason. */
3204
+ reason?: string;
3205
+ cursor?: string;
3206
+ /** Page size (default 100, max 1,000). */
3207
+ limit?: number;
3208
+ }
3209
+ /**
3210
+ * What a job's mapper skipped or failed on: counts, reasons by frequency, and
3211
+ * a page of objects.
3212
+ *
3213
+ * @throws AdminApiError `job_not_found` (404).
3214
+ */
3215
+ declare function quarantine(ctx: AdminContext, params: QuarantineParams): Promise<DataSourceQuarantineResult>;
3216
+ interface ReplayParams {
3217
+ id: string;
3218
+ kind?: 'skip' | 'error';
3219
+ }
3220
+ /**
3221
+ * Run a job's quarantined objects through the current mapper, from their raw
3222
+ * copies. Starts a job; block on it with `dataSourceJobs.waitForJob`.
3223
+ *
3224
+ * @throws AdminApiError `nothing_to_replay` (422), `no_mapper` (422),
3225
+ * `data_source_busy` (422).
3226
+ */
3227
+ declare function replay(ctx: AdminContext, params: ReplayParams): Promise<DataSourceRemapResult>;
3228
+
3229
+ type dataSourceMappers_InspectParams = InspectParams;
3230
+ type dataSourceMappers_MapDeployParams = MapDeployParams;
3231
+ type dataSourceMappers_MapTestParams = MapTestParams;
3232
+ type dataSourceMappers_ObjectSelection = ObjectSelection;
3233
+ type dataSourceMappers_QuarantineParams = QuarantineParams;
3234
+ type dataSourceMappers_RemapParams = RemapParams;
3235
+ type dataSourceMappers_ReplayParams = ReplayParams;
3236
+ declare const dataSourceMappers_inspect: typeof inspect;
3237
+ declare const dataSourceMappers_mapDeploy: typeof mapDeploy;
3238
+ declare const dataSourceMappers_mapTest: typeof mapTest;
3239
+ declare const dataSourceMappers_quarantine: typeof quarantine;
3240
+ declare const dataSourceMappers_remap: typeof remap;
3241
+ declare const dataSourceMappers_replay: typeof replay;
3242
+ declare namespace dataSourceMappers {
3243
+ export { type dataSourceMappers_InspectParams as InspectParams, type dataSourceMappers_MapDeployParams as MapDeployParams, type dataSourceMappers_MapTestParams as MapTestParams, type dataSourceMappers_ObjectSelection as ObjectSelection, type dataSourceMappers_QuarantineParams as QuarantineParams, type dataSourceMappers_RemapParams as RemapParams, type dataSourceMappers_ReplayParams as ReplayParams, dataSourceMappers_inspect as inspect, dataSourceMappers_mapDeploy as mapDeploy, dataSourceMappers_mapTest as mapTest, dataSourceMappers_quarantine as quarantine, dataSourceMappers_remap as remap, dataSourceMappers_replay as replay };
1935
3244
  }
1936
3245
 
1937
3246
  /**
@@ -5835,6 +7144,10 @@ declare function buildClient(ctx: AdminContext): {
5835
7144
  cron: BoundOps<typeof cron>;
5836
7145
  data: BoundOps<typeof data>;
5837
7146
  dataSources: BoundOps<typeof dataSources>;
7147
+ dataSourceJobs: BoundOps<typeof dataSourceJobs>;
7148
+ dataSourceConnectors: BoundOps<typeof dataSourceConnectors>;
7149
+ dataSourceEvals: BoundOps<typeof dataSourceEvals>;
7150
+ dataSourceMappers: BoundOps<typeof dataSourceMappers>;
5838
7151
  db: BoundOps<typeof db>;
5839
7152
  diagnostics: BoundOps<typeof diagnostics>;
5840
7153
  domains: BoundOps<typeof domains>;
@@ -5911,4 +7224,4 @@ declare class AdminTimeoutError extends Error {
5911
7224
 
5912
7225
  declare const admin: AdminClient;
5913
7226
 
5914
- export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueKind, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OutboundDnsInstructions, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFailureFields, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
7227
+ export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourceConnector, type DataSourceConnectorCredentials, type DataSourceConnectorDeletions, type DataSourceConnectorGetResult, type DataSourceConnectorPolicy, type DataSourceConnectorResult, type DataSourceInspectReport, type DataSourceInspectResult, type DataSourceJob, type DataSourceJobGetResult, type DataSourceJobManifestTokenResult, type DataSourceJobPlan, type DataSourceJobResult, type DataSourceJobSource, type DataSourceJobState, type DataSourceJobsListResult, type DataSourceMapDeployResult, type DataSourceMapTestDocument, type DataSourceMapTestOutcome, type DataSourceMapTestResult, type DataSourceMapper, type DataSourceObjectSelection, type DataSourceQuarantineResult, type DataSourceQuarantinedObject, type DataSourceRemapResult, type DataSourceSyncResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteManyResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentSelector, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesHydrateResult, type DataSourcesHydration, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSampleResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EvalAggregates, type EvalCompareResult, type EvalExpectation, type EvalQueriesAddResult, type EvalQueriesListResult, type EvalQuery, type EvalQueryResult, type EvalQueryStyle, type EvalRetrieval, type EvalRun, type EvalRunResult, type EvalRunState, type EvalRunsListResult, type EvalSet, type EvalSetGetResult, type EvalSetResult, type EvalSetState, type EvalSetsListResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueKind, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OutboundDnsInstructions, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFailureFields, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };