@aignostics/sdk 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,41 @@
1
- import { A as ApplicationReadShortResponse, a as ApplicationReadResponse, R as RunReadResponse, b as RunCreationRequest, c as RunCreationResponse, I as ItemResultReadResponse, V as VersionReadResponse } from './api-CZ17GBr_.cjs';
2
- export { d as ApplicationVersion, e as ArtifactOutput, f as ArtifactState, g as ArtifactTerminationReason, Z as Configuration, Y as ConfigurationParameters, C as CustomMetadataUpdateRequest, h as CustomMetadataUpdateResponse, H as HTTPValidationError, i as InputArtifact, j as InputArtifactCreationRequest, k as ItemCreationRequest, l as ItemOutput, m as ItemState, n as ItemTerminationReason, M as MeReadResponse, O as OrganizationReadResponse, o as OutputArtifact, p as OutputArtifactResultReadResponse, q as OutputArtifactScope, r as OutputArtifactVisibility, X as PublicApi, D as PublicApiApplicationVersionDetailsV1ApplicationsApplicationIdVersionsVersionGetRequest, P as PublicApiAxiosParamCreator, E as PublicApiCancelRunV1RunsRunIdCancelPostRequest, F as PublicApiCreateRunV1RunsPostRequest, G as PublicApiDeleteRunItemsV1RunsRunIdArtifactsDeleteRequest, z as PublicApiFactory, y as PublicApiFp, J as PublicApiGetItemByRunV1RunsRunIdItemsExternalIdGetRequest, K as PublicApiGetRunV1RunsRunIdGetRequest, B as PublicApiInterface, L as PublicApiListApplicationsV1ApplicationsGetRequest, N as PublicApiListRunItemsV1RunsRunIdItemsGetRequest, Q as PublicApiListRunsV1RunsGetRequest, S as PublicApiPutItemCustomMetadataByRunV1RunsRunIdItemsExternalIdCustomMetadataPutRequest, T as PublicApiPutRunCustomMetadataV1RunsRunIdCustomMetadataPutRequest, W as PublicApiReadApplicationByIdV1ApplicationsApplicationIdGetRequest, s as RunItemStatistics, t as RunOutput, u as RunState, v as RunTerminationReason, U as UserReadResponse, w as ValidationError, x as ValidationErrorLocInner } from './api-CZ17GBr_.cjs';
1
+ import { R as RunReadResponse, I as ItemResultReadResponse, A as ApplicationReadShortResponse, a as ApplicationReadResponse, b as RunCreationRequest, c as RunCreationResponse, d as ItemState, e as ItemTerminationReason, V as VersionReadResponse } from './api-CWohsFN3.cjs';
2
+ export { f as ApplicationVersion, g as ArtifactOutput, h as ArtifactState, i as ArtifactTerminationReason, a0 as Configuration, $ as ConfigurationParameters, C as CustomMetadataUpdateRequest, j as CustomMetadataUpdateResponse, H as HTTPValidationError, k as InputArtifact, l as InputArtifactCreationRequest, m as ItemCreationRequest, n as ItemOutput, M as MeReadResponse, O as OrganizationReadResponse, o as OutputArtifact, p as OutputArtifactResultReadResponse, q as OutputArtifactScope, r as OutputArtifactVisibility, _ as PublicApi, E as PublicApiApplicationVersionDetailsV1ApplicationsApplicationIdVersionsVersionGetRequest, P as PublicApiAxiosParamCreator, F as PublicApiCancelRunV1RunsRunIdCancelPostRequest, G as PublicApiCreateRunV1RunsPostRequest, J as PublicApiDeleteRunItemsV1RunsRunIdArtifactsDeleteRequest, B as PublicApiFactory, z as PublicApiFp, K as PublicApiGetArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGetRequest, L as PublicApiGetItemByRunV1RunsRunIdItemsExternalIdGetRequest, N as PublicApiGetRunV1RunsRunIdGetRequest, D as PublicApiInterface, Q as PublicApiListApplicationsV1ApplicationsGetRequest, T as PublicApiListRunItemsV1RunsRunIdItemsGetRequest, W as PublicApiListRunsV1RunsGetRequest, X as PublicApiPutItemCustomMetadataByRunV1RunsRunIdItemsExternalIdCustomMetadataPutRequest, Y as PublicApiPutRunCustomMetadataV1RunsRunIdCustomMetadataPutRequest, Z as PublicApiReadApplicationByIdV1ApplicationsApplicationIdGetRequest, s as RunItemStatistics, t as RunOutput, u as RunState, v as RunTerminationReason, S as SchedulingRequest, w as SchedulingResponse, U as UserReadResponse, x as ValidationError, y as ValidationErrorLocInner } from './api-CWohsFN3.cjs';
3
3
  import 'axios';
