@nimble-way/nimble-js 0.19.0 → 1.0.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 (255) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +10 -10
  3. package/client.d.mts +10 -39
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -39
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -43
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -43
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agents/agents.d.mts +811 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +811 -0
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +67 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +62 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/index.d.mts +4 -0
  21. package/resources/agents/index.d.mts.map +1 -0
  22. package/resources/agents/index.d.ts +4 -0
  23. package/resources/agents/index.d.ts.map +1 -0
  24. package/resources/{task-agent → agents}/index.js +3 -3
  25. package/resources/agents/index.js.map +1 -0
  26. package/resources/{task-agent → agents}/index.mjs +1 -1
  27. package/resources/agents/index.mjs.map +1 -0
  28. package/resources/{task-agent → agents}/runs.d.mts +413 -128
  29. package/resources/agents/runs.d.mts.map +1 -0
  30. package/resources/{task-agent → agents}/runs.d.ts +413 -128
  31. package/resources/agents/runs.d.ts.map +1 -0
  32. package/resources/agents/runs.js +63 -0
  33. package/resources/agents/runs.js.map +1 -0
  34. package/resources/agents/runs.mjs +59 -0
  35. package/resources/agents/runs.mjs.map +1 -0
  36. package/resources/agents/templates.d.mts +258 -0
  37. package/resources/agents/templates.d.mts.map +1 -0
  38. package/resources/agents/templates.d.ts +258 -0
  39. package/resources/agents/templates.d.ts.map +1 -0
  40. package/resources/{task-agent → agents}/templates.js +5 -4
  41. package/resources/agents/templates.js.map +1 -0
  42. package/resources/agents/templates.mjs +19 -0
  43. package/resources/agents/templates.mjs.map +1 -0
  44. package/resources/agents.d.mts +2 -0
  45. package/resources/agents.d.mts.map +1 -0
  46. package/resources/agents.d.ts +2 -0
  47. package/resources/agents.d.ts.map +1 -0
  48. package/resources/{task-agent.js → agents.js} +2 -2
  49. package/resources/agents.js.map +1 -0
  50. package/resources/{task-agent.mjs → agents.mjs} +2 -2
  51. package/resources/agents.mjs.map +1 -0
  52. package/resources/batches.js +3 -3
  53. package/resources/batches.mjs +3 -3
  54. package/resources/crawl.js +4 -4
  55. package/resources/crawl.mjs +4 -4
  56. package/resources/domain-knowledge.js +1 -1
  57. package/resources/domain-knowledge.mjs +1 -1
  58. package/resources/extract/extract.d.mts +1243 -0
  59. package/resources/extract/extract.d.mts.map +1 -0
  60. package/resources/extract/extract.d.ts +1243 -0
  61. package/resources/extract/extract.d.ts.map +1 -0
  62. package/resources/extract/extract.js +52 -0
  63. package/resources/extract/extract.js.map +1 -0
  64. package/resources/extract/extract.mjs +47 -0
  65. package/resources/extract/extract.mjs.map +1 -0
  66. package/resources/extract/index.d.mts +3 -0
  67. package/resources/extract/index.d.mts.map +1 -0
  68. package/resources/extract/index.d.ts +3 -0
  69. package/resources/extract/index.d.ts.map +1 -0
  70. package/resources/extract/index.js +9 -0
  71. package/resources/extract/index.js.map +1 -0
  72. package/resources/extract/index.mjs +4 -0
  73. package/resources/extract/index.mjs.map +1 -0
  74. package/resources/extract/templates/generations.d.mts +364 -0
  75. package/resources/extract/templates/generations.d.mts.map +1 -0
  76. package/resources/extract/templates/generations.d.ts +364 -0
  77. package/resources/extract/templates/generations.d.ts.map +1 -0
  78. package/resources/extract/templates/generations.js +39 -0
  79. package/resources/extract/templates/generations.js.map +1 -0
  80. package/resources/extract/templates/generations.mjs +35 -0
  81. package/resources/extract/templates/generations.mjs.map +1 -0
  82. package/resources/extract/templates/index.d.mts +4 -0
  83. package/resources/extract/templates/index.d.mts.map +1 -0
  84. package/resources/extract/templates/index.d.ts +4 -0
  85. package/resources/extract/templates/index.d.ts.map +1 -0
  86. package/resources/extract/templates/index.js +11 -0
  87. package/resources/extract/templates/index.js.map +1 -0
  88. package/resources/extract/templates/index.mjs +5 -0
  89. package/resources/extract/templates/index.mjs.map +1 -0
  90. package/resources/{agent.d.ts → extract/templates/templates.d.mts} +475 -263
  91. package/resources/extract/templates/templates.d.mts.map +1 -0
  92. package/resources/{agent.d.mts → extract/templates/templates.d.ts} +475 -263
  93. package/resources/extract/templates/templates.d.ts.map +1 -0
  94. package/resources/extract/templates/templates.js +120 -0
  95. package/resources/extract/templates/templates.js.map +1 -0
  96. package/resources/extract/templates/templates.mjs +115 -0
  97. package/resources/extract/templates/templates.mjs.map +1 -0
  98. package/resources/extract/templates/versions.d.mts +226 -0
  99. package/resources/extract/templates/versions.d.mts.map +1 -0
  100. package/resources/extract/templates/versions.d.ts +226 -0
  101. package/resources/extract/templates/versions.d.ts.map +1 -0
  102. package/resources/extract/templates/versions.js +42 -0
  103. package/resources/extract/templates/versions.js.map +1 -0
  104. package/resources/extract/templates/versions.mjs +38 -0
  105. package/resources/extract/templates/versions.mjs.map +1 -0
  106. package/resources/extract/templates.d.mts +2 -0
  107. package/resources/extract/templates.d.mts.map +1 -0
  108. package/resources/extract/templates.d.ts +2 -0
  109. package/resources/extract/templates.d.ts.map +1 -0
  110. package/resources/extract/templates.js +6 -0
  111. package/resources/extract/templates.js.map +1 -0
  112. package/resources/extract/templates.mjs +3 -0
  113. package/resources/extract/templates.mjs.map +1 -0
  114. package/resources/extract.d.mts +2 -0
  115. package/resources/extract.d.mts.map +1 -0
  116. package/resources/extract.d.ts +2 -0
  117. package/resources/extract.d.ts.map +1 -0
  118. package/resources/extract.js +6 -0
  119. package/resources/extract.js.map +1 -0
  120. package/resources/extract.mjs +3 -0
  121. package/resources/extract.mjs.map +1 -0
  122. package/resources/fast-serp.js +1 -1
  123. package/resources/fast-serp.mjs +1 -1
  124. package/resources/index.d.mts +4 -4
  125. package/resources/index.d.mts.map +1 -1
  126. package/resources/index.d.ts +4 -4
  127. package/resources/index.d.ts.map +1 -1
  128. package/resources/index.js +5 -5
  129. package/resources/index.js.map +1 -1
  130. package/resources/index.mjs +2 -2
  131. package/resources/index.mjs.map +1 -1
  132. package/resources/jobs/index.d.mts +2 -2
  133. package/resources/jobs/index.d.mts.map +1 -1
  134. package/resources/jobs/index.d.ts +2 -2
  135. package/resources/jobs/index.d.ts.map +1 -1
  136. package/resources/jobs/index.js.map +1 -1
  137. package/resources/jobs/index.mjs.map +1 -1
  138. package/resources/jobs/jobs.d.mts +34 -90
  139. package/resources/jobs/jobs.d.mts.map +1 -1
  140. package/resources/jobs/jobs.d.ts +34 -90
  141. package/resources/jobs/jobs.d.ts.map +1 -1
  142. package/resources/jobs/jobs.js +10 -16
  143. package/resources/jobs/jobs.js.map +1 -1
  144. package/resources/jobs/jobs.mjs +11 -17
  145. package/resources/jobs/jobs.mjs.map +1 -1
  146. package/resources/jobs/runs/artifacts.d.mts +7 -17
  147. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  148. package/resources/jobs/runs/artifacts.d.ts +7 -17
  149. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  150. package/resources/jobs/runs/artifacts.js +8 -8
  151. package/resources/jobs/runs/artifacts.mjs +8 -8
  152. package/resources/jobs/runs/index.d.mts +1 -1
  153. package/resources/jobs/runs/index.d.mts.map +1 -1
  154. package/resources/jobs/runs/index.d.ts +1 -1
  155. package/resources/jobs/runs/index.d.ts.map +1 -1
  156. package/resources/jobs/runs/index.js.map +1 -1
  157. package/resources/jobs/runs/index.mjs.map +1 -1
  158. package/resources/jobs/runs/runs.d.mts +59 -21
  159. package/resources/jobs/runs/runs.d.mts.map +1 -1
  160. package/resources/jobs/runs/runs.d.ts +59 -21
  161. package/resources/jobs/runs/runs.d.ts.map +1 -1
  162. package/resources/jobs/runs/runs.js +12 -6
  163. package/resources/jobs/runs/runs.js.map +1 -1
  164. package/resources/jobs/runs/runs.mjs +12 -6
  165. package/resources/jobs/runs/runs.mjs.map +1 -1
  166. package/resources/media.js +2 -2
  167. package/resources/media.mjs +2 -2
  168. package/resources/serp.js +3 -3
  169. package/resources/serp.mjs +3 -3
  170. package/resources/tasks.js +3 -3
  171. package/resources/tasks.mjs +3 -3
  172. package/resources/top-level.d.mts +1 -1208
  173. package/resources/top-level.d.mts.map +1 -1
  174. package/resources/top-level.d.ts +1 -1208
  175. package/resources/top-level.d.ts.map +1 -1
  176. package/src/client.ts +41 -123
  177. package/src/resources/agents/agents.ts +1039 -0
  178. package/src/resources/agents/index.ts +30 -0
  179. package/src/resources/{task-agent → agents}/runs.ts +450 -154
  180. package/src/resources/agents/templates.ts +324 -0
  181. package/src/resources/{task-agent.ts → agents.ts} +1 -1
  182. package/src/resources/batches.ts +3 -3
  183. package/src/resources/crawl.ts +4 -4
  184. package/src/resources/domain-knowledge.ts +1 -1
  185. package/src/resources/extract/extract.ts +5182 -0
  186. package/src/resources/extract/index.ts +25 -0
  187. package/src/resources/extract/templates/generations.ts +435 -0
  188. package/src/resources/extract/templates/index.ts +29 -0
  189. package/src/resources/extract/templates/templates.ts +1176 -0
  190. package/src/resources/extract/templates/versions.ts +284 -0
  191. package/src/resources/extract/templates.ts +3 -0
  192. package/src/resources/extract.ts +3 -0
  193. package/src/resources/fast-serp.ts +1 -1
  194. package/src/resources/index.ts +16 -36
  195. package/src/resources/jobs/index.ts +1 -1
  196. package/src/resources/jobs/jobs.ts +49 -112
  197. package/src/resources/jobs/runs/artifacts.ts +11 -21
  198. package/src/resources/jobs/runs/index.ts +1 -0
  199. package/src/resources/jobs/runs/runs.ts +74 -24
  200. package/src/resources/media.ts +2 -2
  201. package/src/resources/serp.ts +3 -3
  202. package/src/resources/tasks.ts +3 -3
  203. package/src/resources/top-level.ts +88 -5192
  204. package/src/version.ts +1 -1
  205. package/version.d.mts +1 -1
  206. package/version.d.mts.map +1 -1
  207. package/version.d.ts +1 -1
  208. package/version.d.ts.map +1 -1
  209. package/version.js +1 -1
  210. package/version.js.map +1 -1
  211. package/version.mjs +1 -1
  212. package/version.mjs.map +1 -1
  213. package/resources/agent.d.mts.map +0 -1
  214. package/resources/agent.d.ts.map +0 -1
  215. package/resources/agent.js +0 -101
  216. package/resources/agent.js.map +0 -1
  217. package/resources/agent.mjs +0 -97
  218. package/resources/agent.mjs.map +0 -1
  219. package/resources/task-agent/index.d.mts +0 -4
  220. package/resources/task-agent/index.d.mts.map +0 -1
  221. package/resources/task-agent/index.d.ts +0 -4
  222. package/resources/task-agent/index.d.ts.map +0 -1
  223. package/resources/task-agent/index.js.map +0 -1
  224. package/resources/task-agent/index.mjs.map +0 -1
  225. package/resources/task-agent/runs.d.mts.map +0 -1
  226. package/resources/task-agent/runs.d.ts.map +0 -1
  227. package/resources/task-agent/runs.js +0 -65
  228. package/resources/task-agent/runs.js.map +0 -1
  229. package/resources/task-agent/runs.mjs +0 -61
  230. package/resources/task-agent/runs.mjs.map +0 -1
  231. package/resources/task-agent/task-agent.d.mts +0 -481
  232. package/resources/task-agent/task-agent.d.mts.map +0 -1
  233. package/resources/task-agent/task-agent.d.ts +0 -481
  234. package/resources/task-agent/task-agent.d.ts.map +0 -1
  235. package/resources/task-agent/task-agent.js +0 -68
  236. package/resources/task-agent/task-agent.js.map +0 -1
  237. package/resources/task-agent/task-agent.mjs +0 -63
  238. package/resources/task-agent/task-agent.mjs.map +0 -1
  239. package/resources/task-agent/templates.d.mts +0 -107
  240. package/resources/task-agent/templates.d.mts.map +0 -1
  241. package/resources/task-agent/templates.d.ts +0 -107
  242. package/resources/task-agent/templates.d.ts.map +0 -1
  243. package/resources/task-agent/templates.js.map +0 -1
  244. package/resources/task-agent/templates.mjs +0 -18
  245. package/resources/task-agent/templates.mjs.map +0 -1
  246. package/resources/task-agent.d.mts +0 -2
  247. package/resources/task-agent.d.mts.map +0 -1
  248. package/resources/task-agent.d.ts +0 -2
  249. package/resources/task-agent.d.ts.map +0 -1
  250. package/resources/task-agent.js.map +0 -1
  251. package/resources/task-agent.mjs.map +0 -1
  252. package/src/resources/agent.ts +0 -952
  253. package/src/resources/task-agent/index.ts +0 -32
  254. package/src/resources/task-agent/task-agent.ts +0 -746
  255. package/src/resources/task-agent/templates.ts +0 -172
