oz-agent-sdk 1.0.0-alpha.10

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 (408) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/LICENSE +201 -0
  3. package/README.md +422 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +179 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +179 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +461 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +457 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +75 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +75 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +85 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +79 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/sleep.d.mts +2 -0
  239. package/internal/utils/sleep.d.mts.map +1 -0
  240. package/internal/utils/sleep.d.ts +2 -0
  241. package/internal/utils/sleep.d.ts.map +1 -0
  242. package/internal/utils/sleep.js +7 -0
  243. package/internal/utils/sleep.js.map +1 -0
  244. package/internal/utils/sleep.mjs +3 -0
  245. package/internal/utils/sleep.mjs.map +1 -0
  246. package/internal/utils/uuid.d.mts +5 -0
  247. package/internal/utils/uuid.d.mts.map +1 -0
  248. package/internal/utils/uuid.d.ts +5 -0
  249. package/internal/utils/uuid.d.ts.map +1 -0
  250. package/internal/utils/uuid.js +19 -0
  251. package/internal/utils/uuid.js.map +1 -0
  252. package/internal/utils/uuid.mjs +15 -0
  253. package/internal/utils/uuid.mjs.map +1 -0
  254. package/internal/utils/values.d.mts +18 -0
  255. package/internal/utils/values.d.mts.map +1 -0
  256. package/internal/utils/values.d.ts +18 -0
  257. package/internal/utils/values.d.ts.map +1 -0
  258. package/internal/utils/values.js +112 -0
  259. package/internal/utils/values.js.map +1 -0
  260. package/internal/utils/values.mjs +94 -0
  261. package/internal/utils/values.mjs.map +1 -0
  262. package/internal/utils.d.mts +7 -0
  263. package/internal/utils.d.mts.map +1 -0
  264. package/internal/utils.d.ts +7 -0
  265. package/internal/utils.d.ts.map +1 -0
  266. package/internal/utils.js +11 -0
  267. package/internal/utils.js.map +1 -0
  268. package/internal/utils.mjs +8 -0
  269. package/internal/utils.mjs.map +1 -0
  270. package/package.json +137 -0
  271. package/resource.d.mts +2 -0
  272. package/resource.d.mts.map +1 -0
  273. package/resource.d.ts +2 -0
  274. package/resource.d.ts.map +1 -0
  275. package/resource.js +6 -0
  276. package/resource.js.map +1 -0
  277. package/resource.mjs +2 -0
  278. package/resource.mjs.map +1 -0
  279. package/resources/agent/agent.d.mts +413 -0
  280. package/resources/agent/agent.d.mts.map +1 -0
  281. package/resources/agent/agent.d.ts +413 -0
  282. package/resources/agent/agent.d.ts.map +1 -0
  283. package/resources/agent/agent.js +66 -0
  284. package/resources/agent/agent.js.map +1 -0
  285. package/resources/agent/agent.mjs +61 -0
  286. package/resources/agent/agent.mjs.map +1 -0
  287. package/resources/agent/index.d.mts +5 -0
  288. package/resources/agent/index.d.mts.map +1 -0
  289. package/resources/agent/index.d.ts +5 -0
  290. package/resources/agent/index.d.ts.map +1 -0
  291. package/resources/agent/index.js +13 -0
  292. package/resources/agent/index.js.map +1 -0
  293. package/resources/agent/index.mjs +6 -0
  294. package/resources/agent/index.mjs.map +1 -0
  295. package/resources/agent/runs.d.mts +412 -0
  296. package/resources/agent/runs.d.mts.map +1 -0
  297. package/resources/agent/runs.d.ts +412 -0
  298. package/resources/agent/runs.d.ts.map +1 -0
  299. package/resources/agent/runs.js +46 -0
  300. package/resources/agent/runs.js.map +1 -0
  301. package/resources/agent/runs.mjs +42 -0
  302. package/resources/agent/runs.mjs.map +1 -0
  303. package/resources/agent/schedules.d.mts +241 -0
  304. package/resources/agent/schedules.d.mts.map +1 -0
  305. package/resources/agent/schedules.d.ts +241 -0
  306. package/resources/agent/schedules.d.ts.map +1 -0
  307. package/resources/agent/schedules.js +110 -0
  308. package/resources/agent/schedules.js.map +1 -0
  309. package/resources/agent/schedules.mjs +106 -0
  310. package/resources/agent/schedules.mjs.map +1 -0
  311. package/resources/agent/sessions.d.mts +28 -0
  312. package/resources/agent/sessions.d.mts.map +1 -0
  313. package/resources/agent/sessions.d.ts +28 -0
  314. package/resources/agent/sessions.d.ts.map +1 -0
  315. package/resources/agent/sessions.js +25 -0
  316. package/resources/agent/sessions.js.map +1 -0
  317. package/resources/agent/sessions.mjs +21 -0
  318. package/resources/agent/sessions.mjs.map +1 -0
  319. package/resources/agent.d.mts +2 -0
  320. package/resources/agent.d.mts.map +1 -0
  321. package/resources/agent.d.ts +2 -0
  322. package/resources/agent.d.ts.map +1 -0
  323. package/resources/agent.js +6 -0
  324. package/resources/agent.js.map +1 -0
  325. package/resources/agent.mjs +3 -0
  326. package/resources/agent.mjs.map +1 -0
  327. package/resources/index.d.mts +2 -0
  328. package/resources/index.d.mts.map +1 -0
  329. package/resources/index.d.ts +2 -0
  330. package/resources/index.d.ts.map +1 -0
  331. package/resources/index.js +7 -0
  332. package/resources/index.js.map +1 -0
  333. package/resources/index.mjs +3 -0
  334. package/resources/index.mjs.map +1 -0
  335. package/resources.d.mts +2 -0
  336. package/resources.d.mts.map +1 -0
  337. package/resources.d.ts +2 -0
  338. package/resources.d.ts.map +1 -0
  339. package/resources.js +5 -0
  340. package/resources.js.map +1 -0
  341. package/resources.mjs +2 -0
  342. package/resources.mjs.map +1 -0
  343. package/src/api-promise.ts +2 -0
  344. package/src/client.ts +751 -0
  345. package/src/core/README.md +3 -0
  346. package/src/core/api-promise.ts +92 -0
  347. package/src/core/error.ts +130 -0
  348. package/src/core/resource.ts +11 -0
  349. package/src/core/uploads.ts +2 -0
  350. package/src/error.ts +2 -0
  351. package/src/index.ts +22 -0
  352. package/src/internal/README.md +3 -0
  353. package/src/internal/builtin-types.ts +93 -0
  354. package/src/internal/detect-platform.ts +196 -0
  355. package/src/internal/errors.ts +33 -0
  356. package/src/internal/headers.ts +97 -0
  357. package/src/internal/parse.ts +56 -0
  358. package/src/internal/qs/LICENSE.md +13 -0
  359. package/src/internal/qs/README.md +3 -0
  360. package/src/internal/qs/formats.ts +10 -0
  361. package/src/internal/qs/index.ts +13 -0
  362. package/src/internal/qs/stringify.ts +385 -0
  363. package/src/internal/qs/types.ts +71 -0
  364. package/src/internal/qs/utils.ts +265 -0
  365. package/src/internal/request-options.ts +91 -0
  366. package/src/internal/shim-types.ts +26 -0
  367. package/src/internal/shims.ts +107 -0
  368. package/src/internal/to-file.ts +154 -0
  369. package/src/internal/types.ts +95 -0
  370. package/src/internal/uploads.ts +187 -0
  371. package/src/internal/utils/base64.ts +40 -0
  372. package/src/internal/utils/bytes.ts +32 -0
  373. package/src/internal/utils/env.ts +18 -0
  374. package/src/internal/utils/log.ts +126 -0
  375. package/src/internal/utils/path.ts +88 -0
  376. package/src/internal/utils/sleep.ts +3 -0
  377. package/src/internal/utils/uuid.ts +17 -0
  378. package/src/internal/utils/values.ts +105 -0
  379. package/src/internal/utils.ts +8 -0
  380. package/src/lib/.keep +4 -0
  381. package/src/resource.ts +2 -0
  382. package/src/resources/agent/agent.ts +538 -0
  383. package/src/resources/agent/index.ts +34 -0
  384. package/src/resources/agent/runs.ts +527 -0
  385. package/src/resources/agent/schedules.ts +306 -0
  386. package/src/resources/agent/sessions.ts +35 -0
  387. package/src/resources/agent.ts +3 -0
  388. package/src/resources/index.ts +15 -0
  389. package/src/resources.ts +1 -0
  390. package/src/tsconfig.json +11 -0
  391. package/src/uploads.ts +2 -0
  392. package/src/version.ts +1 -0
  393. package/uploads.d.mts +2 -0
  394. package/uploads.d.mts.map +1 -0
  395. package/uploads.d.ts +2 -0
  396. package/uploads.d.ts.map +1 -0
  397. package/uploads.js +6 -0
  398. package/uploads.js.map +1 -0
  399. package/uploads.mjs +2 -0
  400. package/uploads.mjs.map +1 -0
  401. package/version.d.mts +2 -0
  402. package/version.d.mts.map +1 -0
  403. package/version.d.ts +2 -0
  404. package/version.d.ts.map +1 -0
  405. package/version.js +5 -0
  406. package/version.js.map +1 -0
  407. package/version.mjs +2 -0
  408. package/version.mjs.map +1 -0