4
4
 
5
+ /**
6
+ * Enriched application run entity that extends the raw API response
7
+ * with computed properties derived from run state and statistics.
8
+ *
9
+ * Returned by `PlatformSDKHttp.listApplicationRuns()` and `PlatformSDKHttp.getRun()`
10
+ * instead of the raw `RunReadResponse`.
11
+ */
12
+ interface ApplicationRun extends RunReadResponse {
13
+ /** Percentage of items processed (0–100), computed from run statistics. */
14
+ progress: number;
15
+ /** Human-readable status derived from `state` and `termination_reason`. */
16
+ status: RunStatus;
17
+ /** Whether the run's result items are available for download. */
18
+ can_download: boolean;
19
+ }
20
+ /** Derived run status that simplifies the raw `state` + `termination_reason` combination. */
21
+ type RunStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_ERRORS' | 'CANCELED' | 'FAILED';
22
+
23
+ /**
24
+ * Enriched run-item entity that extends the raw API response
25
+ * with computed properties derived from item state and termination reason.
26
+ *
27
+ * Returned by `PlatformSDKHttp.listRunResults()` instead of the raw
28
+ * `ItemResultReadResponse`.
29
+ */
30
+ interface ApplicationRunItem extends ItemResultReadResponse {
31
+ /** Whether the item's output artifact is available for download. */
32
+ can_download: boolean;
33
+ /** Human-readable status derived from `state` and `termination_reason`. */
34
+ status: string;
35
+ }
36
+ /** Derived item status that simplifies the raw `state` + `termination_reason` combination. */
37
+ type ItemStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'SKIPPED';
38
+
5
39
  /**
6
40
  * Token provider function that returns a valid access token
7
41
  */
@@ -33,11 +67,22 @@ interface PlatformSDK {
33
67
  listApplicationRuns(options?: {
34
68
  applicationId?: string;
35
69
  applicationVersion?: string;
36
- }): Promise<RunReadResponse[]>;
70
+ page?: number;
71
+ pageSize?: number;
72
+ customMetadata?: string;
73
+ sort?: string[];
74
+ }): Promise<ApplicationRun[]>;
37
75
  createApplicationRun(request: RunCreationRequest): Promise<RunCreationResponse>;
38
- getRun(applicationRunId: string): Promise<RunReadResponse>;
76
+ getRun(applicationRunId: string): Promise<ApplicationRun>;
39
77
  cancelApplicationRun(applicationRunId: string): Promise<void>;
40
- listRunResults(applicationRunId: string): Promise<ItemResultReadResponse[]>;
78
+ listRunResults(applicationRunId: string, options?: {
79
+ page?: number;
80
+ pageSize?: number;
81
+ sort?: string[];
82
+ externalIdIn?: string[];
83
+ state?: ItemState;
84
+ terminationReason?: ItemTerminationReason;
85
+ }): Promise<ApplicationRunItem[]>;
41
86
  getApplicationVersionDetails(applicationId: string, version: string): Promise<VersionReadResponse>;
42
87
  }
43
88
  /**
@@ -202,7 +247,9 @@ declare class PlatformSDKHttp implements PlatformSDK {
202
247
  applicationVersion?: string;
203
248
  customMetadata?: string;
204
249
  sort?: string[];
205
- }): Promise<RunReadResponse[]>;
250
+ page?: number;
251
+ pageSize?: number;
252
+ }): Promise<ApplicationRun[]>;
206
253
  /**
207
254
  * Create and submit a new application run for processing
208
255
  *
@@ -267,7 +314,7 @@ declare class PlatformSDKHttp implements PlatformSDK {
267
314
  * }
268
315
  * ```
269
316
  */
