@onkernel/sdk 0.147.0 → 0.149.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/client.d.mts +18 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +18 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +18 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +18 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/browsers/browsers.d.mts +4 -0
  12. package/resources/browsers/browsers.d.mts.map +1 -1
  13. package/resources/browsers/browsers.d.ts +4 -0
  14. package/resources/browsers/browsers.d.ts.map +1 -1
  15. package/resources/browsers/browsers.js +4 -0
  16. package/resources/browsers/browsers.js.map +1 -1
  17. package/resources/browsers/browsers.mjs +4 -0
  18. package/resources/browsers/browsers.mjs.map +1 -1
  19. package/resources/browsers/index.d.mts +1 -0
  20. package/resources/browsers/index.d.mts.map +1 -1
  21. package/resources/browsers/index.d.ts +1 -0
  22. package/resources/browsers/index.d.ts.map +1 -1
  23. package/resources/browsers/index.js +3 -1
  24. package/resources/browsers/index.js.map +1 -1
  25. package/resources/browsers/index.mjs +1 -0
  26. package/resources/browsers/index.mjs.map +1 -1
  27. package/resources/browsers/live-view.d.mts +74 -0
  28. package/resources/browsers/live-view.d.mts.map +1 -0
  29. package/resources/browsers/live-view.d.ts +74 -0
  30. package/resources/browsers/live-view.d.ts.map +1 -0
  31. package/resources/browsers/live-view.js +33 -0
  32. package/resources/browsers/live-view.js.map +1 -0
  33. package/resources/browsers/live-view.mjs +29 -0
  34. package/resources/browsers/live-view.mjs.map +1 -0
  35. package/resources/index.d.mts +3 -0
  36. package/resources/index.d.mts.map +1 -1
  37. package/resources/index.d.ts +3 -0
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +7 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +3 -0
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/report-types/index.d.mts +3 -0
  44. package/resources/report-types/index.d.mts.map +1 -0
  45. package/resources/report-types/index.d.ts +3 -0
  46. package/resources/report-types/index.d.ts.map +1 -0
  47. package/resources/report-types/index.js +9 -0
  48. package/resources/report-types/index.js.map +1 -0
  49. package/resources/report-types/index.mjs +4 -0
  50. package/resources/report-types/index.mjs.map +1 -0
  51. package/resources/report-types/report-types.d.mts +98 -0
  52. package/resources/report-types/report-types.d.mts.map +1 -0
  53. package/resources/report-types/report-types.d.ts +98 -0
  54. package/resources/report-types/report-types.d.ts.map +1 -0
  55. package/resources/report-types/report-types.js +38 -0
  56. package/resources/report-types/report-types.js.map +1 -0
  57. package/resources/report-types/report-types.mjs +33 -0
  58. package/resources/report-types/report-types.mjs.map +1 -0
  59. package/resources/report-types/versions.d.mts +47 -0
  60. package/resources/report-types/versions.d.mts.map +1 -0
  61. package/resources/report-types/versions.d.ts +47 -0
  62. package/resources/report-types/versions.d.ts.map +1 -0
  63. package/resources/report-types/versions.js +20 -0
  64. package/resources/report-types/versions.js.map +1 -0
  65. package/resources/report-types/versions.mjs +16 -0
  66. package/resources/report-types/versions.mjs.map +1 -0
  67. package/resources/report-types.d.mts +2 -0
  68. package/resources/report-types.d.mts.map +1 -0
  69. package/resources/report-types.d.ts +2 -0
  70. package/resources/report-types.d.ts.map +1 -0
  71. package/resources/report-types.js +6 -0
  72. package/resources/report-types.js.map +1 -0
  73. package/resources/report-types.mjs +3 -0
  74. package/resources/report-types.mjs.map +1 -0
  75. package/resources/reports.d.mts +136 -0
  76. package/resources/reports.d.mts.map +1 -0
  77. package/resources/reports.d.ts +136 -0
  78. package/resources/reports.d.ts.map +1 -0
  79. package/resources/reports.js +58 -0
  80. package/resources/reports.js.map +1 -0
  81. package/resources/reports.mjs +54 -0
  82. package/resources/reports.mjs.map +1 -0
  83. package/resources/tasks.d.mts +144 -0
  84. package/resources/tasks.d.mts.map +1 -0
  85. package/resources/tasks.d.ts +144 -0
  86. package/resources/tasks.d.ts.map +1 -0
  87. package/resources/tasks.js +67 -0
  88. package/resources/tasks.js.map +1 -0
  89. package/resources/tasks.mjs +63 -0
  90. package/resources/tasks.mjs.map +1 -0
  91. package/resources/vaults/items.d.mts +82 -17
  92. package/resources/vaults/items.d.mts.map +1 -1
  93. package/resources/vaults/items.d.ts +82 -17
  94. package/resources/vaults/items.d.ts.map +1 -1
  95. package/resources/vaults/items.js +4 -0
  96. package/resources/vaults/items.js.map +1 -1
  97. package/resources/vaults/items.mjs +4 -0
  98. package/resources/vaults/items.mjs.map +1 -1
  99. package/resources/vaults/vaults.d.mts +4 -1
  100. package/resources/vaults/vaults.d.mts.map +1 -1
  101. package/resources/vaults/vaults.d.ts +4 -1
  102. package/resources/vaults/vaults.d.ts.map +1 -1
  103. package/resources/vaults/vaults.js +4 -1
  104. package/resources/vaults/vaults.js.map +1 -1
  105. package/resources/vaults/vaults.mjs +4 -1
  106. package/resources/vaults/vaults.mjs.map +1 -1
  107. package/src/client.ts +66 -0
  108. package/src/resources/browsers/browsers.ts +18 -0
  109. package/src/resources/browsers/index.ts +7 -0
  110. package/src/resources/browsers/live-view.ts +97 -0
  111. package/src/resources/index.ts +24 -0
  112. package/src/resources/report-types/index.ts +11 -0
  113. package/src/resources/report-types/report-types.ts +137 -0
  114. package/src/resources/report-types/versions.ts +61 -0
  115. package/src/resources/report-types.ts +3 -0
  116. package/src/resources/reports.ts +166 -0
  117. package/src/resources/tasks.ts +183 -0
  118. package/src/resources/vaults/items.ts +86 -9
  119. package/src/resources/vaults/vaults.ts +4 -1
  120. package/src/version.ts +1 -1
  121. package/version.d.mts +1 -1
  122. package/version.d.ts +1 -1
  123. package/version.js +1 -1
  124. package/version.mjs +1 -1