@@ -1,952 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
- import { path } from '../internal/utils/path';
7
-
8
- export class Agent extends APIResource {
9
- /**
10
- * List Agent Templates
11
- *
12
- * @example
13
- * ```ts
14
- * const agents = await client.agent.list();
15
- * ```
16
- */
17
- list(
18
- query: AgentListParams | null | undefined = {},
19
- options?: RequestOptions,
20
- ): APIPromise<AgentListResponse> {
21
- return this._client.get('/v1/agents', { query, ...options });
22
- }
23
-
24
- /**
25
- * Create Agent Generation
26
- *
27
- * @example
28
- * ```ts
29
- * const response = await client.agent.generate({
30
- * prompt: 'prompt',
31
- * url: 'url',
32
- * });
33
- * ```
34
- */
35
- generate(body: AgentGenerateParams, options?: RequestOptions): APIPromise<AgentGenerateResponse> {
36
- return this._client.post('/v1/agents/generations', { body, ...options });
37
- }
38
-
39
- /**
40
- * Get Agent Template
41
- *
42
- * @example
43
- * ```ts
44
- * const agent = await client.agent.get('template_name');
45
- * ```
46
- */
47
- get(templateName: string, options?: RequestOptions): APIPromise<AgentGetResponse> {
48
- return this._client.get(path`/v1/agents/${templateName}`, options);
49
- }
50
-
51
- /**
52
- * Get Agent Generation
53
- *
54
- * @example
55
- * ```ts
56
- * const response = await client.agent.getGeneration(
57
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
58
- * );
59
- * ```
60
- */
61
- getGeneration(generationID: string, options?: RequestOptions): APIPromise<AgentGetGenerationResponse> {
62
- return this._client.get(path`/v1/agents/generations/${generationID}`, options);
63
- }
64
-
65
- /**
66
- * Execute WSA Realtime Endpoint
67
- *
68
- * @example
69
- * ```ts
70
- * const response = await client.agent.run({
71
- * agent: 'agent',
72
- * params: { foo: 'bar' },
73
- * });
74
- * ```
75
- */
76
- run(body: AgentRunParams, options?: RequestOptions): APIPromise<AgentRunResponse> {
77
- return this._client.post('/v1/agents/run', { body, ...options });
78
- }
79
-
80
- /**
81
- * Execute WSA Async Endpoint
82
- *
83
- * @example
84
- * ```ts
85
- * const response = await client.agent.runAsync({
86
- * agent: 'agent',
87
- * params: { foo: 'bar' },
88
- * });
89
- * ```
90
- */
91
- runAsync(body: AgentRunAsyncParams, options?: RequestOptions): APIPromise<AgentRunAsyncResponse> {
92
- return this._client.post('/v1/agents/async', { body, ...options });
93
- }
94
-
95
- /**
96
- * Execute WSA Batch Endpoint
97
- *
98
- * @example
99
- * ```ts
100
- * const response = await client.agent.runBatch({
101
- * inputs: [{}],
102
- * shared_inputs: { agent: 'agent' },
103
- * });
104
- * ```
105
- */
106
- runBatch(body: AgentRunBatchParams, options?: RequestOptions): APIPromise<AgentRunBatchResponse> {
107
- return this._client.post('/v1/agents/batch', { body, ...options });
108
- }
109
- }
110
-
111
- export type AgentListResponse = Array<AgentListResponse.AgentListResponseItem>;
112
-
113
- export namespace AgentListResponse {
114
- export interface AgentListResponseItem {
115
- display_name: string;
116
-
117
- is_public: boolean;
118
-
119
- name: string;
120
-
121
- description?: string | null;
122
-
123
- domain?: string | null;
124
-
125
- entity_type?: string | null;
126
-
127
- managed_by?: string | null;
128
-
129
- vertical?: string | null;
130
- }
131
- }
132
-
133
- export interface AgentGenerateResponse {
134
- id: string;
135
-
136
- status: string;
137
-
138
- agent_name?: string | null;
139
-
140
- completed_at?: string | null;
141
-
142
- created_at?: string | null;
143
-
144
- error?: string | null;
145
-
146
- generated_version?: AgentGenerateResponse.GeneratedVersion | null;
147
-
148
- generated_version_id?: string | null;
149
-
150
- source_version_id?: string | null;
151
-
152
- started_at?: string | null;
153
-
154
- summary?: string | null;
155
- }
156
-
157
- export namespace AgentGenerateResponse {
158
- export interface GeneratedVersion {
159
- id: string;
160
-
161
- agent_name: string;
162
-
163
- created_at: string;
164
-
165
- input_schema: { [key: string]: unknown };
166
-
167
- metadata: GeneratedVersion.Metadata;
168
-
169
- output_schema: { [key: string]: unknown };
170
-
171
- version_number: number;
172
-
173
- samples?: Array<GeneratedVersion.Sample> | null;
174
- }
175
-
176
- export namespace GeneratedVersion {
177
- export interface Metadata {
178
- data_source?: string | null;
179
-
180
- description?: string | null;
181
-
182
- display_name?: string | null;
183
-
184
- domain?: string | null;
185
-
186
- entity_type?: string | null;
187
-
188
- tags?: Array<string>;
189
-
190
- vertical?: string | null;
191
- }
192
-
193
- export interface Sample {
194
- input?: unknown;
195
-
196
- output?: unknown;
197
- }
198
- }
199
- }
200
-
201
- export interface AgentGetResponse {
202
- display_name: string;
203
-
204
- is_public: boolean;
205
-
206
- name: string;
207
-
208
- description?: string | null;
209
-
210
- domain?: string | null;
211
-
212
- entity_type?: string | null;
213
-
214
- feature_flags?: AgentGetResponse.FeatureFlags;
215
-
216
- input_properties?: Array<AgentGetResponse.InputProperty> | null;
217
-
218
- managed_by?: string | null;
219
-
220
- output_schema?: { [key: string]: unknown } | null;
221
-
222
- vertical?: string | null;
223
- }
224
-
225
- export namespace AgentGetResponse {
226
- export interface FeatureFlags {
227
- is_localization_supported?: boolean;
228
-
229
- is_pagination_supported?: boolean;
230
- }
231
-
232
- export interface InputProperty {
233
- default?: string | boolean | number | null;
234
-
235
- description?: string | null;
236
-
237
- examples?: Array<unknown> | null;
238
-
239
- is_localization_param?: boolean;
240
-
241
- is_pagination_param?: boolean;
242
-
243
- name?: string;
244
-
245
- required?: boolean;
246
-
247
- rules?: Array<string> | null;
248
-
249
- type?: string;
250
- }
251
- }
252
-
253
- export interface AgentGetGenerationResponse {
254
- id: string;
255
-
256
- status: string;
257
-
258
- agent_name?: string | null;
259
-
260
- completed_at?: string | null;
261
-
262
- created_at?: string | null;
263
-
264
- error?: string | null;
265
-
266
- generated_version?: AgentGetGenerationResponse.GeneratedVersion | null;
267
-
268
- generated_version_id?: string | null;
269
-
270
- source_version_id?: string | null;
271
-
272
- started_at?: string | null;
273
-
274
- summary?: string | null;
275
- }
276
-
277
- export namespace AgentGetGenerationResponse {
278
- export interface GeneratedVersion {
279
- id: string;
280
-
281
- agent_name: string;
282
-
283
- created_at: string;
284
-
285
- input_schema: { [key: string]: unknown };
286
-
287
- metadata: GeneratedVersion.Metadata;
288
-
289
- output_schema: { [key: string]: unknown };
290
-
291
- version_number: number;
292
-
293
- samples?: Array<GeneratedVersion.Sample> | null;
294
- }
295
-
296
- export namespace GeneratedVersion {
297
- export interface Metadata {
298
- data_source?: string | null;
299
-
300
- description?: string | null;
301
-
302
- display_name?: string | null;
303
-
304
- domain?: string | null;
305
-
306
- entity_type?: string | null;
307
-
308
- tags?: Array<string>;
309
-
310
- vertical?: string | null;
311
- }
312
-
313
- export interface Sample {
314
- input?: unknown;
315
-
316
- output?: unknown;
317
- }
318
- }
319
- }
320
-
321
- export interface AgentRunResponse {
322
- data: AgentRunResponse.Data;
323
-
324
- metadata: AgentRunResponse.Metadata;
325
-
326
- /**
327
- * The status of the task.
328
- */
329
- status: 'success' | 'skipped' | 'fatal' | 'error' | 'postponed' | 'ignored' | 'rejected' | 'blocked';
330
-
331
- /**
332
- * Unique identifier for the task.
333
- */
334
- task_id: string;
335
-
336
- /**
337
- * The final URL.
338
- */
339
- url: string;
340
-
341
- debug?: AgentRunResponse.Debug;
342
-
343
- /**
344
- * Pagination information if applicable.
345
- */
346
- pagination?: AgentRunResponse.NextPageParams | Array<AgentRunResponse.UnionMember1>;
347
-
348
- /**
349
- * The HTTP status code of the task.
350
- */
351
- status_code?: number;
352
-
353
- /**
354
- * List of warnings generated during the task.
355
- */
356
- warnings?: Array<string>;
357
- }
358
-
359
- export namespace AgentRunResponse {
360
- export interface Data {
361
- /**
362
- * Browser actions execution results. Present only when browser_actions were
363
- * specified in the request.
364
- */
365
- browser_actions?: Data.BrowserActions;
366
-
367
- /**
368
- * The cookies collected from browser actions during the task.
369
- */
370
- cookies?: Array<unknown>;
371
-
372
- /**
373
- * The evaluation results from browser actions during the task.
374
- */
375
- eval?: Array<unknown>;
376
-
377
- /**
378
- * The http requests from browser actions made during the task.
379
- */
380
- fetch?: Array<unknown>;
381
-
382
- /**
383
- * The headers received during the task.
384
- */
385
- headers?: { [key: string]: string };
386
-
387
- /**
388
- * The HTML content of the page.
389
- */
390
- html?: string;
391
-
392
- /**
393
- * List of all unique URLs found on the page.
394
- */
395
- links?: Array<string>;
396
-
397
- /**
398
- * The Markdown version of the HTML content.
399
- */
400
- markdown?: string;
401
-
402
- /**
403
- * The network capture data collected during the task.
404
- */
405
- network_capture?: Array<Data.NetworkCapture>;
406
-
407
- /**
408
- * Individual HTML content of each pagination page, before merging.
409
- */
410
- pages_html?: Array<string>;
411
-
412
- /**
413
- * The parsing results extracted from the HTML & network content.
414
- */
415
- parsing?: Data.ParsingSuccessResult | Data.ParsingErrorResult | { [key: string]: unknown };
416
-
417
- /**
418
- * The list of redirects that occurred during the task.
419
- */
420
- redirects?: Array<Data.Redirect>;
421
-
422
- /**
423
- * Screenshots taken during the task, from browser actions, or the screenshot
424
- * format.
425
- */
426
- screenshots?: Array<unknown>;
427
- }
428
-
429
- export namespace Data {
430
- /**
431
- * Browser actions execution results. Present only when browser_actions were
432
- * specified in the request.
433
- */
434
- export interface BrowserActions {
435
- results: Array<BrowserActions.Result>;
436
-
437
- success: boolean;
438
-
439
- total_duration: number;
440
- }
441
-
442
- export namespace BrowserActions {
443
- export interface Result {
444
- duration: number;
445
-
446
- name:
447
- | 'goto'
448
- | 'wait'
449
- | 'wait_for_element'
450
- | 'wait_for_navigation'
451
- | 'click'
452
- | 'fill'
453
- | 'press'
454
- | 'scroll'
455
- | 'auto_scroll'
456
- | 'screenshot'
457
- | 'get_cookies'
458
- | 'eval'
459
- | 'fetch';
460
-
461
- status: 'no-run' | 'in-progress' | 'done' | 'error' | 'skipped';
462
-
463
- error?: string;
464
-
465
- result?: unknown;
466
- }
467
- }
468
-
469
- export interface NetworkCapture {
470
- filter: NetworkCapture.Filter;
471
-
472
- results: Array<NetworkCapture.Result>;
473
-
474
- errorMessage?: string;
475
- }
476
-
477
- export namespace NetworkCapture {
478
- export interface Filter {
479
- validation: boolean;
480
-
481
- wait_for_requests_count: number;
482
-
483
- method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
484
-
485
- /**
486
- * Resource type for network capture filtering
487
- */
488
- resource_type?:
489
- | 'document'
490
- | 'stylesheet'
491
- | 'image'
492
- | 'media'
493
- | 'font'
494
- | 'script'
495
- | 'texttrack'
496
- | 'xhr'
497
- | 'fetch'
498
- | 'prefetch'
499
- | 'eventsource'
500
- | 'websocket'
501
- | 'manifest'
502
- | 'signedexchange'
503
- | 'ping'
504
- | 'cspviolationreport'
505
- | 'preflight'
506
- | 'other'
507
- | 'fedcm'
508
- | Array<
509
- | 'document'
510
- | 'stylesheet'
511
- | 'image'
512
- | 'media'
513
- | 'font'
514
- | 'script'
515
- | 'texttrack'
516
- | 'xhr'
517
- | 'fetch'
518
- | 'prefetch'
519
- | 'eventsource'
520
- | 'websocket'
521
- | 'manifest'
522
- | 'signedexchange'
523
- | 'ping'
524
- | 'cspviolationreport'
525
- | 'preflight'
526
- | 'other'
527
- | 'fedcm'
528
- >;
529
-
530
- status_code?: number | Array<number>;
531
-
532
- url?: Filter.URL;
533
-
534
- wait_for_requests_count_timeout?: number;
535
- }
536
-
537
- export namespace Filter {
538
- export interface URL {
539
- type: 'exact' | 'contains';
540
-
541
- value: string;
542
- }
543
- }
544
-
545
- export interface Result {
546
- request: Result.Request;
547
-
548
- response: Result.Response;
549
- }
550
-
551
- export namespace Result {
552
- export interface Request {
553
- headers: { [key: string]: string };
554
-
555
- method: string;
556
-
557
- /**
558
- * Resource type for network capture filtering
559
- */
560
- resource_type:
561
- | 'document'
562
- | 'stylesheet'
563
- | 'image'
564
- | 'media'
565
- | 'font'
566
- | 'script'
567
- | 'texttrack'
568
- | 'xhr'
569
- | 'fetch'
570
- | 'prefetch'
571
- | 'eventsource'
572
- | 'websocket'
573
- | 'manifest'
574
- | 'signedexchange'
575
- | 'ping'
576
- | 'cspviolationreport'
577
- | 'preflight'
578
- | 'other'
579
- | 'fedcm';
580
-
581
- url: string;
582
-
583
- body?: string;
584
- }
585
-
586
- export interface Response {
587
- body: string;
588
-
589
- headers: { [key: string]: string };
590
-
591
- serialization: 'none' | 'base64';
592
-
593
- status: number;
594
-
595
- status_text: string;
596
- }
597
- }
598
- }
599
-
600
- export interface ParsingSuccessResult {
601
- entities: { [key: string]: unknown };
602
-
603
- status: 'success';
604
- }
605
-
606
- export interface ParsingErrorResult {
607
- error: string;
608
-
609
- status: 'error';
610
- }
611
-
612
- export interface Redirect {
613
- status_code: number;
614
-
615
- url: string;
616
- }
617
- }
618
-
619
- export interface Metadata {
620
- /**
621
- * The name of the agent used for the query.
622
- */
623
- agent?: string;
624
-
625
- /**
626
- * The driver used for the task.
627
- */
628
- driver?: string;
629
-
630
- /**
631
- * The localization identifier for the query.
632
- */
633
- localization_id?: string;
634
-
635
- /**
636
- * The duration in milliseconds of the query processing.
637
- */
638
- query_duration?: number;
639
-
640
- /**
641
- * The time when the query was received.
642
- */
643
- query_time?: string;
644
-
645
- /**
646
- * Additional response parameters.
647
- */
648
- response_parameters?: unknown;
649
-
650
- /**
651
- * A tag associated with the query.
652
- */
653
- tag?: string;
654
- }
655
-
656
- export interface Debug {
657
- /**
658
- * Performance metrics collected during the task.
659
- */
660
- performance_metrics?: { [key: string]: number };
661
-
662
- /**
663
- * Total bytes used by the proxy during the task.
664
- */
665
- proxy_total_bytes_usage?: number;
666
-
667
- /**
668
- * The transformed output after applying any transformations.
669
- */
670
- transformed_output?: unknown;
671
-
672
- /**
673
- * The userbrowser instance using during the task.
674
- */
675
- userbrowser?: unknown;
676
- }
677
-
678
- export interface NextPageParams {
679
- next_page_params: { [key: string]: unknown };
680
- }
681
-
682
- export interface UnionMember1 {
683
- next_page_params: { [key: string]: unknown };
684
- }
685
- }
686
-
687
- export interface AgentRunAsyncResponse {
688
- status: 'success';
689
-
690
- task: { [key: string]: unknown };
691
- }
692
-
693
- /**
694
- * Response when a batch of extract tasks is created successfully.
695
- */
696
- export interface AgentRunBatchResponse {
697
- /**
698
- * Unique identifier for the batch.
699
- */
700
- batch_id: string;
701
-
702
- /**
703
- * Number of tasks in the batch.
704
- */
705
- batch_size: number;
706
-
707
- /**
708
- * List of created tasks.
709
- */
710
- tasks: Array<AgentRunBatchResponse.Task>;
711
- }
712
-
713
- export namespace AgentRunBatchResponse {
714
- export interface Task {
715
- /**
716
- * Unique task identifier.
717
- */
718
- id: string;
719
-
720
- _query: unknown;
721
-
722
- /**
723
- * Timestamp when the task was created.
724
- */
725
- created_at: string;
726
-
727
- /**
728
- * Original input data for the task.
729
- */
730
- input: unknown;
731
-
732
- /**
733
- * Current state of the task.
734
- */
735
- state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
736
-
737
- /**
738
- * URL for checking the task status.
739
- */
740
- status_url: string;
741
-
742
- /**
743
- * Account name that owns the task.
744
- */
745
- account_name?: string;
746
-
747
- api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
748
-
749
- /**
750
- * Batch ID if this task is part of a batch.
751
- */
752
- batch_id?: string | null;
753
-
754
- /**
755
- * URL for downloading the task results.
756
- */
757
- download_url?: string | null;
758
-
759
- /**
760
- * Error message if the task failed.
761
- */
762
- error?: string | null;
763
-
764
- /**
765
- * Classification of the error type.
766
- */
767
- error_type?: string | null;
768
-
769
- /**
770
- * Timestamp when the task was last modified.
771
- */
772
- modified_at?: string;
773
-
774
- /**
775
- * Storage location of the output data.
776
- */
777
- output_url?: string | null;
778
-
779
- /**
780
- * Queue name the task was submitted to.
781
- */
782
- queue?: string;
783
-
784
- /**
785
- * HTTP status code from the task execution.
786
- */
787
- status_code?: number;
788
- }
789
- }
790
-
791
- export interface AgentListParams {
792
- /**
793
- * Number of results per page
794
- */
795
- limit?: number;
796
-
797
- /**
798
- * Filter templates by attribution
799
- */
800
- managed_by?: 'nimble' | 'community' | 'self_managed' | null;
801
-
802
- /**
803
- * Pagination offset
804
- */
805
- offset?: number;
806
-
807
- /**
808
- * Filter by privacy level
809
- */
810
- privacy?: 'public' | 'private' | 'all' | null;
811
-
812
- /**
813
- * Search templates by name, domain, or vertical
814
- */
815
- search?: string | null;
816
- }
817
-
818
- export type AgentGenerateParams =
819
- | AgentGenerateParams.CrustCreateAgentGenerationRequest
820
- | AgentGenerateParams.CrustCreateAgentRefinementRequest;
821
-
822
- export declare namespace AgentGenerateParams {
823
- export interface CrustCreateAgentGenerationRequest {
824
- prompt: string;
825
-
826
- url: string;
827
-
828
- input_schema?: { [key: string]: unknown };
829
-
830
- metadata?: CrustCreateAgentGenerationRequest.Metadata | null;
831
-
832
- name?: string | null;
833
-
834
- output_schema?: { [key: string]: unknown };
835
- }
836
-
837
- export namespace CrustCreateAgentGenerationRequest {
838
- export interface Metadata {
839
- description?: string | null;
840
-
841
- display_name?: string | null;
842
-
843
- tags?: Array<string>;
844
- }
845
- }
846
-
847
- export interface CrustCreateAgentRefinementRequest {
848
- from_agent: string;
849
-
850
- prompt: string;
851
- }
852
- }
853
-
854
- export interface AgentRunParams {
855
- agent: string;
856
-
857
- params: { [key: string]: unknown };
858
-
859
- /**
860
- * Response formats to include. All disabled by default.
861
- */
862
- formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
863
-
864
- localization?: boolean;
865
- }
866
-
867
- export interface AgentRunAsyncParams {
868
- agent: string;
869
-
870
- params: { [key: string]: unknown };
871
-
872
- /**
873
- * URL to call back when async operation completes
874
- */
875
- callback_url?: string;
876
-
877
- /**
878
- * Response formats to include. All disabled by default.
879
- */
880
- formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
881
-
882
- localization?: boolean;
883
-
884
- /**
885
- * Whether to compress stored data
886
- */
887
- storage_compress?: boolean;
888
-
889
- /**
890
- * Custom name for the stored object
891
- */
892
- storage_object_name?: string;
893
-
894
- /**
895
- * Type of storage to use for results
896
- */
897
- storage_type?: string;
898
-
899
- /**
900
- * URL for storage location
901
- */
902
- storage_url?: string;
903
- }
904
-
905
- export interface AgentRunBatchParams {
906
- inputs: Array<AgentRunBatchParams.Input>;
907
-
908
- shared_inputs: AgentRunBatchParams.SharedInputs;
909
- }
910
-
911
- export namespace AgentRunBatchParams {
912
- export interface Input {
913
- /**
914
- * Response formats to include. All disabled by default.
915
- */
916
- formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
917
-
918
- localization?: boolean;
919
-
920
- params?: { [key: string]: unknown };
921
- }
922
-
923
- export interface SharedInputs {
924
- agent: string;
925
-
926
- /**
927
- * Response formats to include. All disabled by default.
928
- */
929
- formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
930
-
931
- localization?: boolean;
932
-
933
- params?: { [key: string]: unknown };
934
- }
935
- }
936
-
937
- export declare namespace Agent {
938
- export {
939
- type AgentListResponse as AgentListResponse,
940
- type AgentGenerateResponse as AgentGenerateResponse,
941
- type AgentGetResponse as AgentGetResponse,
942
- type AgentGetGenerationResponse as AgentGetGenerationResponse,
943
- type AgentRunResponse as AgentRunResponse,
944
- type AgentRunAsyncResponse as AgentRunAsyncResponse,
945
- type AgentRunBatchResponse as AgentRunBatchResponse,
946
- type AgentListParams as AgentListParams,
947
- type AgentGenerateParams as AgentGenerateParams,
948
- type AgentRunParams as AgentRunParams,
949
- type AgentRunAsyncParams as AgentRunAsyncParams,
950
- type AgentRunBatchParams as AgentRunBatchParams,
951
- };
952
- }