270
- getRun(applicationRunId: string): Promise<RunReadResponse>;
317
+ getRun(applicationRunId: string): Promise<ApplicationRun>;
271
318
  /**
272
319
  * Cancel a running or queued application run
273
320
  *
@@ -326,7 +373,14 @@ declare class PlatformSDKHttp implements PlatformSDK {
326
373
  * }
327
374
  * ```
328
375
  */
329
- listRunResults(applicationRunId: string): Promise<ItemResultReadResponse[]>;
376
+ listRunResults(applicationRunId: string, { page, pageSize, sort, externalIdIn, state, terminationReason, }?: {
377
+ page?: number;
378
+ pageSize?: number;
379
+ sort?: string[];
380
+ externalIdIn?: string[];
381
+ state?: ItemState;
382
+ terminationReason?: ItemTerminationReason;
383
+ }): Promise<ApplicationRunItem[]>;
330
384
  /**
331
385
  * Get the current version of the SDK
332
386
  *
@@ -454,4 +508,80 @@ declare class ConfigurationError extends BaseError {
454
508
  constructor(message: string, options?: BaseErrorOptions);
455
509
  }
456
510
 
457
- export { APIError, ApplicationReadResponse, ApplicationReadShortResponse, AuthenticationError, BaseError, ConfigurationError, ItemResultReadResponse, type PlatformSDK, type PlatformSDKConfig, PlatformSDKHttp, RunCreationRequest, RunCreationResponse, RunReadResponse, type TokenProvider, VersionReadResponse, PlatformSDKHttp as default };
511
+ /**
512
+ * Transform a raw {@link RunReadResponse} from the API into an enriched
513
+ * {@link ApplicationRun} by computing derived properties (progress, status, can_download).
514
+ *
515
+ * This is the single entry-point used by `PlatformSDKHttp` methods to map API
516
+ * responses before returning them to consumers.
517
+ *
518
+ * @param run - Raw run response from the API
519
+ * @returns Enriched run entity with computed properties spread onto the original response
520
+ */
521
+ declare const processApplicationRun: (run: RunReadResponse) => ApplicationRun;
522
+
523
+ /**
524
+ * Compute the overall progress of a run as a percentage (0–100).
525
+ * Progress is based on the ratio of terminal items (succeeded + errored + skipped)
526
+ * to the total item count.
527
+ *
528
+ * @param run - Raw run response from the API
529
+ * @returns Integer percentage rounded to the nearest whole number
530
+ */
531
+ declare function getRunProgress(run: RunReadResponse): number;
532
+ /**
533
+ * Derive a human-readable {@link RunStatus} from the raw API `state` and `termination_reason`.
534
+ *
535
+ * Mapping rules:
536
+ * - PENDING / PROCESSING → passed through as-is
537
+ * - TERMINATED + CANCELED_BY_USER → CANCELED
538
+ * - TERMINATED + CANCELED_BY_SYSTEM → FAILED
539
+ * - TERMINATED + not all items succeeded → COMPLETED_WITH_ERRORS
540
+ * - TERMINATED + all items succeeded → COMPLETED
541
+ *
542
+ * @param run - Raw run response from the API
543
+ */
544
+ declare function getRunStatus(run: RunReadResponse): RunStatus;
545
+ /**
546
+ * Determine whether a run's result items are available for download.
547
+ * Items can only be downloaded once the run has reached a completed state.
548
+ *
549
+ * @param run - Raw run response from the API
550
+ * @returns `true` if items are available for download (run is COMPLETED or COMPLETED_WITH_ERRORS)
551
+ */
552
+ declare const canDownloadRunItems: (run: RunReadResponse) => boolean;
553
+
554
+ /**
555
+ * Transform a raw {@link ItemResultReadResponse} from the API into an enriched
556
+ * {@link ApplicationRunItem} by computing derived properties (status, can_download).
557
+ *
558
+ * This is the single entry-point used by `PlatformSDKHttp.listRunResults()` to
559
+ * map API responses before returning them to consumers.
560
+ *
561
+ * @param item - Raw item response from the API
562
+ * @returns Enriched item entity with computed properties spread onto the original response
563
+ */
564
+ declare const processRunItem: (item: ItemResultReadResponse) => ApplicationRunItem;
565
+
566
+ /**
567
+ * Determine whether a single run item's output artifact is available for download.
568
+ * Only items in the COMPLETED state have downloadable artifacts.
569
+ *
570
+ * @param item - Raw item response from the API
571
+ * @returns `true` if the item is in a COMPLETED state
572
+ */
573
+ declare const canDownloadItem: (item: ItemResultReadResponse) => boolean;
574
+ /**
575
+ * Derive a human-readable {@link ItemStatus} from the raw API `state` and `termination_reason`.
576
+ *
577
+ * Mapping rules:
578
+ * - PENDING / PROCESSING → passed through as-is
579
+ * - TERMINATED + SYSTEM_ERROR or USER_ERROR → FAILED
580
+ * - TERMINATED + SKIPPED → SKIPPED
581
+ * - TERMINATED (otherwise) → COMPLETED
582
+ *
583
+ * @param item - Raw item response from the API
584
+ */
585
+ declare function getItemStatus(item: ItemResultReadResponse): ItemStatus;
586
+
587
+ export { APIError, ApplicationReadResponse, ApplicationReadShortResponse, type ApplicationRun, type ApplicationRunItem, AuthenticationError, BaseError, ConfigurationError, ItemResultReadResponse, ItemState, type ItemStatus, ItemTerminationReason, type PlatformSDK, type PlatformSDKConfig, PlatformSDKHttp, RunCreationRequest, RunCreationResponse, RunReadResponse, type TokenProvider, VersionReadResponse, canDownloadItem, canDownloadRunItems, PlatformSDKHttp as default, getItemStatus, getRunProgress, getRunStatus, processApplicationRun, processRunItem };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,41 @@
1
- import { A as ApplicationReadShortResponse, a as ApplicationReadResponse, R as RunReadResponse, b as RunCreationRequest, c as RunCreationResponse, I as ItemResultReadResponse, V as VersionReadResponse } from './api-CZ17GBr_.js';
2
- export { d as ApplicationVersion, e as ArtifactOutput, f as ArtifactState, g as ArtifactTerminationReason, Z as Configuration, Y as ConfigurationParameters, C as CustomMetadataUpdateRequest, h as CustomMetadataUpdateResponse, H as HTTPValidationError, i as InputArtifact, j as InputArtifactCreationRequest, k as ItemCreationRequest, l as ItemOutput, m as ItemState, n as ItemTerminationReason, M as MeReadResponse, O as OrganizationReadResponse, o as OutputArtifact, p as OutputArtifactResultReadResponse, q as OutputArtifactScope, r as OutputArtifactVisibility, X as PublicApi, D as PublicApiApplicationVersionDetailsV1ApplicationsApplicationIdVersionsVersionGetRequest, P as PublicApiAxiosParamCreator, E as PublicApiCancelRunV1RunsRunIdCancelPostRequest, F as PublicApiCreateRunV1RunsPostRequest, G as PublicApiDeleteRunItemsV1RunsRunIdArtifactsDeleteRequest, z as PublicApiFactory, y as PublicApiFp, J as PublicApiGetItemByRunV1RunsRunIdItemsExternalIdGetRequest, K as PublicApiGetRunV1RunsRunIdGetRequest, B as PublicApiInterface, L as PublicApiListApplicationsV1ApplicationsGetRequest, N as PublicApiListRunItemsV1RunsRunIdItemsGetRequest, Q as PublicApiListRunsV1RunsGetRequest, S as PublicApiPutItemCustomMetadataByRunV1RunsRunIdItemsExternalIdCustomMetadataPutRequest, T as PublicApiPutRunCustomMetadataV1RunsRunIdCustomMetadataPutRequest, W as PublicApiReadApplicationByIdV1ApplicationsApplicationIdGetRequest, s as RunItemStatistics, t as RunOutput, u as RunState, v as RunTerminationReason, U as UserReadResponse, w as ValidationError, x as ValidationErrorLocInner } from './api-CZ17GBr_.js';
1
+ import { R as RunReadResponse, I as ItemResultReadResponse, A as ApplicationReadShortResponse, a as ApplicationReadResponse, b as RunCreationRequest, c as RunCreationResponse, d as ItemState, e as ItemTerminationReason, V as VersionReadResponse } from './api-CWohsFN3.js';
2
+ export { f as ApplicationVersion, g as ArtifactOutput, h as ArtifactState, i as ArtifactTerminationReason, a0 as Configuration, $ as ConfigurationParameters, C as CustomMetadataUpdateRequest, j as CustomMetadataUpdateResponse, H as HTTPValidationError, k as InputArtifact, l as InputArtifactCreationRequest, m as ItemCreationRequest, n as ItemOutput, M as MeReadResponse, O as OrganizationReadResponse, o as OutputArtifact, p as OutputArtifactResultReadResponse, q as OutputArtifactScope, r as OutputArtifactVisibility, _ as PublicApi, E as PublicApiApplicationVersionDetailsV1ApplicationsApplicationIdVersionsVersionGetRequest, P as PublicApiAxiosParamCreator, F as PublicApiCancelRunV1RunsRunIdCancelPostRequest, G as PublicApiCreateRunV1RunsPostRequest, J as PublicApiDeleteRunItemsV1RunsRunIdArtifactsDeleteRequest, B as PublicApiFactory, z as PublicApiFp, K as PublicApiGetArtifactUrlV1RunsRunIdArtifactsArtifactIdFileGetRequest, L as PublicApiGetItemByRunV1RunsRunIdItemsExternalIdGetRequest, N as PublicApiGetRunV1RunsRunIdGetRequest, D as PublicApiInterface, Q as PublicApiListApplicationsV1ApplicationsGetRequest, T as PublicApiListRunItemsV1RunsRunIdItemsGetRequest, W as PublicApiListRunsV1RunsGetRequest, X as PublicApiPutItemCustomMetadataByRunV1RunsRunIdItemsExternalIdCustomMetadataPutRequest, Y as PublicApiPutRunCustomMetadataV1RunsRunIdCustomMetadataPutRequest, Z as PublicApiReadApplicationByIdV1ApplicationsApplicationIdGetRequest, s as RunItemStatistics, t as RunOutput, u as RunState, v as RunTerminationReason, S as SchedulingRequest, w as SchedulingResponse, U as UserReadResponse, x as ValidationError, y as ValidationErrorLocInner } from './api-CWohsFN3.js';
3
3
  import 'axios';
