@to11ai/sdk 3.0.0-rc.23 → 3.0.0-rc.24

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.
@@ -25875,6 +25875,683 @@ export type SessionsGetSessionResponses = {
25875
25875
  };
25876
25876
  };
25877
25877
  export type SessionsGetSessionResponse = SessionsGetSessionResponses[keyof SessionsGetSessionResponses];
25878
+ export type SessionsExportSessionData = {
25879
+ body?: never;
25880
+ path: {
25881
+ projectId: string;
25882
+ sessionId: string;
25883
+ };
25884
+ query?: never;
25885
+ url: '/v1/projects/{projectId}/sessions/{sessionId}/export';
25886
+ };
25887
+ export type SessionsExportSessionErrors = {
25888
+ /**
25889
+ * BadRequestError
25890
+ */
25891
+ 400: BadRequestError;
25892
+ /**
25893
+ * UnauthorizedError
25894
+ */
25895
+ 401: UnauthorizedError;
25896
+ /**
25897
+ * ForbiddenError
25898
+ */
25899
+ 403: ForbiddenError;
25900
+ /**
25901
+ * NotFoundError
25902
+ */
25903
+ 404: NotFoundError;
25904
+ /**
25905
+ * ConflictError
25906
+ */
25907
+ 409: ConflictError;
25908
+ /**
25909
+ * GoneError
25910
+ */
25911
+ 410: GoneError;
25912
+ /**
25913
+ * ContentTooLargeError
25914
+ */
25915
+ 413: ContentTooLargeError;
25916
+ /**
25917
+ * MisdirectedRequestError
25918
+ */
25919
+ 421: MisdirectedRequestError;
25920
+ /**
25921
+ * UnprocessableEntityError
25922
+ */
25923
+ 422: UnprocessableEntityError;
25924
+ /**
25925
+ * TooManyRequestsError
25926
+ */
25927
+ 429: TooManyRequestsError;
25928
+ /**
25929
+ * InternalServerError
25930
+ */
25931
+ 500: InternalServerError;
25932
+ /**
25933
+ * ServiceUnavailableError
25934
+ */
25935
+ 503: ServiceUnavailableError;
25936
+ };
25937
+ export type SessionsExportSessionError = SessionsExportSessionErrors[keyof SessionsExportSessionErrors];
25938
+ export type SessionsExportSessionResponses = {
25939
+ /**
25940
+ * Success
25941
+ */
25942
+ 200: {
25943
+ session: {
25944
+ apiPriceEquivalentUsd: number | null;
25945
+ billedCostUsd: number | null;
25946
+ billingMode: 'subscription' | 'api' | 'unknown' | 'mixed' | null;
25947
+ cost: {
25948
+ api_price_equivalent_total?: number | null;
25949
+ billed_total?: number | null;
25950
+ by_model?: Array<{
25951
+ mode?: string | null;
25952
+ model: string;
25953
+ provider: string;
25954
+ region?: string | null;
25955
+ span_count: number;
25956
+ tier?: string | null;
25957
+ tokens: {
25958
+ cache_creation?: {
25959
+ cost: number | null;
25960
+ count: number;
25961
+ } | null;
25962
+ cache_creation_12h?: {
25963
+ cost: number | null;
25964
+ count: number;
25965
+ } | null;
25966
+ cache_creation_1h?: {
25967
+ cost: number | null;
25968
+ count: number;
25969
+ } | null;
25970
+ cache_creation_5m?: {
25971
+ cost: number | null;
25972
+ count: number;
25973
+ } | null;
25974
+ cache_read?: {
25975
+ cost: number | null;
25976
+ count: number;
25977
+ } | null;
25978
+ input: {
25979
+ cost: number | null;
25980
+ count: number;
25981
+ };
25982
+ missing_rates?: Array<'input' | 'output' | 'cache_read' | 'cache_creation' | 'cache_creation_5m' | 'cache_creation_1h' | 'cache_creation_12h' | 'reasoning'> | null;
25983
+ output: {
25984
+ cost: number | null;
25985
+ count: number;
25986
+ };
25987
+ reasoning?: {
25988
+ cost: number | null;
25989
+ count: number;
25990
+ } | null;
25991
+ total: {
25992
+ cost: number | null;
25993
+ count: number;
25994
+ };
25995
+ };
25996
+ total: number | null;
25997
+ }> | null;
25998
+ currency: 'USD';
25999
+ tokens: {
26000
+ cache_creation?: {
26001
+ cost: number | null;
26002
+ count: number;
26003
+ } | null;
26004
+ cache_creation_12h?: {
26005
+ cost: number | null;
26006
+ count: number;
26007
+ } | null;
26008
+ cache_creation_1h?: {
26009
+ cost: number | null;
26010
+ count: number;
26011
+ } | null;
26012
+ cache_creation_5m?: {
26013
+ cost: number | null;
26014
+ count: number;
26015
+ } | null;
26016
+ cache_read?: {
26017
+ cost: number | null;
26018
+ count: number;
26019
+ } | null;
26020
+ input: {
26021
+ cost: number | null;
26022
+ count: number;
26023
+ };
26024
+ output: {
26025
+ cost: number | null;
26026
+ count: number;
26027
+ };
26028
+ reasoning?: {
26029
+ cost: number | null;
26030
+ count: number;
26031
+ } | null;
26032
+ total: {
26033
+ cost: number | null;
26034
+ count: number;
26035
+ };
26036
+ };
26037
+ total: number | null;
26038
+ };
26039
+ costUsd: number | null;
26040
+ durationMs: number;
26041
+ errorCount: number;
26042
+ errorTypes: Array<string>;
26043
+ firstSeen: string;
26044
+ lastSeen: string;
26045
+ models: Array<string>;
26046
+ owner: {
26047
+ displayName: string | null;
26048
+ id: string;
26049
+ } | null;
26050
+ providerSlug: string | null;
26051
+ pullRequests: Array<{
26052
+ number: number;
26053
+ state: 'open' | 'draft' | 'merged' | 'closed';
26054
+ url: string;
26055
+ /**
26056
+ * The session's usage on this pull request: its spans on the pull request's branch inside the pull request's window, as of the pull request's last link rebuild, not limited to the requested window. Spans aging out of the 60-day retention never lower it. Zero when none of its spans is on the pull request. `null` until the pull request's links are next rebuilt.
26057
+ */
26058
+ usage?: {
26059
+ apiEquivalentUsd: number | null;
26060
+ requests: number;
26061
+ tokens: number;
26062
+ } | null;
26063
+ }>;
26064
+ requestCount: number;
26065
+ sessionId: string;
26066
+ startedAt: string;
26067
+ title: string | null;
26068
+ tokens: {
26069
+ cacheCreation: number;
26070
+ cacheRead: number;
26071
+ input: number;
26072
+ output: number;
26073
+ reasoning: number;
26074
+ };
26075
+ toolCalls: number;
26076
+ traceCount: number;
26077
+ vcsHeadName: string | null;
26078
+ vcsRepositoryUrl: string | null;
26079
+ };
26080
+ spans: Array<{
26081
+ api_price_equivalent_usd: number | null;
26082
+ attributes: {
26083
+ [key: string]: string | number | boolean | null;
26084
+ };
26085
+ billed_cost_usd: number | null;
26086
+ billing_mode: 'subscription' | 'api' | 'unknown' | null;
26087
+ consumedBy?: Array<{
26088
+ kind: string;
26089
+ name: string;
26090
+ spanId: string;
26091
+ traceId: string;
26092
+ }> | null;
26093
+ cost: {
26094
+ api_price_equivalent_total?: number | null;
26095
+ billed_total?: number | null;
26096
+ currency: 'USD';
26097
+ tokens: {
26098
+ cache_creation?: {
26099
+ cost: number | null;
26100
+ count: number;
26101
+ } | null;
26102
+ cache_creation_12h?: {
26103
+ cost: number | null;
26104
+ count: number;
26105
+ } | null;
26106
+ cache_creation_1h?: {
26107
+ cost: number | null;
26108
+ count: number;
26109
+ } | null;
26110
+ cache_creation_5m?: {
26111
+ cost: number | null;
26112
+ count: number;
26113
+ } | null;
26114
+ cache_read?: {
26115
+ cost: number | null;
26116
+ count: number;
26117
+ } | null;
26118
+ input: {
26119
+ cost: number | null;
26120
+ count: number;
26121
+ };
26122
+ missing_rates?: Array<'input' | 'output' | 'cache_read' | 'cache_creation' | 'cache_creation_5m' | 'cache_creation_1h' | 'cache_creation_12h' | 'reasoning'> | null;
26123
+ output: {
26124
+ cost: number | null;
26125
+ count: number;
26126
+ };
26127
+ reasoning?: {
26128
+ cost: number | null;
26129
+ count: number;
26130
+ } | null;
26131
+ total: {
26132
+ cost: number | null;
26133
+ count: number;
26134
+ };
26135
+ };
26136
+ total: number | null;
26137
+ } | null;
26138
+ duration_ms: number;
26139
+ events: Array<{
26140
+ attributes: {
26141
+ [key: string]: string | number | boolean | null;
26142
+ };
26143
+ name: string;
26144
+ timestampOffsetMs: number;
26145
+ }>;
26146
+ kind: 'SERVER' | 'CLIENT' | 'INTERNAL';
26147
+ links?: Array<{
26148
+ attributes: {
26149
+ [key: string]: string;
26150
+ };
26151
+ kind: string;
26152
+ name: string;
26153
+ spanId: string;
26154
+ traceId: string;
26155
+ }> | null;
26156
+ name: string;
26157
+ parent_span_id: string | null;
26158
+ span_id: string;
26159
+ startOffsetMs: number;
26160
+ start_time: string;
26161
+ status: 'ok' | 'error' | 'timeout';
26162
+ trace_id: string;
26163
+ type: 'generation' | 'span';
26164
+ }>;
26165
+ truncated: boolean;
26166
+ };
26167
+ };
26168
+ export type SessionsExportSessionResponse = SessionsExportSessionResponses[keyof SessionsExportSessionResponses];
26169
+ export type SessionsGetSessionTurnData = {
26170
+ body?: never;
26171
+ path: {
26172
+ projectId: string;
26173
+ sessionId: string;
26174
+ traceId: string;
26175
+ };
26176
+ query?: {
26177
+ view?: 'last' | 'first' | 'io' | 'all' | null;
26178
+ };
26179
+ url: '/v1/projects/{projectId}/sessions/{sessionId}/turns/{traceId}';
26180
+ };
26181
+ export type SessionsGetSessionTurnErrors = {
26182
+ /**
26183
+ * BadRequestError
26184
+ */
26185
+ 400: BadRequestError;
26186
+ /**
26187
+ * UnauthorizedError
26188
+ */
26189
+ 401: UnauthorizedError;
26190
+ /**
26191
+ * ForbiddenError
26192
+ */
26193
+ 403: ForbiddenError;
26194
+ /**
26195
+ * NotFoundError
26196
+ */
26197
+ 404: NotFoundError;
26198
+ /**
26199
+ * ConflictError
26200
+ */
26201
+ 409: ConflictError;
26202
+ /**
26203
+ * GoneError
26204
+ */
26205
+ 410: GoneError;
26206
+ /**
26207
+ * ContentTooLargeError
26208
+ */
26209
+ 413: ContentTooLargeError;
26210
+ /**
26211
+ * MisdirectedRequestError
26212
+ */
26213
+ 421: MisdirectedRequestError;
26214
+ /**
26215
+ * UnprocessableEntityError
26216
+ */
26217
+ 422: UnprocessableEntityError;
26218
+ /**
26219
+ * TooManyRequestsError
26220
+ */
26221
+ 429: TooManyRequestsError;
26222
+ /**
26223
+ * InternalServerError
26224
+ */
26225
+ 500: InternalServerError;
26226
+ /**
26227
+ * ServiceUnavailableError
26228
+ */
26229
+ 503: ServiceUnavailableError;
26230
+ };
26231
+ export type SessionsGetSessionTurnError = SessionsGetSessionTurnErrors[keyof SessionsGetSessionTurnErrors];
26232
+ export type SessionsGetSessionTurnResponses = {
26233
+ /**
26234
+ * Success
26235
+ */
26236
+ 200: {
26237
+ code: number;
26238
+ data: {
26239
+ budgetExceeded: boolean;
26240
+ duration_ms: number;
26241
+ payloads: {
26242
+ [key: string]: {
26243
+ input: {
26244
+ chars: number;
26245
+ kind: 'preview';
26246
+ previewChars: number;
26247
+ truncatedStrings: number;
26248
+ } | {
26249
+ bytes: number;
26250
+ kind: 'omitted';
26251
+ reason: 'too_large' | 'budget';
26252
+ } | null;
26253
+ output: {
26254
+ chars: number;
26255
+ kind: 'preview';
26256
+ previewChars: number;
26257
+ truncatedStrings: number;
26258
+ } | {
26259
+ bytes: number;
26260
+ kind: 'omitted';
26261
+ reason: 'too_large' | 'budget';
26262
+ } | null;
26263
+ };
26264
+ };
26265
+ spans: Array<{
26266
+ api_price_equivalent_usd: number | null;
26267
+ attributes: {
26268
+ [key: string]: string | number | boolean | null;
26269
+ };
26270
+ billed_cost_usd: number | null;
26271
+ billing_mode: 'subscription' | 'api' | 'unknown' | null;
26272
+ consumedBy?: Array<{
26273
+ kind: string;
26274
+ name: string;
26275
+ spanId: string;
26276
+ traceId: string;
26277
+ }> | null;
26278
+ cost: {
26279
+ api_price_equivalent_total?: number | null;
26280
+ billed_total?: number | null;
26281
+ currency: 'USD';
26282
+ tokens: {
26283
+ cache_creation?: {
26284
+ cost: number | null;
26285
+ count: number;
26286
+ } | null;
26287
+ cache_creation_12h?: {
26288
+ cost: number | null;
26289
+ count: number;
26290
+ } | null;
26291
+ cache_creation_1h?: {
26292
+ cost: number | null;
26293
+ count: number;
26294
+ } | null;
26295
+ cache_creation_5m?: {
26296
+ cost: number | null;
26297
+ count: number;
26298
+ } | null;
26299
+ cache_read?: {
26300
+ cost: number | null;
26301
+ count: number;
26302
+ } | null;
26303
+ input: {
26304
+ cost: number | null;
26305
+ count: number;
26306
+ };
26307
+ missing_rates?: Array<'input' | 'output' | 'cache_read' | 'cache_creation' | 'cache_creation_5m' | 'cache_creation_1h' | 'cache_creation_12h' | 'reasoning'> | null;
26308
+ output: {
26309
+ cost: number | null;
26310
+ count: number;
26311
+ };
26312
+ reasoning?: {
26313
+ cost: number | null;
26314
+ count: number;
26315
+ } | null;
26316
+ total: {
26317
+ cost: number | null;
26318
+ count: number;
26319
+ };
26320
+ };
26321
+ total: number | null;
26322
+ } | null;
26323
+ duration_ms: number;
26324
+ events: Array<{
26325
+ attributes: {
26326
+ [key: string]: string | number | boolean | null;
26327
+ };
26328
+ name: string;
26329
+ timestampOffsetMs: number;
26330
+ }>;
26331
+ kind: 'SERVER' | 'CLIENT' | 'INTERNAL';
26332
+ links?: Array<{
26333
+ attributes: {
26334
+ [key: string]: string;
26335
+ };
26336
+ kind: string;
26337
+ name: string;
26338
+ spanId: string;
26339
+ traceId: string;
26340
+ }> | null;
26341
+ name: string;
26342
+ parent_span_id: string | null;
26343
+ span_id: string;
26344
+ startOffsetMs: number;
26345
+ start_time: string;
26346
+ status: 'ok' | 'error' | 'timeout';
26347
+ trace_id: string;
26348
+ type: 'generation' | 'span';
26349
+ }>;
26350
+ spansTruncated: boolean;
26351
+ start_time: string;
26352
+ status: 'ok' | 'error' | 'timeout';
26353
+ trace_id: string;
26354
+ view: 'last' | 'first' | 'io' | 'all';
26355
+ } | null;
26356
+ error: {
26357
+ code: string;
26358
+ details?: unknown | null;
26359
+ message: string;
26360
+ rowErrors?: Array<{
26361
+ code: string;
26362
+ message: string;
26363
+ path: Array<string | number>;
26364
+ }> | null;
26365
+ } | null;
26366
+ pagination: {
26367
+ limit: number;
26368
+ page: number;
26369
+ total: number;
26370
+ totalPages: number;
26371
+ } | null;
26372
+ sdkBehavior?: {
26373
+ flags: {
26374
+ [key: string]: unknown;
26375
+ };
26376
+ v: number;
26377
+ } | null;
26378
+ success: boolean;
26379
+ };
26380
+ };
26381
+ export type SessionsGetSessionTurnResponse = SessionsGetSessionTurnResponses[keyof SessionsGetSessionTurnResponses];
26382
+ export type SessionsGetSessionSpanFieldData = {
26383
+ body?: never;
26384
+ path: {
26385
+ projectId: string;
26386
+ sessionId: string;
26387
+ traceId: string;
26388
+ spanId: string;
26389
+ };
26390
+ query: {
26391
+ field: 'input' | 'output';
26392
+ };
26393
+ url: '/v1/projects/{projectId}/sessions/{sessionId}/turns/{traceId}/spans/{spanId}';
26394
+ };
26395
+ export type SessionsGetSessionSpanFieldErrors = {
26396
+ /**
26397
+ * BadRequestError
26398
+ */
26399
+ 400: BadRequestError;
26400
+ /**
26401
+ * UnauthorizedError
26402
+ */
26403
+ 401: UnauthorizedError;
26404
+ /**
26405
+ * ForbiddenError
26406
+ */
26407
+ 403: ForbiddenError;
26408
+ /**
26409
+ * NotFoundError
26410
+ */
26411
+ 404: NotFoundError;
26412
+ /**
26413
+ * ConflictError
26414
+ */
26415
+ 409: ConflictError;
26416
+ /**
26417
+ * GoneError
26418
+ */
26419
+ 410: GoneError;
26420
+ /**
26421
+ * ContentTooLargeError
26422
+ */
26423
+ 413: ContentTooLargeError;
26424
+ /**
26425
+ * MisdirectedRequestError
26426
+ */
26427
+ 421: MisdirectedRequestError;
26428
+ /**
26429
+ * UnprocessableEntityError
26430
+ */
26431
+ 422: UnprocessableEntityError;
26432
+ /**
26433
+ * TooManyRequestsError
26434
+ */
26435
+ 429: TooManyRequestsError;
26436
+ /**
26437
+ * InternalServerError
26438
+ */
26439
+ 500: InternalServerError;
26440
+ /**
26441
+ * ServiceUnavailableError
26442
+ */
26443
+ 503: ServiceUnavailableError;
26444
+ };
26445
+ export type SessionsGetSessionSpanFieldError = SessionsGetSessionSpanFieldErrors[keyof SessionsGetSessionSpanFieldErrors];
26446
+ export type SessionsGetSessionSpanFieldResponses = {
26447
+ /**
26448
+ * Success
26449
+ */
26450
+ 200: {
26451
+ code: number;
26452
+ data: {
26453
+ chars: number;
26454
+ field: 'input' | 'output';
26455
+ omitted: 'too_large' | null;
26456
+ spanId: string;
26457
+ value: unknown | null;
26458
+ } | null;
26459
+ error: {
26460
+ code: string;
26461
+ details?: unknown | null;
26462
+ message: string;
26463
+ rowErrors?: Array<{
26464
+ code: string;
26465
+ message: string;
26466
+ path: Array<string | number>;
26467
+ }> | null;
26468
+ } | null;
26469
+ pagination: {
26470
+ limit: number;
26471
+ page: number;
26472
+ total: number;
26473
+ totalPages: number;
26474
+ } | null;
26475
+ sdkBehavior?: {
26476
+ flags: {
26477
+ [key: string]: unknown;
26478
+ };
26479
+ v: number;
26480
+ } | null;
26481
+ success: boolean;
26482
+ };
26483
+ };
26484
+ export type SessionsGetSessionSpanFieldResponse = SessionsGetSessionSpanFieldResponses[keyof SessionsGetSessionSpanFieldResponses];
26485
+ export type SessionsDownloadSessionSpanFieldData = {
26486
+ body?: never;
26487
+ path: {
26488
+ projectId: string;
26489
+ sessionId: string;
26490
+ traceId: string;
26491
+ spanId: string;
26492
+ };
26493
+ query: {
26494
+ field: 'input' | 'output';
26495
+ };
26496
+ url: '/v1/projects/{projectId}/sessions/{sessionId}/turns/{traceId}/spans/{spanId}/download';
26497
+ };
26498
+ export type SessionsDownloadSessionSpanFieldErrors = {
26499
+ /**
26500
+ * BadRequestError
26501
+ */
26502
+ 400: BadRequestError;
26503
+ /**
26504
+ * UnauthorizedError
26505
+ */
26506
+ 401: UnauthorizedError;
26507
+ /**
26508
+ * ForbiddenError
26509
+ */
26510
+ 403: ForbiddenError;
26511
+ /**
26512
+ * NotFoundError
26513
+ */
26514
+ 404: NotFoundError;
26515
+ /**
26516
+ * ConflictError
26517
+ */
26518
+ 409: ConflictError;
26519
+ /**
26520
+ * GoneError
26521
+ */
26522
+ 410: GoneError;
26523
+ /**
26524
+ * ContentTooLargeError
26525
+ */
26526
+ 413: ContentTooLargeError;
26527
+ /**
26528
+ * MisdirectedRequestError
26529
+ */
26530
+ 421: MisdirectedRequestError;
26531
+ /**
26532
+ * UnprocessableEntityError
26533
+ */
26534
+ 422: UnprocessableEntityError;
26535
+ /**
26536
+ * TooManyRequestsError
26537
+ */
26538
+ 429: TooManyRequestsError;
26539
+ /**
26540
+ * InternalServerError
26541
+ */
26542
+ 500: InternalServerError;
26543
+ /**
26544
+ * ServiceUnavailableError
26545
+ */
26546
+ 503: ServiceUnavailableError;
26547
+ };
26548
+ export type SessionsDownloadSessionSpanFieldError = SessionsDownloadSessionSpanFieldErrors[keyof SessionsDownloadSessionSpanFieldErrors];
26549
+ export type SessionsDownloadSessionSpanFieldResponses = {
26550
+ /**
26551
+ * Success
26552
+ */
26553
+ 200: unknown;
26554
+ };
25878
26555
  export type TracesListTracesData = {
25879
26556
  body?: never;
25880
26557
  path: {