@tabstack/sdk 1.0.5 → 2.1.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 (513) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/LICENSE +1 -1
  3. package/README.md +282 -356
  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 +186 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +186 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +467 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +463 -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/streaming.d.mts +33 -0
  45. package/core/streaming.d.mts.map +1 -0
  46. package/core/streaming.d.ts +33 -0
  47. package/core/streaming.d.ts.map +1 -0
  48. package/core/streaming.js +263 -0
  49. package/core/streaming.js.map +1 -0
  50. package/core/streaming.mjs +258 -0
  51. package/core/streaming.mjs.map +1 -0
  52. package/core/uploads.d.mts +3 -0
  53. package/core/uploads.d.mts.map +1 -0
  54. package/core/uploads.d.ts +3 -0
  55. package/core/uploads.d.ts.map +1 -0
  56. package/core/uploads.js +6 -0
  57. package/core/uploads.js.map +1 -0
  58. package/core/uploads.mjs +2 -0
  59. package/core/uploads.mjs.map +1 -0
  60. package/error.d.mts +2 -0
  61. package/error.d.mts.map +1 -0
  62. package/error.d.ts +2 -0
  63. package/error.d.ts.map +1 -0
  64. package/error.js +6 -0
  65. package/error.js.map +1 -0
  66. package/error.mjs +2 -0
  67. package/error.mjs.map +1 -0
  68. package/index.d.mts +6 -0
  69. package/index.d.mts.map +1 -0
  70. package/index.d.ts +6 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +30 -0
  73. package/index.js.map +1 -0
  74. package/index.mjs +7 -0
  75. package/index.mjs.map +1 -0
  76. package/internal/builtin-types.d.mts +73 -0
  77. package/internal/builtin-types.d.mts.map +1 -0
  78. package/internal/builtin-types.d.ts +73 -0
  79. package/internal/builtin-types.d.ts.map +1 -0
  80. package/internal/builtin-types.js +4 -0
  81. package/internal/builtin-types.js.map +1 -0
  82. package/internal/builtin-types.mjs +3 -0
  83. package/internal/builtin-types.mjs.map +1 -0
  84. package/internal/decoders/line.d.mts +17 -0
  85. package/internal/decoders/line.d.mts.map +1 -0
  86. package/internal/decoders/line.d.ts +17 -0
  87. package/internal/decoders/line.d.ts.map +1 -0
  88. package/internal/decoders/line.js +113 -0
  89. package/internal/decoders/line.js.map +1 -0
  90. package/internal/decoders/line.mjs +108 -0
  91. package/internal/decoders/line.mjs.map +1 -0
  92. package/internal/detect-platform.d.mts +15 -0
  93. package/internal/detect-platform.d.mts.map +1 -0
  94. package/internal/detect-platform.d.ts +15 -0
  95. package/internal/detect-platform.d.ts.map +1 -0
  96. package/internal/detect-platform.js +162 -0
  97. package/internal/detect-platform.js.map +1 -0
  98. package/internal/detect-platform.mjs +157 -0
  99. package/internal/detect-platform.mjs.map +1 -0
  100. package/internal/errors.d.mts +3 -0
  101. package/internal/errors.d.mts.map +1 -0
  102. package/internal/errors.d.ts +3 -0
  103. package/internal/errors.d.ts.map +1 -0
  104. package/internal/errors.js +41 -0
  105. package/internal/errors.js.map +1 -0
  106. package/internal/errors.mjs +36 -0
  107. package/internal/errors.mjs.map +1 -0
  108. package/internal/headers.d.mts +20 -0
  109. package/internal/headers.d.mts.map +1 -0
  110. package/internal/headers.d.ts +20 -0
  111. package/internal/headers.d.ts.map +1 -0
  112. package/internal/headers.js +79 -0
  113. package/internal/headers.js.map +1 -0
  114. package/internal/headers.mjs +74 -0
  115. package/internal/headers.mjs.map +1 -0
  116. package/internal/parse.d.mts +12 -0
  117. package/internal/parse.d.mts.map +1 -0
  118. package/internal/parse.d.ts +12 -0
  119. package/internal/parse.d.ts.map +1 -0
  120. package/internal/parse.js +45 -0
  121. package/internal/parse.js.map +1 -0
  122. package/internal/parse.mjs +42 -0
  123. package/internal/parse.mjs.map +1 -0
  124. package/internal/request-options.d.mts +77 -0
  125. package/internal/request-options.d.mts.map +1 -0
  126. package/internal/request-options.d.ts +77 -0
  127. package/internal/request-options.d.ts.map +1 -0
  128. package/internal/request-options.js +14 -0
  129. package/internal/request-options.js.map +1 -0
  130. package/internal/request-options.mjs +10 -0
  131. package/internal/request-options.mjs.map +1 -0
  132. package/internal/shim-types.d.mts +17 -0
  133. package/internal/shim-types.d.mts.map +1 -0
  134. package/internal/shim-types.d.ts +17 -0
  135. package/internal/shim-types.d.ts.map +1 -0
  136. package/internal/shim-types.js +4 -0
  137. package/internal/shim-types.js.map +1 -0
  138. package/internal/shim-types.mjs +3 -0
  139. package/internal/shim-types.mjs.map +1 -0
  140. package/internal/shims.d.mts +20 -0
  141. package/internal/shims.d.mts.map +1 -0
  142. package/internal/shims.d.ts +20 -0
  143. package/internal/shims.d.ts.map +1 -0
  144. package/internal/shims.js +92 -0
  145. package/internal/shims.js.map +1 -0
  146. package/internal/shims.mjs +85 -0
  147. package/internal/shims.mjs.map +1 -0
  148. package/internal/to-file.d.mts +45 -0
  149. package/internal/to-file.d.mts.map +1 -0
  150. package/internal/to-file.d.ts +45 -0
  151. package/internal/to-file.d.ts.map +1 -0
  152. package/internal/to-file.js +91 -0
  153. package/internal/to-file.js.map +1 -0
  154. package/internal/to-file.mjs +88 -0
  155. package/internal/to-file.mjs.map +1 -0
  156. package/internal/tslib.js +81 -0
  157. package/internal/tslib.mjs +17 -0
  158. package/internal/types.d.mts +69 -0
  159. package/internal/types.d.mts.map +1 -0
  160. package/internal/types.d.ts +69 -0
  161. package/internal/types.d.ts.map +1 -0
  162. package/internal/types.js +4 -0
  163. package/internal/types.js.map +1 -0
  164. package/internal/types.mjs +3 -0
  165. package/internal/types.mjs.map +1 -0
  166. package/internal/uploads.d.mts +42 -0
  167. package/internal/uploads.d.mts.map +1 -0
  168. package/internal/uploads.d.ts +42 -0
  169. package/internal/uploads.d.ts.map +1 -0
  170. package/internal/uploads.js +141 -0
  171. package/internal/uploads.js.map +1 -0
  172. package/internal/uploads.mjs +131 -0
  173. package/internal/uploads.mjs.map +1 -0
  174. package/internal/utils/base64.d.mts +3 -0
  175. package/internal/utils/base64.d.mts.map +1 -0
  176. package/internal/utils/base64.d.ts +3 -0
  177. package/internal/utils/base64.d.ts.map +1 -0
  178. package/internal/utils/base64.js +38 -0
  179. package/internal/utils/base64.js.map +1 -0
  180. package/internal/utils/base64.mjs +33 -0
  181. package/internal/utils/base64.mjs.map +1 -0
  182. package/internal/utils/bytes.d.mts +4 -0
  183. package/internal/utils/bytes.d.mts.map +1 -0
  184. package/internal/utils/bytes.d.ts +4 -0
  185. package/internal/utils/bytes.d.ts.map +1 -0
  186. package/internal/utils/bytes.js +31 -0
  187. package/internal/utils/bytes.js.map +1 -0
  188. package/internal/utils/bytes.mjs +26 -0
  189. package/internal/utils/bytes.mjs.map +1 -0
  190. package/internal/utils/env.d.mts +9 -0
  191. package/internal/utils/env.d.mts.map +1 -0
  192. package/internal/utils/env.d.ts +9 -0
  193. package/internal/utils/env.d.ts.map +1 -0
  194. package/internal/utils/env.js +22 -0
  195. package/internal/utils/env.js.map +1 -0
  196. package/internal/utils/env.mjs +18 -0
  197. package/internal/utils/env.mjs.map +1 -0
  198. package/internal/utils/log.d.mts +37 -0
  199. package/internal/utils/log.d.mts.map +1 -0
  200. package/internal/utils/log.d.ts +37 -0
  201. package/internal/utils/log.d.ts.map +1 -0
  202. package/internal/utils/log.js +85 -0
  203. package/internal/utils/log.js.map +1 -0
  204. package/internal/utils/log.mjs +79 -0
  205. package/internal/utils/log.mjs.map +1 -0
  206. package/internal/utils/path.d.mts +15 -0
  207. package/internal/utils/path.d.mts.map +1 -0
  208. package/internal/utils/path.d.ts +15 -0
  209. package/internal/utils/path.d.ts.map +1 -0
  210. package/internal/utils/path.js +79 -0
  211. package/internal/utils/path.js.map +1 -0
  212. package/internal/utils/path.mjs +74 -0
  213. package/internal/utils/path.mjs.map +1 -0
  214. package/internal/utils/sleep.d.mts +2 -0
  215. package/internal/utils/sleep.d.mts.map +1 -0
  216. package/internal/utils/sleep.d.ts +2 -0
  217. package/internal/utils/sleep.d.ts.map +1 -0
  218. package/internal/utils/sleep.js +7 -0
  219. package/internal/utils/sleep.js.map +1 -0
  220. package/internal/utils/sleep.mjs +3 -0
  221. package/internal/utils/sleep.mjs.map +1 -0
  222. package/internal/utils/uuid.d.mts +5 -0
  223. package/internal/utils/uuid.d.mts.map +1 -0
  224. package/internal/utils/uuid.d.ts +5 -0
  225. package/internal/utils/uuid.d.ts.map +1 -0
  226. package/internal/utils/uuid.js +19 -0
  227. package/internal/utils/uuid.js.map +1 -0
  228. package/internal/utils/uuid.mjs +15 -0
  229. package/internal/utils/uuid.mjs.map +1 -0
  230. package/internal/utils/values.d.mts +18 -0
  231. package/internal/utils/values.d.mts.map +1 -0
  232. package/internal/utils/values.d.ts +18 -0
  233. package/internal/utils/values.d.ts.map +1 -0
  234. package/internal/utils/values.js +112 -0
  235. package/internal/utils/values.js.map +1 -0
  236. package/internal/utils/values.mjs +94 -0
  237. package/internal/utils/values.mjs.map +1 -0
  238. package/internal/utils.d.mts +7 -0
  239. package/internal/utils.d.mts.map +1 -0
  240. package/internal/utils.d.ts +7 -0
  241. package/internal/utils.d.ts.map +1 -0
  242. package/internal/utils.js +11 -0
  243. package/internal/utils.js.map +1 -0
  244. package/internal/utils.mjs +8 -0
  245. package/internal/utils.mjs.map +1 -0
  246. package/package.json +139 -82
  247. package/resource.d.mts +2 -0
  248. package/resource.d.mts.map +1 -0
  249. package/resource.d.ts +2 -0
  250. package/resource.d.ts.map +1 -0
  251. package/resource.js +6 -0
  252. package/resource.js.map +1 -0
  253. package/resource.mjs +2 -0
  254. package/resource.mjs.map +1 -0
  255. package/resources/agent.d.mts +154 -0
  256. package/resources/agent.d.mts.map +1 -0
  257. package/resources/agent.d.ts +154 -0
  258. package/resources/agent.d.ts.map +1 -0
  259. package/resources/agent.js +88 -0
  260. package/resources/agent.js.map +1 -0
  261. package/resources/agent.mjs +84 -0
  262. package/resources/agent.mjs.map +1 -0
  263. package/resources/extract.d.mts +207 -0
  264. package/resources/extract.d.mts.map +1 -0
  265. package/resources/extract.d.ts +207 -0
  266. package/resources/extract.d.ts.map +1 -0
  267. package/resources/extract.js +61 -0
  268. package/resources/extract.js.map +1 -0
  269. package/resources/extract.mjs +57 -0
  270. package/resources/extract.mjs.map +1 -0
  271. package/resources/generate.d.mts +79 -0
  272. package/resources/generate.d.mts.map +1 -0
  273. package/resources/generate.d.ts +79 -0
  274. package/resources/generate.d.ts.map +1 -0
  275. package/resources/generate.js +44 -0
  276. package/resources/generate.js.map +1 -0
  277. package/resources/generate.mjs +40 -0
  278. package/resources/generate.mjs.map +1 -0
  279. package/resources/index.d.mts +4 -0
  280. package/resources/index.d.mts.map +1 -0
  281. package/resources/index.d.ts +4 -0
  282. package/resources/index.d.ts.map +1 -0
  283. package/resources/index.js +11 -0
  284. package/resources/index.js.map +1 -0
  285. package/resources/index.mjs +5 -0
  286. package/resources/index.mjs.map +1 -0
  287. package/resources.d.mts +2 -0
  288. package/resources.d.mts.map +1 -0
  289. package/resources.d.ts +2 -0
  290. package/resources.d.ts.map +1 -0
  291. package/resources.js +5 -0
  292. package/resources.js.map +1 -0
  293. package/resources.mjs +2 -0
  294. package/resources.mjs.map +1 -0
  295. package/src/api-promise.ts +2 -0
  296. package/src/client.ts +764 -0
  297. package/src/core/README.md +3 -0
  298. package/src/core/api-promise.ts +92 -0
  299. package/src/core/error.ts +130 -0
  300. package/src/core/resource.ts +11 -0
  301. package/src/core/streaming.ts +315 -0
  302. package/src/core/uploads.ts +2 -0
  303. package/src/error.ts +2 -0
  304. package/src/index.ts +22 -0
  305. package/src/internal/README.md +3 -0
  306. package/src/internal/builtin-types.ts +93 -0
  307. package/src/internal/decoders/line.ts +135 -0
  308. package/src/internal/detect-platform.ts +196 -0
  309. package/src/internal/errors.ts +33 -0
  310. package/src/internal/headers.ts +97 -0
  311. package/src/internal/parse.ts +64 -0
  312. package/src/internal/request-options.ts +93 -0
  313. package/src/internal/shim-types.ts +26 -0
  314. package/src/internal/shims.ts +107 -0
  315. package/src/internal/to-file.ts +154 -0
  316. package/src/internal/types.ts +95 -0
  317. package/src/internal/uploads.ts +187 -0
  318. package/src/internal/utils/base64.ts +40 -0
  319. package/src/internal/utils/bytes.ts +32 -0
  320. package/src/internal/utils/env.ts +18 -0
  321. package/src/internal/utils/log.ts +126 -0
  322. package/src/internal/utils/path.ts +88 -0
  323. package/src/internal/utils/sleep.ts +3 -0
  324. package/src/internal/utils/uuid.ts +17 -0
  325. package/src/internal/utils/values.ts +105 -0
  326. package/src/internal/utils.ts +8 -0
  327. package/src/lib/.keep +4 -0
  328. package/src/resource.ts +2 -0
  329. package/src/resources/agent.ts +194 -0
  330. package/src/resources/extract.ts +248 -0
  331. package/src/resources/generate.ts +89 -0
  332. package/src/resources/index.ts +17 -0
  333. package/src/resources.ts +1 -0
  334. package/src/streaming.ts +2 -0
  335. package/src/tsconfig.json +11 -0
  336. package/src/uploads.ts +2 -0
  337. package/src/version.ts +1 -0
  338. package/streaming.d.mts +2 -0
  339. package/streaming.d.mts.map +1 -0
  340. package/streaming.d.ts +2 -0
  341. package/streaming.d.ts.map +1 -0
  342. package/streaming.js +6 -0
  343. package/streaming.js.map +1 -0
  344. package/streaming.mjs +2 -0
  345. package/streaming.mjs.map +1 -0
  346. package/uploads.d.mts +2 -0
  347. package/uploads.d.mts.map +1 -0
  348. package/uploads.d.ts +2 -0
  349. package/uploads.d.ts.map +1 -0
  350. package/uploads.js +6 -0
  351. package/uploads.js.map +1 -0
  352. package/uploads.mjs +2 -0
  353. package/uploads.mjs.map +1 -0
  354. package/version.d.mts +2 -0
  355. package/version.d.mts.map +1 -0
  356. package/version.d.ts +2 -0
  357. package/version.d.ts.map +1 -0
  358. package/version.js +5 -0
  359. package/version.js.map +1 -0
  360. package/version.mjs +2 -0
  361. package/version.mjs.map +1 -0
  362. package/dist/cjs/agent.d.ts +0 -156
  363. package/dist/cjs/agent.d.ts.map +0 -1
  364. package/dist/cjs/agent.js +0 -211
  365. package/dist/cjs/agent.js.map +0 -1
  366. package/dist/cjs/agent.test.d.ts +0 -5
  367. package/dist/cjs/agent.test.d.ts.map +0 -1
  368. package/dist/cjs/agent.test.js +0 -441
  369. package/dist/cjs/agent.test.js.map +0 -1
  370. package/dist/cjs/client.d.ts +0 -58
  371. package/dist/cjs/client.d.ts.map +0 -1
  372. package/dist/cjs/client.js +0 -58
  373. package/dist/cjs/client.js.map +0 -1
  374. package/dist/cjs/client.test.d.ts +0 -5
  375. package/dist/cjs/client.test.d.ts.map +0 -1
  376. package/dist/cjs/client.test.js +0 -255
  377. package/dist/cjs/client.test.js.map +0 -1
  378. package/dist/cjs/exceptions.d.ts +0 -57
  379. package/dist/cjs/exceptions.d.ts.map +0 -1
  380. package/dist/cjs/exceptions.js +0 -95
  381. package/dist/cjs/exceptions.js.map +0 -1
  382. package/dist/cjs/exceptions.test.d.ts +0 -5
  383. package/dist/cjs/exceptions.test.d.ts.map +0 -1
  384. package/dist/cjs/exceptions.test.js +0 -239
  385. package/dist/cjs/exceptions.test.js.map +0 -1
  386. package/dist/cjs/extract.d.ts +0 -151
  387. package/dist/cjs/extract.d.ts.map +0 -1
  388. package/dist/cjs/extract.js +0 -165
  389. package/dist/cjs/extract.js.map +0 -1
  390. package/dist/cjs/extract.test.d.ts +0 -5
  391. package/dist/cjs/extract.test.d.ts.map +0 -1
  392. package/dist/cjs/extract.test.js +0 -250
  393. package/dist/cjs/extract.test.js.map +0 -1
  394. package/dist/cjs/generate.d.ts +0 -113
  395. package/dist/cjs/generate.d.ts.map +0 -1
  396. package/dist/cjs/generate.js +0 -124
  397. package/dist/cjs/generate.js.map +0 -1
  398. package/dist/cjs/generate.test.d.ts +0 -5
  399. package/dist/cjs/generate.test.d.ts.map +0 -1
  400. package/dist/cjs/generate.test.js +0 -314
  401. package/dist/cjs/generate.test.js.map +0 -1
  402. package/dist/cjs/index.d.ts +0 -52
  403. package/dist/cjs/index.d.ts.map +0 -1
  404. package/dist/cjs/index.js +0 -72
  405. package/dist/cjs/index.js.map +0 -1
  406. package/dist/cjs/package.json +0 -3
  407. package/dist/cjs/types.d.ts +0 -73
  408. package/dist/cjs/types.d.ts.map +0 -1
  409. package/dist/cjs/types.js +0 -118
  410. package/dist/cjs/types.js.map +0 -1
  411. package/dist/cjs/types.test.d.ts +0 -5
  412. package/dist/cjs/types.test.d.ts.map +0 -1
  413. package/dist/cjs/types.test.js +0 -370
  414. package/dist/cjs/types.test.js.map +0 -1
  415. package/dist/cjs/util/http.d.ts +0 -29
  416. package/dist/cjs/util/http.d.ts.map +0 -1
  417. package/dist/cjs/util/http.js +0 -201
  418. package/dist/cjs/util/http.js.map +0 -1
  419. package/dist/cjs/util/http.test.d.ts +0 -5
  420. package/dist/cjs/util/http.test.d.ts.map +0 -1
  421. package/dist/cjs/util/http.test.js +0 -237
  422. package/dist/cjs/util/http.test.js.map +0 -1
  423. package/dist/esm/agent.d.ts +0 -156
  424. package/dist/esm/agent.d.ts.map +0 -1
  425. package/dist/esm/agent.js +0 -207
  426. package/dist/esm/agent.js.map +0 -1
  427. package/dist/esm/agent.test.d.ts +0 -5
  428. package/dist/esm/agent.test.d.ts.map +0 -1
  429. package/dist/esm/agent.test.js +0 -439
  430. package/dist/esm/agent.test.js.map +0 -1
  431. package/dist/esm/client.d.ts +0 -58
  432. package/dist/esm/client.d.ts.map +0 -1
  433. package/dist/esm/client.js +0 -54
  434. package/dist/esm/client.js.map +0 -1
  435. package/dist/esm/client.test.d.ts +0 -5
  436. package/dist/esm/client.test.d.ts.map +0 -1
  437. package/dist/esm/client.test.js +0 -253
  438. package/dist/esm/client.test.js.map +0 -1
  439. package/dist/esm/exceptions.d.ts +0 -57
  440. package/dist/esm/exceptions.d.ts.map +0 -1
  441. package/dist/esm/exceptions.js +0 -85
  442. package/dist/esm/exceptions.js.map +0 -1
  443. package/dist/esm/exceptions.test.d.ts +0 -5
  444. package/dist/esm/exceptions.test.d.ts.map +0 -1
  445. package/dist/esm/exceptions.test.js +0 -237
  446. package/dist/esm/exceptions.test.js.map +0 -1
  447. package/dist/esm/extract.d.ts +0 -151
  448. package/dist/esm/extract.d.ts.map +0 -1
  449. package/dist/esm/extract.js +0 -161
  450. package/dist/esm/extract.js.map +0 -1
  451. package/dist/esm/extract.test.d.ts +0 -5
  452. package/dist/esm/extract.test.d.ts.map +0 -1
  453. package/dist/esm/extract.test.js +0 -248
  454. package/dist/esm/extract.test.js.map +0 -1
  455. package/dist/esm/generate.d.ts +0 -113
  456. package/dist/esm/generate.d.ts.map +0 -1
  457. package/dist/esm/generate.js +0 -120
  458. package/dist/esm/generate.js.map +0 -1
  459. package/dist/esm/generate.test.d.ts +0 -5
  460. package/dist/esm/generate.test.d.ts.map +0 -1
  461. package/dist/esm/generate.test.js +0 -312
  462. package/dist/esm/generate.test.js.map +0 -1
  463. package/dist/esm/index.d.ts +0 -52
  464. package/dist/esm/index.d.ts.map +0 -1
  465. package/dist/esm/index.js +0 -53
  466. package/dist/esm/index.js.map +0 -1
  467. package/dist/esm/package.json +0 -3
  468. package/dist/esm/types.d.ts +0 -73
  469. package/dist/esm/types.d.ts.map +0 -1
  470. package/dist/esm/types.js +0 -110
  471. package/dist/esm/types.js.map +0 -1
  472. package/dist/esm/types.test.d.ts +0 -5
  473. package/dist/esm/types.test.d.ts.map +0 -1
  474. package/dist/esm/types.test.js +0 -368
  475. package/dist/esm/types.test.js.map +0 -1
  476. package/dist/esm/util/http.d.ts +0 -29
  477. package/dist/esm/util/http.d.ts.map +0 -1
  478. package/dist/esm/util/http.js +0 -164
  479. package/dist/esm/util/http.js.map +0 -1
  480. package/dist/esm/util/http.test.d.ts +0 -5
  481. package/dist/esm/util/http.test.d.ts.map +0 -1
  482. package/dist/esm/util/http.test.js +0 -232
  483. package/dist/esm/util/http.test.js.map +0 -1
  484. package/dist/types/agent.d.ts +0 -156
  485. package/dist/types/agent.d.ts.map +0 -1
  486. package/dist/types/agent.test.d.ts +0 -5
  487. package/dist/types/agent.test.d.ts.map +0 -1
  488. package/dist/types/client.d.ts +0 -58
  489. package/dist/types/client.d.ts.map +0 -1
  490. package/dist/types/client.test.d.ts +0 -5
  491. package/dist/types/client.test.d.ts.map +0 -1
  492. package/dist/types/exceptions.d.ts +0 -57
  493. package/dist/types/exceptions.d.ts.map +0 -1
  494. package/dist/types/exceptions.test.d.ts +0 -5
  495. package/dist/types/exceptions.test.d.ts.map +0 -1
  496. package/dist/types/extract.d.ts +0 -151
  497. package/dist/types/extract.d.ts.map +0 -1
  498. package/dist/types/extract.test.d.ts +0 -5
  499. package/dist/types/extract.test.d.ts.map +0 -1
  500. package/dist/types/generate.d.ts +0 -113
  501. package/dist/types/generate.d.ts.map +0 -1
  502. package/dist/types/generate.test.d.ts +0 -5
  503. package/dist/types/generate.test.d.ts.map +0 -1
  504. package/dist/types/index.d.ts +0 -52
  505. package/dist/types/index.d.ts.map +0 -1
  506. package/dist/types/types.d.ts +0 -73
  507. package/dist/types/types.d.ts.map +0 -1
  508. package/dist/types/types.test.d.ts +0 -5
  509. package/dist/types/types.test.d.ts.map +0 -1
  510. package/dist/types/util/http.d.ts +0 -29
  511. package/dist/types/util/http.d.ts.map +0 -1
  512. package/dist/types/util/http.test.d.ts +0 -5
  513. package/dist/types/util/http.test.d.ts.map +0 -1