4
4
 
5
+ /**
6
+ * Enriched application run entity that extends the raw API response
7
+ * with computed properties derived from run state and statistics.
8
+ *
9
+ * Returned by `PlatformSDKHttp.listApplicationRuns()` and `PlatformSDKHttp.getRun()`
10
+ * instead of the raw `RunReadResponse`.
11
+ */
12
+ interface ApplicationRun extends RunReadResponse {
13
+ /** Percentage of items processed (0–100), computed from run statistics. */
14
+ progress: number;
15
+ /** Human-readable status derived from `state` and `termination_reason`. */
16
+ status: RunStatus;
17
+ /** Whether the run's result items are available for download. */
18
+ can_download: boolean;
19
+ }
20
+ /** Derived run status that simplifies the raw `state` + `termination_reason` combination. */
21
+ type RunStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_ERRORS' | 'CANCELED' | 'FAILED';
22
+
23
+ /**
24
+ * Enriched run-item entity that extends the raw API response
25
+ * with computed properties derived from item state and termination reason.
26
+ *
27
+ * Returned by `PlatformSDKHttp.listRunResults()` instead of the raw
28
+ * `ItemResultReadResponse`.
29
+ */
30
+ interface ApplicationRunItem extends ItemResultReadResponse {
31
+ /** Whether the item's output artifact is available for download. */
32
+ can_download: boolean;
33
+ /** Human-readable status derived from `state` and `termination_reason`. */
34
+ status: string;
35
+ }
36
+ /** Derived item status that simplifies the raw `state` + `termination_reason` combination. */
37
+ type ItemStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'SKIPPED';
38
+
5
39
  /**
6
40
  * Token provider function that returns a valid access token
7
41
  */