@@ -0,0 +1,47 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ /**
5
+ * Discover report types and submit typed reports against tasks.
6
+ */
7
+ export declare class Versions extends APIResource {
8
+ /**
9
+ * Retrieve one schema version of a report type, including retired versions.
10
+ */
11
+ retrieve(version: number, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<ReportTypeVersion>;
12
+ }
13
+ /**
14
+ * One immutable schema version of a report type.
15
+ */
16
+ export interface ReportTypeVersion {
17
+ /**
18
+ * Whether the version is retired. Retired versions are no longer accepted for new
19
+ * reports; existing reports keep them.
20
+ */
21
+ retired: boolean;
22
+ /**
23
+ * JSON Schema (draft 2020-12) that a report's data must match. Its field
24
+ * descriptions and examples describe what to send.
25
+ */
26
+ schema: {
27
+ [key: string]: unknown;
28
+ };
29
+ /**
30
+ * Report type name, such as task.result
31
+ */
32
+ type: string;
33
+ /**
34
+ * Schema version number, starting at 1.
35
+ */
36
+ version: number;
37
+ }
38
+ export interface VersionRetrieveParams {
39
+ /**
40
+ * Report type name, such as task.result
41
+ */
42
+ type: string;
43
+ }
44
+ export declare namespace Versions {
45
+ export { type ReportTypeVersion as ReportTypeVersion, type VersionRetrieveParams as VersionRetrieveParams };
46
+ }
47
+ //# sourceMappingURL=versions.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../src/resources/report-types/versions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAIjC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAC7G"}
@@ -0,0 +1,47 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ /**
5
+ * Discover report types and submit typed reports against tasks.
6
+ */
7
+ export declare class Versions extends APIResource {
8
+ /**
9
+ * Retrieve one schema version of a report type, including retired versions.
10
+ */
11
+ retrieve(version: number, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<ReportTypeVersion>;
12
+ }
13
+ /**
14
+ * One immutable schema version of a report type.
15
+ */
16
+ export interface ReportTypeVersion {
17
+ /**
18
+ * Whether the version is retired. Retired versions are no longer accepted for new
19
+ * reports; existing reports keep them.
20
+ */
21
+ retired: boolean;
22
+ /**
23
+ * JSON Schema (draft 2020-12) that a report's data must match. Its field
24
+ * descriptions and examples describe what to send.
25
+ */
26
+ schema: {
27
+ [key: string]: unknown;
28
+ };
29
+ /**
30
+ * Report type name, such as task.result
31
+ */
32
+ type: string;
33
+ /**
34
+ * Schema version number, starting at 1.
35
+ */
36
+ version: number;
37
+ }
38
+ export interface VersionRetrieveParams {
39
+ /**
40
+ * Report type name, such as task.result
41
+ */
42
+ type: string;
43
+ }
44
+ export declare namespace Versions {
45
+ export { type ReportTypeVersion as ReportTypeVersion, type VersionRetrieveParams as VersionRetrieveParams };
46
+ }
47
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/report-types/versions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAIjC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAC7G"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Versions = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ /**
8
+ * Discover report types and submit typed reports against tasks.
9
+ */
10
+ class Versions extends resource_1.APIResource {
11
+ /**
12
+ * Retrieve one schema version of a report type, including retired versions.
13
+ */
14
+ retrieve(version, params, options) {
15
+ const { type } = params;
16
+ return this._client.get((0, path_1.path) `/report_types/${type}/versions/${version}`, options);
17
+ }
18
+ }
19
+ exports.Versions = Versions;
20
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/report-types/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,QAAQ,CACN,OAAe,EACf,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,IAAI,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF;AAZD,4BAYC"}
@@ -0,0 +1,16 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
4
+ /**
5
+ * Discover report types and submit typed reports against tasks.
6
+ */
7
+ export class Versions extends APIResource {
8
+ /**
9
+ * Retrieve one schema version of a report type, including retired versions.
10
+ */
11
+ retrieve(version, params, options) {
12
+ const { type } = params;
13
+ return this._client.get(path `/report_types/${type}/versions/${version}`, options);
14
+ }
15
+ }
16
+ //# sourceMappingURL=versions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/report-types/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,QAAQ,CACN,OAAe,EACf,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,IAAI,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./report-types/index.mjs";
2
+ //# sourceMappingURL=report-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-types.d.mts","sourceRoot":"","sources":["../src/resources/report-types.ts"],"names":[],"mappings":"AAEA,yCAAqC"}
@@ -0,0 +1,2 @@
1
+ export * from "./report-types/index.js";
2
+ //# sourceMappingURL=report-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-types.d.ts","sourceRoot":"","sources":["../src/resources/report-types.ts"],"names":[],"mappings":"AAEA,wCAAqC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./report-types/index.js"), exports);
6
+ //# sourceMappingURL=report-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-types.js","sourceRoot":"","sources":["../src/resources/report-types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kEAAqC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./report-types/index.mjs";
3
+ //# sourceMappingURL=report-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-types.mjs","sourceRoot":"","sources":["../src/resources/report-types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,yCAAqC"}
@@ -0,0 +1,136 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ /**
6
+ * Discover report types and submit typed reports against tasks.
7
+ */
8
+ export declare class Reports extends APIResource {
9
+ /**
10
+ * Submit a typed report against a task. The data is validated against the report
11
+ * type's schema; a validation failure returns 400 with one detail per invalid
12
+ * field. A task can have at most 500 reports.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const report = await client.reports.create({
17
+ * data: { result: 'bar', evidence: 'bar' },
18
+ * task_id: 'x',
19
+ * type: 'task.result',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body: ReportCreateParams, options?: RequestOptions): APIPromise<Report>;
24
+ /**
25
+ * Retrieve a report.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const report = await client.reports.retrieve('id');
30
+ * ```
31
+ */
32
+ retrieve(id: string, options?: RequestOptions): APIPromise<Report>;
33
+ /**
34
+ * List a task's reports in the order they were submitted, oldest first.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // Automatically fetches more pages as needed.
39
+ * for await (const report of client.reports.list({
40
+ * task_id: 'task_id',
41
+ * })) {
42
+ * // ...
43
+ * }
44
+ * ```
45
+ */
46
+ list(query: ReportListParams, options?: RequestOptions): PagePromise<ReportsOffsetPagination, Report>;
47
+ }
48
+ export type ReportsOffsetPagination = OffsetPagination<Report>;
49
+ /**
50
+ * A typed, schema-validated report an agent submitted against a task. Reports are
51
+ * immutable.
52
+ */
53
+ export interface Report {
54
+ /**
55
+ * Unique identifier for the report
56
+ */
57
+ id: string;
58
+ /**
59
+ * When the report was submitted
60
+ */
61
+ created_at: string;
62
+ /**
63
+ * Report data, matching the report type's schema
64
+ */
65
+ data: {
66
+ [key: string]: unknown;
67
+ };
68
+ /**
69
+ * When the reported event happened
70
+ */
71
+ occurred_at: string;
72
+ /**
73
+ * Version of the report type's schema that data was validated against
74
+ */
75
+ schema_version: number;
76
+ /**
77
+ * ID of the task the report belongs to
78
+ */
79
+ task_id: string;
80
+ /**
81
+ * Report type name
82
+ */
83
+ type: string;
84
+ /**
85
+ * ID of the browser the report was observed in, if any
86
+ */
87
+ session_id?: string | null;
88
+ }
89
+ export interface ReportCreateParams {
90
+ /**
91
+ * Report data. It must match the schema of the report type's version and encode to
92
+ * at most 16 KB of JSON.
93
+ */
94
+ data: {
95
+ [key: string]: unknown;
96
+ };
97
+ /**
98
+ * ID of the task to report against.
99
+ */
100
+ task_id: string;
101
+ /**
102
+ * Report type name. List report types to see the available types and their
103
+ * schemas.
104
+ */
105
+ type: string;
106
+ /**
107
+ * When the reported event happened. Defaults to the time the report is submitted.
108
+ * Must be no more than 5 minutes in the future or 30 days in the past.
109
+ */
110
+ occurred_at?: string;
111
+ /**
112
+ * Version of the report type's schema to validate data against. Defaults to the
113
+ * type's latest version, which the response returns.
114
+ */
115
+ schema_version?: number;
116
+ /**
117
+ * ID of the browser the report was observed in. It must belong to the task's
118
+ * project; deleted browsers are accepted. The browser is linked to the task if it
119
+ * is not already.
120
+ */
121
+ session_id?: string;
122
+ }
123
+ export interface ReportListParams extends OffsetPaginationParams {
124
+ /**
125
+ * Task whose reports to list.
126
+ */
127
+ task_id: string;
128
+ /**
129
+ * Only return reports of this type.
130
+ */
131
+ type?: string;
132
+ }
133
+ export declare namespace Reports {
134
+ export { type Report as Report, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, };
135
+ }
136
+ //# sourceMappingURL=reports.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.d.mts","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIlE;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAGtG;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,136 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ /**
6
+ * Discover report types and submit typed reports against tasks.
7
+ */
8
+ export declare class Reports extends APIResource {
9
+ /**
10
+ * Submit a typed report against a task. The data is validated against the report
11
+ * type's schema; a validation failure returns 400 with one detail per invalid
12
+ * field. A task can have at most 500 reports.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const report = await client.reports.create({
17
+ * data: { result: 'bar', evidence: 'bar' },
18
+ * task_id: 'x',
19
+ * type: 'task.result',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body: ReportCreateParams, options?: RequestOptions): APIPromise<Report>;
24
+ /**
25
+ * Retrieve a report.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const report = await client.reports.retrieve('id');
30
+ * ```
31
+ */
32
+ retrieve(id: string, options?: RequestOptions): APIPromise<Report>;
33
+ /**
34
+ * List a task's reports in the order they were submitted, oldest first.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // Automatically fetches more pages as needed.
39
+ * for await (const report of client.reports.list({
40
+ * task_id: 'task_id',
41
+ * })) {
42
+ * // ...
43
+ * }
44
+ * ```
45
+ */
46
+ list(query: ReportListParams, options?: RequestOptions): PagePromise<ReportsOffsetPagination, Report>;
47
+ }
48
+ export type ReportsOffsetPagination = OffsetPagination<Report>;
49
+ /**
50
+ * A typed, schema-validated report an agent submitted against a task. Reports are
51
+ * immutable.
52
+ */
53
+ export interface Report {
54
+ /**
55
+ * Unique identifier for the report
56
+ */
57
+ id: string;
58
+ /**
59
+ * When the report was submitted
60
+ */
61
+ created_at: string;
62
+ /**
63
+ * Report data, matching the report type's schema
64
+ */
65
+ data: {
66
+ [key: string]: unknown;
67
+ };
68
+ /**
69
+ * When the reported event happened
70
+ */
71
+ occurred_at: string;
72
+ /**
73
+ * Version of the report type's schema that data was validated against
74
+ */
75
+ schema_version: number;
76
+ /**
77
+ * ID of the task the report belongs to
78
+ */
79
+ task_id: string;
80
+ /**
81
+ * Report type name
82
+ */
83
+ type: string;
84
+ /**
85
+ * ID of the browser the report was observed in, if any
86
+ */
87
+ session_id?: string | null;
88
+ }
89
+ export interface ReportCreateParams {
90
+ /**
91
+ * Report data. It must match the schema of the report type's version and encode to
92
+ * at most 16 KB of JSON.
93
+ */
94
+ data: {
95
+ [key: string]: unknown;
96
+ };
97
+ /**
98
+ * ID of the task to report against.
99
+ */
100
+ task_id: string;
101
+ /**
102
+ * Report type name. List report types to see the available types and their
103
+ * schemas.
104
+ */
105
+ type: string;
106
+ /**
107
+ * When the reported event happened. Defaults to the time the report is submitted.
108
+ * Must be no more than 5 minutes in the future or 30 days in the past.
109
+ */
110
+ occurred_at?: string;
111
+ /**
112
+ * Version of the report type's schema to validate data against. Defaults to the
113
+ * type's latest version, which the response returns.
114
+ */
115
+ schema_version?: number;
116
+ /**
117
+ * ID of the browser the report was observed in. It must belong to the task's
118
+ * project; deleted browsers are accepted. The browser is linked to the task if it
119
+ * is not already.
120
+ */
121
+ session_id?: string;
122
+ }
123
+ export interface ReportListParams extends OffsetPaginationParams {
124
+ /**
125
+ * Task whose reports to list.
126
+ */
127
+ task_id: string;
128
+ /**
129
+ * Only return reports of this type.
130
+ */
131
+ type?: string;
132
+ }
133
+ export declare namespace Reports {
134
+ export { type Report as Report, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, };
135
+ }
136
+ //# sourceMappingURL=reports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIlE;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAGtG;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Reports = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ /**
9
+ * Discover report types and submit typed reports against tasks.
10
+ */
11
+ class Reports extends resource_1.APIResource {
12
+ /**
13
+ * Submit a typed report against a task. The data is validated against the report
14
+ * type's schema; a validation failure returns 400 with one detail per invalid
15
+ * field. A task can have at most 500 reports.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const report = await client.reports.create({
20
+ * data: { result: 'bar', evidence: 'bar' },
21
+ * task_id: 'x',
22
+ * type: 'task.result',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body, options) {
27
+ return this._client.post('/reports', { body, ...options });
28
+ }
29
+ /**
30
+ * Retrieve a report.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const report = await client.reports.retrieve('id');
35
+ * ```
36
+ */
37
+ retrieve(id, options) {
38
+ return this._client.get((0, path_1.path) `/reports/${id}`, options);
39
+ }
40
+ /**
41
+ * List a task's reports in the order they were submitted, oldest first.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Automatically fetches more pages as needed.
46
+ * for await (const report of client.reports.list({
47
+ * task_id: 'task_id',
48
+ * })) {
49
+ * // ...
50
+ * }
51
+ * ```
52
+ */
53
+ list(query, options) {
54
+ return this._client.getAPIList('/reports', (pagination_1.OffsetPagination), { query, ...options });
55
+ }
56
+ }
57
+ exports.Reports = Reports;
58
+ //# sourceMappingURL=reports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAEhG,oDAA8C;AAE9C;;GAEG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,6BAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF;AA/CD,0BA+CC"}
@@ -0,0 +1,54 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { OffsetPagination } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ /**
6
+ * Discover report types and submit typed reports against tasks.
7
+ */
8
+ export class Reports extends APIResource {
9
+ /**
10
+ * Submit a typed report against a task. The data is validated against the report
11
+ * type's schema; a validation failure returns 400 with one detail per invalid
12
+ * field. A task can have at most 500 reports.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const report = await client.reports.create({
17
+ * data: { result: 'bar', evidence: 'bar' },
18
+ * task_id: 'x',
19
+ * type: 'task.result',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body, options) {
24
+ return this._client.post('/reports', { body, ...options });
25
+ }
26
+ /**
27
+ * Retrieve a report.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const report = await client.reports.retrieve('id');
32
+ * ```
33
+ */
34
+ retrieve(id, options) {
35
+ return this._client.get(path `/reports/${id}`, options);
36
+ }
37
+ /**
38
+ * List a task's reports in the order they were submitted, oldest first.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const report of client.reports.list({
44
+ * task_id: 'task_id',
45
+ * })) {
46
+ * // ...
47
+ * }
48
+ * ```
49
+ */
50
+ list(query, options) {
51
+ return this._client.getAPIList('/reports', (OffsetPagination), { query, ...options });
52
+ }
53
+ }
54
+ //# sourceMappingURL=reports.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.mjs","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAEhG,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,gBAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}