@@ -0,0 +1,527 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as AgentAPI from './agent';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Runs extends APIResource {
10
+ /**
11
+ * Retrieve detailed information about a specific agent run, including the full
12
+ * prompt, session link, and resolved configuration.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const runItem = await client.agent.runs.retrieve('runId');
17
+ * ```
18
+ */
19
+ retrieve(runID: string, options?: RequestOptions): APIPromise<RunItem> {
20
+ return this._client.get(path`/agent/runs/${runID}`, options);
21
+ }
22
+
23
+ /**
24
+ * Retrieve a paginated list of agent runs with optional filtering. Results are
25
+ * ordered by creation time (newest first).
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const runs = await client.agent.runs.list();
30
+ * ```
31
+ */
32
+ list(query: RunListParams | null | undefined = {}, options?: RequestOptions): APIPromise<RunListResponse> {
33
+ return this._client.get('/agent/runs', { query, ...options });
34
+ }
35
+
36
+ /**
37
+ * Cancel an agent run that is currently queued or in progress. Once cancelled, the
38
+ * run will transition to a failed state.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response = await client.agent.runs.cancel('runId');
43
+ * ```
44
+ */
45
+ cancel(runID: string, options?: RequestOptions): APIPromise<string> {
46
+ return this._client.post(path`/agent/runs/${runID}/cancel`, options);
47
+ }
48
+ }
49
+
50
+ export type ArtifactItem =
51
+ | ArtifactItem.PlanArtifact
52
+ | ArtifactItem.PullRequestArtifact
53
+ | ArtifactItem.ScreenshotArtifact;
54
+
55
+ export namespace ArtifactItem {
56
+ export interface PlanArtifact {
57
+ /**
58
+ * Type of the artifact
59
+ */
60
+ artifact_type: 'PLAN';
61
+
62
+ /**
63
+ * Timestamp when the artifact was created (RFC3339)
64
+ */
65
+ created_at: string;
66
+
67
+ data: PlanArtifact.Data;
68
+ }
69
+
70
+ export namespace PlanArtifact {
71
+ export interface Data {
72
+ /**
73
+ * Unique identifier for the plan document
74
+ */
75
+ document_uid: string;
76
+
77
+ /**
78
+ * Unique identifier for the associated notebook
79
+ */
80
+ notebook_uid?: string;
81
+
82
+ /**
83
+ * Title of the plan
84
+ */
85
+ title?: string;
86
+ }
87
+ }
88
+
89
+ export interface PullRequestArtifact {
90
+ /**
91
+ * Type of the artifact
92
+ */
93
+ artifact_type: 'PULL_REQUEST';
94
+
95
+ /**
96
+ * Timestamp when the artifact was created (RFC3339)
97
+ */
98
+ created_at: string;
99
+
100
+ data: PullRequestArtifact.Data;
101
+ }
102
+
103
+ export namespace PullRequestArtifact {
104
+ export interface Data {
105
+ /**
106
+ * Branch name for the pull request
107
+ */
108
+ branch: string;
109
+
110
+ /**
111
+ * URL of the pull request
112
+ */
113
+ url: string;
114
+ }
115
+ }
116
+
117
+ export interface ScreenshotArtifact {
118
+ /**
119
+ * Type of the artifact
120
+ */
121
+ artifact_type: 'SCREENSHOT';
122
+
123
+ /**
124
+ * Timestamp when the artifact was created (RFC3339)
125
+ */
126
+ created_at: string;
127
+
128
+ data: ScreenshotArtifact.Data;
129
+ }
130
+
131
+ export namespace ScreenshotArtifact {
132
+ export interface Data {
133
+ /**
134
+ * Unique identifier for the screenshot artifact
135
+ */
136
+ artifact_uid: string;
137
+
138
+ /**
139
+ * MIME type of the screenshot image
140
+ */
141
+ mime_type: string;
142
+
143
+ /**
144
+ * Optional description of the screenshot
145
+ */
146
+ description?: string;
147
+ }
148
+ }
149
+ }
150
+
151
+ export interface RunItem {
152
+ /**
153
+ * Timestamp when the run was created (RFC3339)
154
+ */
155
+ created_at: string;
156
+
157
+ /**
158
+ * The prompt/instruction for the agent
159
+ */
160
+ prompt: string;
161
+
162
+ /**
163
+ * Unique identifier for the run
164
+ */
165
+ run_id: string;
166
+
167
+ /**
168
+ * Current state of the run:
169
+ *
170
+ * - QUEUED: Run is waiting to be picked up
171
+ * - PENDING: Run is being prepared
172
+ * - CLAIMED: Run has been claimed by a worker
173
+ * - INPROGRESS: Run is actively being executed
174
+ * - SUCCEEDED: Run completed successfully
175
+ * - FAILED: Run failed
176
+ * - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
177
+ * - ERROR: Run encountered an error
178
+ * - CANCELLED: Run was cancelled by user
179
+ */
180
+ state: RunState;
181
+
182
+ /**
183
+ * @deprecated Use run_id instead.
184
+ */
185
+ task_id: string;
186
+
187
+ /**
188
+ * Human-readable title for the run
189
+ */
190
+ title: string;
191
+
192
+ /**
193
+ * Timestamp when the run was last updated (RFC3339)
194
+ */
195
+ updated_at: string;
196
+
197
+ /**
198
+ * Configuration for a cloud agent run
199
+ */
200
+ agent_config?: AgentAPI.AmbientAgentConfig;
201
+
202
+ /**
203
+ * Information about the agent skill used for the run. Either full_path or
204
+ * bundled_skill_id will be set, but not both.
205
+ */
206
+ agent_skill?: RunItem.AgentSkill;
207
+
208
+ /**
209
+ * Artifacts created during the run (plans, pull requests, etc.)
210
+ */
211
+ artifacts?: Array<ArtifactItem>;
212
+
213
+ /**
214
+ * UUID of the conversation associated with the run
215
+ */
216
+ conversation_id?: string;
217
+
218
+ creator?: AgentAPI.UserProfile;
219
+
220
+ /**
221
+ * Whether the sandbox environment is currently running
222
+ */
223
+ is_sandbox_running?: boolean;
224
+
225
+ /**
226
+ * Resource usage information for the run
227
+ */
228
+ request_usage?: RunItem.RequestUsage;
229
+
230
+ /**
231
+ * Information about the schedule that triggered this run (only present for
232
+ * scheduled runs)
233
+ */
234
+ schedule?: RunItem.Schedule;
235
+
236
+ /**
237
+ * Ownership scope for a resource (team or personal)
238
+ */
239
+ scope?: RunItem.Scope;
240
+
241
+ /**
242
+ * UUID of the shared session (if available)
243
+ */
244
+ session_id?: string;
245
+
246
+ /**
247
+ * URL to view the agent session
248
+ */
249
+ session_link?: string;
250
+
251
+ /**
252
+ * Source that created the run:
253
+ *
254
+ * - LINEAR: Created from Linear integration
255
+ * - API: Created via the Warp API
256
+ * - SLACK: Created from Slack integration
257
+ * - LOCAL: Created from local CLI/app
258
+ * - SCHEDULED_AGENT: Created by a scheduled agent
259
+ * - WEB_APP: Created from the Warp web app
260
+ * - GITHUB_ACTION: Created from a GitHub action
261
+ * - CLOUD_MODE: Created from a Cloud Mode
262
+ * - CLI: Created from the CLI
263
+ */
264
+ source?: RunSourceType;
265
+
266
+ /**
267
+ * Timestamp when the agent started working on the run (RFC3339)
268
+ */
269
+ started_at?: string | null;
270
+
271
+ status_message?: RunItem.StatusMessage;
272
+ }
273
+
274
+ export namespace RunItem {
275
+ /**
276
+ * Information about the agent skill used for the run. Either full_path or
277
+ * bundled_skill_id will be set, but not both.
278
+ */
279
+ export interface AgentSkill {
280
+ /**
281
+ * Unique identifier for bundled skills
282
+ */
283
+ bundled_skill_id?: string;
284
+
285
+ /**
286
+ * Description of the skill
287
+ */
288
+ description?: string;
289
+
290
+ /**
291
+ * Path to the SKILL.md file (for file-based skills)
292
+ */
293
+ full_path?: string;
294
+
295
+ /**
296
+ * Human-readable name of the skill
297
+ */
298
+ name?: string;
299
+ }
300
+
301
+ /**
302
+ * Resource usage information for the run
303
+ */
304
+ export interface RequestUsage {
305
+ /**
306
+ * Cost of compute resources for the run
307
+ */
308
+ compute_cost?: number;
309
+
310
+ /**
311
+ * Cost of LLM inference for the run
312
+ */
313
+ inference_cost?: number;
314
+ }
315
+
316
+ /**
317
+ * Information about the schedule that triggered this run (only present for
318
+ * scheduled runs)
319
+ */
320
+ export interface Schedule {
321
+ /**
322
+ * Cron expression at the time the run was created
323
+ */
324
+ cron_schedule: string;
325
+
326
+ /**
327
+ * Unique identifier for the schedule
328
+ */
329
+ schedule_id: string;
330
+
331
+ /**
332
+ * Name of the schedule at the time the run was created
333
+ */
334
+ schedule_name: string;
335
+ }
336
+
337
+ /**
338
+ * Ownership scope for a resource (team or personal)
339
+ */
340
+ export interface Scope {
341
+ /**
342
+ * Type of ownership ("User" for personal, "Team" for team-owned)
343
+ */
344
+ type: 'User' | 'Team';
345
+
346
+ /**
347
+ * UID of the owning user or team
348
+ */
349
+ uid?: string;
350
+ }
351
+
352
+ export interface StatusMessage {
353
+ /**
354
+ * Human-readable status message
355
+ */
356
+ message?: string;
357
+ }
358
+ }
359
+
360
+ /**
361
+ * Source that created the run:
362
+ *
363
+ * - LINEAR: Created from Linear integration
364
+ * - API: Created via the Warp API
365
+ * - SLACK: Created from Slack integration
366
+ * - LOCAL: Created from local CLI/app
367
+ * - SCHEDULED_AGENT: Created by a scheduled agent
368
+ * - WEB_APP: Created from the Warp web app
369
+ * - GITHUB_ACTION: Created from a GitHub action
370
+ * - CLOUD_MODE: Created from a Cloud Mode
371
+ * - CLI: Created from the CLI
372
+ */
373
+ export type RunSourceType =
374
+ | 'LINEAR'
375
+ | 'API'
376
+ | 'SLACK'
377
+ | 'LOCAL'
378
+ | 'SCHEDULED_AGENT'
379
+ | 'WEB_APP'
380
+ | 'GITHUB_ACTION'
381
+ | 'CLOUD_MODE'
382
+ | 'CLI';
383
+
384
+ /**
385
+ * Current state of the run:
386
+ *
387
+ * - QUEUED: Run is waiting to be picked up
388
+ * - PENDING: Run is being prepared
389
+ * - CLAIMED: Run has been claimed by a worker
390
+ * - INPROGRESS: Run is actively being executed
391
+ * - SUCCEEDED: Run completed successfully
392
+ * - FAILED: Run failed
393
+ * - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
394
+ * - ERROR: Run encountered an error
395
+ * - CANCELLED: Run was cancelled by user
396
+ */
397
+ export type RunState =
398
+ | 'QUEUED'
399
+ | 'PENDING'
400
+ | 'CLAIMED'
401
+ | 'INPROGRESS'
402
+ | 'SUCCEEDED'
403
+ | 'FAILED'
404
+ | 'BLOCKED'
405
+ | 'ERROR'
406
+ | 'CANCELLED';
407
+
408
+ export interface RunListResponse {
409
+ page_info: RunListResponse.PageInfo;
410
+
411
+ runs: Array<RunItem>;
412
+ }
413
+
414
+ export namespace RunListResponse {
415
+ export interface PageInfo {
416
+ /**
417
+ * Whether there are more results available
418
+ */
419
+ has_next_page: boolean;
420
+
421
+ /**
422
+ * Opaque cursor for fetching the next page
423
+ */
424
+ next_cursor?: string;
425
+ }
426
+ }
427
+
428
+ /**
429
+ * The ID of the cancelled run
430
+ */
431
+ export type RunCancelResponse = string;
432
+
433
+ export interface RunListParams {
434
+ /**
435
+ * Filter runs by artifact type (PLAN or PULL_REQUEST)
436
+ */
437
+ artifact_type?: 'PLAN' | 'PULL_REQUEST' | 'SCREENSHOT';
438
+
439
+ /**
440
+ * Filter runs created after this timestamp (RFC3339 format)
441
+ */
442
+ created_after?: string;
443
+
444
+ /**
445
+ * Filter runs created before this timestamp (RFC3339 format)
446
+ */
447
+ created_before?: string;
448
+
449
+ /**
450
+ * Filter by creator UID (user or service account)
451
+ */
452
+ creator?: string;
453
+
454
+ /**
455
+ * Pagination cursor from previous response
456
+ */
457
+ cursor?: string;
458
+
459
+ /**
460
+ * Filter runs by environment ID
461
+ */
462
+ environment_id?: string;
463
+
464
+ /**
465
+ * Maximum number of runs to return
466
+ */
467
+ limit?: number;
468
+
469
+ /**
470
+ * Filter by model ID
471
+ */
472
+ model_id?: string;
473
+
474
+ /**
475
+ * Filter by agent config name
476
+ */
477
+ name?: string;
478
+
479
+ /**
480
+ * Fuzzy search query across run title, prompt, and skill_spec
481
+ */
482
+ q?: string;
483
+
484
+ /**
485
+ * Filter runs by the scheduled agent ID that created them
486
+ */
487
+ schedule_id?: string;
488
+
489
+ /**
490
+ * Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md"). Alias for
491
+ * skill_spec.
492
+ */
493
+ skill?: string;
494
+
495
+ /**
496
+ * Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
497
+ */
498
+ skill_spec?: string;
499
+
500
+ /**
501
+ * Filter by run source type
502
+ */
503
+ source?: RunSourceType;
504
+
505
+ /**
506
+ * Filter by run state. Can be specified multiple times to match any of the given
507
+ * states.
508
+ */
509
+ state?: Array<RunState>;
510
+
511
+ /**
512
+ * Filter runs updated after this timestamp (RFC3339 format)
513
+ */
514
+ updated_after?: string;
515
+ }
516
+
517
+ export declare namespace Runs {
518
+ export {
519
+ type ArtifactItem as ArtifactItem,
520
+ type RunItem as RunItem,
521
+ type RunSourceType as RunSourceType,
522
+ type RunState as RunState,
523
+ type RunListResponse as RunListResponse,
524
+ type RunCancelResponse as RunCancelResponse,
525
+ type RunListParams as RunListParams,
526
+ };
527
+ }