@@ -33,11 +67,22 @@ interface PlatformSDK {
33
67
  listApplicationRuns(options?: {
34
68
  applicationId?: string;
35
69
  applicationVersion?: string;
36
- }): Promise<RunReadResponse[]>;
70
+ page?: number;
71
+ pageSize?: number;
72
+ customMetadata?: string;
73
+ sort?: string[];
74
+ }): Promise<ApplicationRun[]>;
37
75
  createApplicationRun(request: RunCreationRequest): Promise<RunCreationResponse>;
38
- getRun(applicationRunId: string): Promise<RunReadResponse>;
76
+ getRun(applicationRunId: string): Promise<ApplicationRun>;
39
77
  cancelApplicationRun(applicationRunId: string): Promise<void>;
40
- listRunResults(applicationRunId: string): Promise<ItemResultReadResponse[]>;
78
+ listRunResults(applicationRunId: string, options?: {
79
+ page?: number;
80
+ pageSize?: number;
81
+ sort?: string[];
82
+ externalIdIn?: string[];
83
+ state?: ItemState;
84
+ terminationReason?: ItemTerminationReason;
85
+ }): Promise<ApplicationRunItem[]>;
41
86
  getApplicationVersionDetails(applicationId: string, version: string): Promise<VersionReadResponse>;