@@ -0,0 +1,126 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { hasOwn } from './values';
4
+ import { type Tabstack } from '../../client';
5
+ import { RequestOptions } from '../request-options';
6
+
7
+ type LogFn = (message: string, ...rest: unknown[]) => void;
8
+ export type Logger = {
9
+ error: LogFn;
10
+ warn: LogFn;
11
+ info: LogFn;
12
+ debug: LogFn;
13
+ };
14
+ export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
15
+
16
+ const levelNumbers = {
17
+ off: 0,
18
+ error: 200,
19
+ warn: 300,
20
+ info: 400,
21
+ debug: 500,
22
+ };
23
+
24
+ export const parseLogLevel = (
25
+ maybeLevel: string | undefined,
26
+ sourceName: string,
27
+ client: Tabstack,
28
+ ): LogLevel | undefined => {
29
+ if (!maybeLevel) {
30
+ return undefined;
31
+ }
32
+ if (hasOwn(levelNumbers, maybeLevel)) {
33
+ return maybeLevel;
34
+ }
35
+ loggerFor(client).warn(
36
+ `${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(
37
+ Object.keys(levelNumbers),
38
+ )}`,
39
+ );
40
+ return undefined;
41
+ };
42
+
43
+ function noop() {}
44
+
45
+ function makeLogFn(fnLevel: keyof Logger, logger: Logger | undefined, logLevel: LogLevel) {
46
+ if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
47
+ return noop;
48
+ } else {
49
+ // Don't wrap logger functions, we want the stacktrace intact!
50
+ return logger[fnLevel].bind(logger);
51
+ }
52
+ }
53
+
54
+ const noopLogger = {
55
+ error: noop,
56
+ warn: noop,
57
+ info: noop,
58
+ debug: noop,
59
+ };
60
+
61
+ let cachedLoggers = /* @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
62
+
63
+ export function loggerFor(client: Tabstack): Logger {
64
+ const logger = client.logger;
65
+ const logLevel = client.logLevel ?? 'off';
66
+ if (!logger) {
67
+ return noopLogger;
68
+ }
69
+
70
+ const cachedLogger = cachedLoggers.get(logger);
71
+ if (cachedLogger && cachedLogger[0] === logLevel) {
72
+ return cachedLogger[1];
73
+ }
74
+
75
+ const levelLogger = {
76
+ error: makeLogFn('error', logger, logLevel),
77
+ warn: makeLogFn('warn', logger, logLevel),
78
+ info: makeLogFn('info', logger, logLevel),
79
+ debug: makeLogFn('debug', logger, logLevel),
80
+ };
81
+
82
+ cachedLoggers.set(logger, [logLevel, levelLogger]);
83
+
84
+ return levelLogger;
85
+ }
86
+
87
+ export const formatRequestDetails = (details: {
88
+ options?: RequestOptions | undefined;
89
+ headers?: Headers | Record<string, string> | undefined;
90
+ retryOfRequestLogID?: string | undefined;
91
+ retryOf?: string | undefined;
92
+ url?: string | undefined;
93
+ status?: number | undefined;
94
+ method?: string | undefined;
95
+ durationMs?: number | undefined;
96
+ message?: unknown;
97
+ body?: unknown;
98
+ }) => {
99
+ if (details.options) {
100
+ details.options = { ...details.options };
101
+ delete details.options['headers']; // redundant + leaks internals
102
+ }
103
+ if (details.headers) {
104
+ details.headers = Object.fromEntries(
105
+ (details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
106
+ ([name, value]) => [
107
+ name,
108
+ (
109
+ name.toLowerCase() === 'authorization' ||
110
+ name.toLowerCase() === 'cookie' ||
111
+ name.toLowerCase() === 'set-cookie'
112
+ ) ?
113
+ '***'
114
+ : value,
115
+ ],
116
+ ),
117
+ );
118
+ }
119
+ if ('retryOfRequestLogID' in details) {
120
+ if (details.retryOfRequestLogID) {
121
+ details.retryOf = details.retryOfRequestLogID;
122
+ }
123
+ delete details.retryOfRequestLogID;
124
+ }
125
+ return details;
126
+ };
@@ -0,0 +1,88 @@
1
+ import { TabstackError } from '../../core/error';
2
+
3
+ /**
4
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
5
+ *
6
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
7
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
8
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
9
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
10
+ */
11
+ export function encodeURIPath(str: string) {
12
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
13
+ }
14
+
15
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
16
+
17
+ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
18
+ function path(statics: readonly string[], ...params: readonly unknown[]): string {
19
+ // If there are no params, no processing is needed.
20
+ if (statics.length === 1) return statics[0]!;
21
+
22
+ let postPath = false;
23
+ const invalidSegments = [];
24
+ const path = statics.reduce((previousValue, currentValue, index) => {
25
+ if (/[?#]/.test(currentValue)) {
26
+ postPath = true;
27
+ }
28
+ const value = params[index];
29
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
30
+ if (
31
+ index !== params.length &&
32
+ (value == null ||
33
+ (typeof value === 'object' &&
34
+ // handle values from other realms
35
+ value.toString ===
36
+ Object.getPrototypeOf(Object.getPrototypeOf((value as any).hasOwnProperty ?? EMPTY) ?? EMPTY)
37
+ ?.toString))
38
+ ) {
39
+ encoded = value + '';
40
+ invalidSegments.push({
41
+ start: previousValue.length + currentValue.length,
42
+ length: encoded.length,
43
+ error: `Value of type ${Object.prototype.toString
44
+ .call(value)
45
+ .slice(8, -1)} is not a valid path parameter`,
46
+ });
47
+ }
48
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
49
+ }, '');
50
+
51
+ const pathOnly = path.split(/[?#]/, 1)[0]!;
52
+ const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
53
+ let match;
54
+
55
+ // Find all invalid segments
56
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
57
+ invalidSegments.push({
58
+ start: match.index,
59
+ length: match[0].length,
60
+ error: `Value "${match[0]}" can\'t be safely passed as a path parameter`,
61
+ });
62
+ }
63
+
64
+ invalidSegments.sort((a, b) => a.start - b.start);
65
+
66
+ if (invalidSegments.length > 0) {
67
+ let lastEnd = 0;
68
+ const underline = invalidSegments.reduce((acc, segment) => {
69
+ const spaces = ' '.repeat(segment.start - lastEnd);
70
+ const arrows = '^'.repeat(segment.length);
71
+ lastEnd = segment.start + segment.length;
72
+ return acc + spaces + arrows;
73
+ }, '');
74
+
75
+ throw new TabstackError(
76
+ `Path parameters result in path with invalid segments:\n${invalidSegments
77
+ .map((e) => e.error)
78
+ .join('\n')}\n${path}\n${underline}`,
79
+ );
80
+ }
81
+
82
+ return path;
83
+ };
84
+
85
+ /**
86
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
87
+ */
88
+ export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
@@ -0,0 +1,17 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ /**
4
+ * https://stackoverflow.com/a/2117523
5
+ */
6
+ export let uuid4 = function () {
7
+ const { crypto } = globalThis as any;
8
+ if (crypto?.randomUUID) {
9
+ uuid4 = crypto.randomUUID.bind(crypto);
10
+ return crypto.randomUUID();
11
+ }
12
+ const u8 = new Uint8Array(1);
13
+ const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
14
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
15
+ (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
16
+ );
17
+ };
@@ -0,0 +1,105 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { TabstackError } from '../../core/error';
4
+
5
+ // https://url.spec.whatwg.org/#url-scheme-string
6
+ const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
7
+
8
+ export const isAbsoluteURL = (url: string): boolean => {
9
+ return startsWithSchemeRegexp.test(url);
10
+ };
11
+
12
+ export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
13
+ export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
14
+
15
+ /** Returns an object if the given value isn't an object, otherwise returns as-is */
16
+ export function maybeObj(x: unknown): object {
17
+ if (typeof x !== 'object') {
18
+ return {};
19
+ }
20
+
21
+ return x ?? {};
22
+ }
23
+
24
+ // https://stackoverflow.com/a/34491287
25
+ export function isEmptyObj(obj: Object | null | undefined): boolean {
26
+ if (!obj) return true;
27
+ for (const _k in obj) return false;
28
+ return true;
29
+ }
30
+
31
+ // https://eslint.org/docs/latest/rules/no-prototype-builtins
32
+ export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
33
+ return Object.prototype.hasOwnProperty.call(obj, key);
34
+ }
35
+
36
+ export function isObj(obj: unknown): obj is Record<string, unknown> {
37
+ return obj != null && typeof obj === 'object' && !Array.isArray(obj);
38
+ }
39
+
40
+ export const ensurePresent = <T>(value: T | null | undefined): T => {
41
+ if (value == null) {
42
+ throw new TabstackError(`Expected a value to be given but received ${value} instead.`);
43
+ }
44
+
45
+ return value;
46
+ };
47
+
48
+ export const validatePositiveInteger = (name: string, n: unknown): number => {
49
+ if (typeof n !== 'number' || !Number.isInteger(n)) {
50
+ throw new TabstackError(`${name} must be an integer`);
51
+ }
52
+ if (n < 0) {
53
+ throw new TabstackError(`${name} must be a positive integer`);
54
+ }
55
+ return n;
56
+ };
57
+
58
+ export const coerceInteger = (value: unknown): number => {
59
+ if (typeof value === 'number') return Math.round(value);
60
+ if (typeof value === 'string') return parseInt(value, 10);
61
+
62
+ throw new TabstackError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
63
+ };
64
+
65
+ export const coerceFloat = (value: unknown): number => {
66
+ if (typeof value === 'number') return value;
67
+ if (typeof value === 'string') return parseFloat(value);
68
+
69
+ throw new TabstackError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
70
+ };
71
+
72
+ export const coerceBoolean = (value: unknown): boolean => {
73
+ if (typeof value === 'boolean') return value;
74
+ if (typeof value === 'string') return value === 'true';
75
+ return Boolean(value);
76
+ };
77
+
78
+ export const maybeCoerceInteger = (value: unknown): number | undefined => {
79
+ if (value == null) {
80
+ return undefined;
81
+ }
82
+ return coerceInteger(value);
83
+ };
84
+
85
+ export const maybeCoerceFloat = (value: unknown): number | undefined => {
86
+ if (value == null) {
87
+ return undefined;
88
+ }
89
+ return coerceFloat(value);
90
+ };
91
+
92
+ export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
93
+ if (value == null) {
94
+ return undefined;
95
+ }
96
+ return coerceBoolean(value);
97
+ };
98
+
99
+ export const safeJSON = (text: string) => {
100
+ try {
101
+ return JSON.parse(text);
102
+ } catch (err) {
103
+ return undefined;
104
+ }
105
+ };
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './utils/values';
4
+ export * from './utils/base64';
5
+ export * from './utils/env';
6
+ export * from './utils/log';
7
+ export * from './utils/uuid';
8
+ export * from './utils/sleep';
package/src/lib/.keep ADDED
@@ -0,0 +1,4 @@
1
+ File generated from our OpenAPI spec by Stainless.
2
+
3
+ This directory can be used to store custom files to expand the SDK.
4
+ It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
@@ -0,0 +1,2 @@
1
+ /** @deprecated Import from ./core/resource instead */
2
+ export * from './core/resource';
@@ -0,0 +1,194 @@
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 { Stream } from '../core/streaming';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+
9
+ export class Agent extends APIResource {
10
+ /**
11
+ * Execute AI-powered browser automation tasks using natural language with optional
12
+ * geotargeting. This endpoint **always streams** responses using Server-Sent
13
+ * Events (SSE).
14
+ *
15
+ * **Streaming Response:**
16
+ *
17
+ * - All responses are streamed using Server-Sent Events (`text/event-stream`)
18
+ * - Real-time progress updates and results as they're generated
19
+ *
20
+ * **Geotargeting:**
21
+ *
22
+ * - Optionally specify a country code for geotargeted browsing
23
+ *
24
+ * **Use Cases:**
25
+ *
26
+ * - Web scraping and data extraction
27
+ * - Form filling and interaction
28
+ * - Navigation and information gathering
29
+ * - Multi-step web workflows
30
+ * - Content analysis from web pages
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const automateEvent = await client.agent.automate({
35
+ * task: 'Find the top 3 trending repositories and extract their names, descriptions, and star counts',
36
+ * guardrails:
37
+ * "browse and extract only, don't interact with repositories",
38
+ * url: 'https://github.com/trending',
39
+ * });
40
+ * ```
41
+ */
42
+ automate(body: AgentAutomateParams, options?: RequestOptions): APIPromise<Stream<AutomateEvent>> {
43
+ return this._client.post('/automate', {
44
+ body,
45
+ ...options,
46
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
47
+ stream: true,
48
+ }) as APIPromise<Stream<AutomateEvent>>;
49
+ }
50
+
51
+ /**
52
+ * Execute AI-powered research queries that search the web, analyze sources, and
53
+ * synthesize comprehensive answers. This endpoint **always streams** responses
54
+ * using Server-Sent Events (SSE).
55
+ *
56
+ * **Streaming Response:**
57
+ *
58
+ * - All responses are streamed using Server-Sent Events (`text/event-stream`)
59
+ * - Real-time progress updates as research progresses through phases
60
+ *
61
+ * **Research Modes:**
62
+ *
63
+ * - `fast` - Quick answers with minimal web searches
64
+ * - `balanced` - Standard research with multiple iterations (default)
65
+ *
66
+ * **Use Cases:**
67
+ *
68
+ * - Answering complex questions with cited sources
69
+ * - Synthesizing information from multiple web sources
70
+ * - Research reports on specific topics
71
+ * - Fact-checking and verification tasks
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const researchEvent = await client.agent.research({
76
+ * query:
77
+ * 'What are the latest developments in quantum computing?',
78
+ * });
79
+ * ```
80
+ */
81
+ research(body: AgentResearchParams, options?: RequestOptions): APIPromise<Stream<ResearchEvent>> {
82
+ return this._client.post('/research', {
83
+ body,
84
+ ...options,
85
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
86
+ stream: true,
87
+ }) as APIPromise<Stream<ResearchEvent>>;
88
+ }
89
+ }
90
+
91
+ export interface AutomateEvent {
92
+ /**
93
+ * Event payload data
94
+ */
95
+ data?: unknown;
96
+
97
+ /**
98
+ * The event type (e.g., start, agent:processing, complete)
99
+ */
100
+ event?: string;
101
+ }
102
+
103
+ export interface ResearchEvent {
104
+ /**
105
+ * Event payload data
106
+ */
107
+ data?: unknown;
108
+
109
+ /**
110
+ * The event type: phase, progress, complete, or error
111
+ */
112
+ event?: 'phase' | 'progress' | 'complete' | 'error';
113
+ }
114
+
115
+ export interface AgentAutomateParams {
116
+ /**
117
+ * The task description in natural language
118
+ */
119
+ task: string;
120
+
121
+ /**
122
+ * JSON data to provide context for form filling or complex tasks
123
+ */
124
+ data?: unknown;
125
+
126
+ /**
127
+ * Optional geotargeting parameters for proxy requests
128
+ */
129
+ geo_target?: AgentAutomateParams.GeoTarget;
130
+
131
+ /**
132
+ * Safety constraints for execution
133
+ */
134
+ guardrails?: string;
135
+
136
+ /**
137
+ * Maximum task iterations
138
+ */
139
+ maxIterations?: number;
140
+
141
+ /**
142
+ * Maximum validation attempts
143
+ */
144
+ maxValidationAttempts?: number;
145
+
146
+ /**
147
+ * Starting URL for the task
148
+ */
149
+ url?: string;
150
+ }
151
+
152
+ export namespace AgentAutomateParams {
153
+ /**
154
+ * Optional geotargeting parameters for proxy requests
155
+ */
156
+ export interface GeoTarget {
157
+ /**
158
+ * Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., "US", "GB",
159
+ * "JP"). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
160
+ */
161
+ country?: string;
162
+ }
163
+ }
164
+
165
+ export interface AgentResearchParams {
166
+ /**
167
+ * The research query or question to answer
168
+ */
169
+ query: string;
170
+
171
+ /**
172
+ * Timeout in seconds for fetching web pages
173
+ */
174
+ fetch_timeout?: number;
175
+
176
+ /**
177
+ * Research mode: fast (quick answers), balanced (standard research, default)
178
+ */
179
+ mode?: 'fast' | 'balanced';
180
+
181
+ /**
182
+ * Skip cache and force fresh research
183
+ */
184
+ nocache?: boolean;
185
+ }
186
+
187
+ export declare namespace Agent {
188
+ export {
189
+ type AutomateEvent as AutomateEvent,
190
+ type ResearchEvent as ResearchEvent,
191
+ type AgentAutomateParams as AgentAutomateParams,
192
+ type AgentResearchParams as AgentResearchParams,
193
+ };
194
+ }