42
87
  }
43
88
  /**
@@ -202,7 +247,9 @@ declare class PlatformSDKHttp implements PlatformSDK {
202
247
  applicationVersion?: string;
203
248
  customMetadata?: string;
204
249
  sort?: string[];
205
- }): Promise<RunReadResponse[]>;
250
+ page?: number;
251
+ pageSize?: number;
252
+ }): Promise<ApplicationRun[]>;
206
253
  /**
207
254
  * Create and submit a new application run for processing
208
255
  *
@@ -267,7 +314,7 @@ declare class PlatformSDKHttp implements PlatformSDK {
267
314
  * }
268
315
  * ```
269
316
  */
270
- getRun(applicationRunId: string): Promise<RunReadResponse>;
317
+ getRun(applicationRunId: string): Promise<ApplicationRun>;
271
318
  /**
272
319
  * Cancel a running or queued application run
273
320
  *
@@ -326,7 +373,14 @@ declare class PlatformSDKHttp implements PlatformSDK {
326
373
  * }
327
374
  * ```
328
375
  */
329
- listRunResults(applicationRunId: string): Promise<ItemResultReadResponse[]>;
376
+ listRunResults(applicationRunId: string, { page, pageSize, sort, externalIdIn, state, terminationReason, }?: {
377
+ page?: number;
378
+ pageSize?: number;
379
+ sort?: string[];
380
+ externalIdIn?: string[];
381
+ state?: ItemState;
382
+ terminationReason?: ItemTerminationReason;
383
+ }): Promise<ApplicationRunItem[]>;
330
384
  /**
331
385
  * Get the current version of the SDK
332
386
  *
@@ -454,4 +508,80 @@ declare class ConfigurationError extends BaseError {
454
508
  constructor(message: string, options?: BaseErrorOptions);
455
509
  }
456
510
 
457
- export { APIError, ApplicationReadResponse, ApplicationReadShortResponse, AuthenticationError, BaseError, ConfigurationError, ItemResultReadResponse, type PlatformSDK, type PlatformSDKConfig, PlatformSDKHttp, RunCreationRequest, RunCreationResponse, RunReadResponse, type TokenProvider, VersionReadResponse, PlatformSDKHttp as default };
511
+ /**
512
+ * Transform a raw {@link RunReadResponse} from the API into an enriched
513
+ * {@link ApplicationRun} by computing derived properties (progress, status, can_download).
514
+ *
515
+ * This is the single entry-point used by `PlatformSDKHttp` methods to map API
516
+ * responses before returning them to consumers.
517
+ *
518
+ * @param run - Raw run response from the API
519
+ * @returns Enriched run entity with computed properties spread onto the original response
520
+ */
521
+ declare const processApplicationRun: (run: RunReadResponse) => ApplicationRun;
522
+
523
+ /**
524
+ * Compute the overall progress of a run as a percentage (0–100).
525
+ * Progress is based on the ratio of terminal items (succeeded + errored + skipped)
526
+ * to the total item count.
527
+ *
528
+ * @param run - Raw run response from the API
529
+ * @returns Integer percentage rounded to the nearest whole number
530
+ */
531
+ declare function getRunProgress(run: RunReadResponse): number;
532
+ /**
533
+ * Derive a human-readable {@link RunStatus} from the raw API `state` and `termination_reason`.
534
+ *
535
+ * Mapping rules:
536
+ * - PENDING / PROCESSING → passed through as-is
537
+ * - TERMINATED + CANCELED_BY_USER → CANCELED
538
+ * - TERMINATED + CANCELED_BY_SYSTEM → FAILED
539
+ * - TERMINATED + not all items succeeded → COMPLETED_WITH_ERRORS
540
+ * - TERMINATED + all items succeeded → COMPLETED
541
+ *
542
+ * @param run - Raw run response from the API
543
+ */
544
+ declare function getRunStatus(run: RunReadResponse): RunStatus;
545
+ /**
546
+ * Determine whether a run's result items are available for download.
547
+ * Items can only be downloaded once the run has reached a completed state.
548
+ *
549
+ * @param run - Raw run response from the API
550
+ * @returns `true` if items are available for download (run is COMPLETED or COMPLETED_WITH_ERRORS)
551
+ */
552
+ declare const canDownloadRunItems: (run: RunReadResponse) => boolean;
553
+
554
+ /**
555
+ * Transform a raw {@link ItemResultReadResponse} from the API into an enriched
556
+ * {@link ApplicationRunItem} by computing derived properties (status, can_download).
557
+ *
558
+ * This is the single entry-point used by `PlatformSDKHttp.listRunResults()` to
559
+ * map API responses before returning them to consumers.
560
+ *
561
+ * @param item - Raw item response from the API
562
+ * @returns Enriched item entity with computed properties spread onto the original response
563
+ */
564
+ declare const processRunItem: (item: ItemResultReadResponse) => ApplicationRunItem;
565
+
566
+ /**
567
+ * Determine whether a single run item's output artifact is available for download.
568
+ * Only items in the COMPLETED state have downloadable artifacts.
569
+ *
570
+ * @param item - Raw item response from the API
571
+ * @returns `true` if the item is in a COMPLETED state
572
+ */
573
+ declare const canDownloadItem: (item: ItemResultReadResponse) => boolean;
574
+ /**
575
+ * Derive a human-readable {@link ItemStatus} from the raw API `state` and `termination_reason`.
576
+ *
577
+ * Mapping rules:
578
+ * - PENDING / PROCESSING → passed through as-is
579
+ * - TERMINATED + SYSTEM_ERROR or USER_ERROR → FAILED
580
+ * - TERMINATED + SKIPPED → SKIPPED
581
+ * - TERMINATED (otherwise) → COMPLETED
582
+ *
583
+ * @param item - Raw item response from the API
584
+ */
585
+ declare function getItemStatus(item: ItemResultReadResponse): ItemStatus;
586
+
587
+ export { APIError, ApplicationReadResponse, ApplicationReadShortResponse, type ApplicationRun, type ApplicationRunItem, AuthenticationError, BaseError, ConfigurationError, ItemResultReadResponse, ItemState, type ItemStatus, ItemTerminationReason, type PlatformSDK, type PlatformSDKConfig, PlatformSDKHttp, RunCreationRequest, RunCreationResponse, RunReadResponse, type TokenProvider, VersionReadResponse, canDownloadItem, canDownloadRunItems, PlatformSDKHttp as default, getItemStatus, getRunProgress, getRunStatus, processApplicationRun, processRunItem };