@lhremote/core 0.7.0 → 0.9.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 (546) hide show
  1. package/dist/cdp/app-discovery.d.ts +57 -0
  2. package/dist/cdp/app-discovery.d.ts.map +1 -1
  3. package/dist/cdp/app-discovery.js +90 -7
  4. package/dist/cdp/app-discovery.js.map +1 -1
  5. package/dist/cdp/app-discovery.test.js +180 -9
  6. package/dist/cdp/app-discovery.test.js.map +1 -1
  7. package/dist/cdp/client.d.ts +8 -1
  8. package/dist/cdp/client.d.ts.map +1 -1
  9. package/dist/cdp/client.js +8 -1
  10. package/dist/cdp/client.js.map +1 -1
  11. package/dist/cdp/discovery.d.ts.map +1 -1
  12. package/dist/cdp/discovery.js +5 -1
  13. package/dist/cdp/discovery.js.map +1 -1
  14. package/dist/cdp/discovery.test.js +7 -0
  15. package/dist/cdp/discovery.test.js.map +1 -1
  16. package/dist/cdp/index.d.ts +1 -1
  17. package/dist/cdp/index.d.ts.map +1 -1
  18. package/dist/cdp/index.js +1 -1
  19. package/dist/cdp/index.js.map +1 -1
  20. package/dist/cdp/instance-discovery.d.ts.map +1 -1
  21. package/dist/cdp/instance-discovery.js +25 -10
  22. package/dist/cdp/instance-discovery.js.map +1 -1
  23. package/dist/cdp/instance-discovery.test.js +17 -0
  24. package/dist/cdp/instance-discovery.test.js.map +1 -1
  25. package/dist/cdp/testing/launch-chromium.d.ts +1 -1
  26. package/dist/cdp/testing/launch-chromium.js +2 -2
  27. package/dist/db/client.d.ts.map +1 -1
  28. package/dist/db/client.js +3 -0
  29. package/dist/db/client.js.map +1 -1
  30. package/dist/db/index.d.ts +1 -1
  31. package/dist/db/index.d.ts.map +1 -1
  32. package/dist/db/index.js +1 -1
  33. package/dist/db/index.js.map +1 -1
  34. package/dist/db/repositories/action-budget.d.ts +29 -0
  35. package/dist/db/repositories/action-budget.d.ts.map +1 -0
  36. package/dist/db/repositories/action-budget.js +100 -0
  37. package/dist/db/repositories/action-budget.js.map +1 -0
  38. package/dist/db/repositories/action-budget.test.d.ts +2 -0
  39. package/dist/db/repositories/action-budget.test.d.ts.map +1 -0
  40. package/dist/db/repositories/action-budget.test.js +181 -0
  41. package/dist/db/repositories/action-budget.test.js.map +1 -0
  42. package/dist/db/repositories/campaign-hard-delete.integration.test.d.ts +2 -0
  43. package/dist/db/repositories/campaign-hard-delete.integration.test.d.ts.map +1 -0
  44. package/dist/db/repositories/campaign-hard-delete.integration.test.js +78 -0
  45. package/dist/db/repositories/campaign-hard-delete.integration.test.js.map +1 -0
  46. package/dist/db/repositories/campaign.d.ts +14 -0
  47. package/dist/db/repositories/campaign.d.ts.map +1 -1
  48. package/dist/db/repositories/campaign.js +125 -0
  49. package/dist/db/repositories/campaign.js.map +1 -1
  50. package/dist/db/repositories/collection-list.integration.test.js +6 -4
  51. package/dist/db/repositories/collection-list.integration.test.js.map +1 -1
  52. package/dist/db/repositories/index.d.ts +1 -0
  53. package/dist/db/repositories/index.d.ts.map +1 -1
  54. package/dist/db/repositories/index.js +1 -0
  55. package/dist/db/repositories/index.js.map +1 -1
  56. package/dist/index.d.ts +7 -6
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +27 -7
  59. package/dist/index.js.map +1 -1
  60. package/dist/linkedin/__tests__/dom-automation.integration.test.d.ts +2 -0
  61. package/dist/linkedin/__tests__/dom-automation.integration.test.d.ts.map +1 -0
  62. package/dist/linkedin/__tests__/dom-automation.integration.test.js +160 -0
  63. package/dist/linkedin/__tests__/dom-automation.integration.test.js.map +1 -0
  64. package/dist/linkedin/dom-automation-retry.test.d.ts +2 -0
  65. package/dist/linkedin/dom-automation-retry.test.d.ts.map +1 -0
  66. package/dist/linkedin/dom-automation-retry.test.js +51 -0
  67. package/dist/linkedin/dom-automation-retry.test.js.map +1 -0
  68. package/dist/linkedin/dom-automation.d.ts +224 -0
  69. package/dist/linkedin/dom-automation.d.ts.map +1 -0
  70. package/dist/linkedin/dom-automation.js +614 -0
  71. package/dist/linkedin/dom-automation.js.map +1 -0
  72. package/dist/linkedin/humanized-mouse.d.ts +69 -0
  73. package/dist/linkedin/humanized-mouse.d.ts.map +1 -0
  74. package/dist/linkedin/humanized-mouse.js +109 -0
  75. package/dist/linkedin/humanized-mouse.js.map +1 -0
  76. package/dist/linkedin/index.d.ts +4 -0
  77. package/dist/linkedin/index.d.ts.map +1 -0
  78. package/dist/linkedin/index.js +6 -0
  79. package/dist/linkedin/index.js.map +1 -0
  80. package/dist/linkedin/selectors.d.ts +67 -0
  81. package/dist/linkedin/selectors.d.ts.map +1 -0
  82. package/dist/linkedin/selectors.js +74 -0
  83. package/dist/linkedin/selectors.js.map +1 -0
  84. package/dist/operations/add-people-to-collection.d.ts +1 -1
  85. package/dist/operations/add-people-to-collection.d.ts.map +1 -1
  86. package/dist/operations/add-people-to-collection.js +3 -6
  87. package/dist/operations/add-people-to-collection.js.map +1 -1
  88. package/dist/operations/build-linkedin-url.test.d.ts +2 -0
  89. package/dist/operations/build-linkedin-url.test.d.ts.map +1 -0
  90. package/dist/operations/build-linkedin-url.test.js +158 -0
  91. package/dist/operations/build-linkedin-url.test.js.map +1 -0
  92. package/dist/operations/campaign-add-action.d.ts +1 -1
  93. package/dist/operations/campaign-add-action.d.ts.map +1 -1
  94. package/dist/operations/campaign-add-action.js +3 -6
  95. package/dist/operations/campaign-add-action.js.map +1 -1
  96. package/dist/operations/campaign-create.d.ts +1 -1
  97. package/dist/operations/campaign-create.d.ts.map +1 -1
  98. package/dist/operations/campaign-create.js +3 -6
  99. package/dist/operations/campaign-create.js.map +1 -1
  100. package/dist/operations/campaign-delete.d.ts +7 -3
  101. package/dist/operations/campaign-delete.d.ts.map +1 -1
  102. package/dist/operations/campaign-delete.js +12 -8
  103. package/dist/operations/campaign-delete.js.map +1 -1
  104. package/dist/operations/campaign-delete.test.js +41 -1
  105. package/dist/operations/campaign-delete.test.js.map +1 -1
  106. package/dist/operations/campaign-erase.d.ts +19 -0
  107. package/dist/operations/campaign-erase.d.ts.map +1 -0
  108. package/dist/operations/campaign-erase.js +19 -0
  109. package/dist/operations/campaign-erase.js.map +1 -0
  110. package/dist/operations/campaign-erase.test.d.ts +2 -0
  111. package/dist/operations/campaign-erase.test.d.ts.map +1 -0
  112. package/dist/operations/campaign-erase.test.js +101 -0
  113. package/dist/operations/campaign-erase.test.js.map +1 -0
  114. package/dist/operations/campaign-exclude-add.d.ts +1 -1
  115. package/dist/operations/campaign-exclude-add.d.ts.map +1 -1
  116. package/dist/operations/campaign-exclude-add.js +3 -6
  117. package/dist/operations/campaign-exclude-add.js.map +1 -1
  118. package/dist/operations/campaign-exclude-list.d.ts +1 -1
  119. package/dist/operations/campaign-exclude-list.d.ts.map +1 -1
  120. package/dist/operations/campaign-exclude-list.js +3 -6
  121. package/dist/operations/campaign-exclude-list.js.map +1 -1
  122. package/dist/operations/campaign-exclude-remove.d.ts +1 -1
  123. package/dist/operations/campaign-exclude-remove.d.ts.map +1 -1
  124. package/dist/operations/campaign-exclude-remove.js +3 -6
  125. package/dist/operations/campaign-exclude-remove.js.map +1 -1
  126. package/dist/operations/campaign-export.d.ts +1 -1
  127. package/dist/operations/campaign-export.d.ts.map +1 -1
  128. package/dist/operations/campaign-export.js +3 -6
  129. package/dist/operations/campaign-export.js.map +1 -1
  130. package/dist/operations/campaign-get.d.ts +1 -1
  131. package/dist/operations/campaign-get.d.ts.map +1 -1
  132. package/dist/operations/campaign-get.js +3 -6
  133. package/dist/operations/campaign-get.js.map +1 -1
  134. package/dist/operations/campaign-list-people.d.ts +1 -1
  135. package/dist/operations/campaign-list-people.d.ts.map +1 -1
  136. package/dist/operations/campaign-list-people.js +3 -6
  137. package/dist/operations/campaign-list-people.js.map +1 -1
  138. package/dist/operations/campaign-list.d.ts +1 -1
  139. package/dist/operations/campaign-list.d.ts.map +1 -1
  140. package/dist/operations/campaign-list.js +3 -6
  141. package/dist/operations/campaign-list.js.map +1 -1
  142. package/dist/operations/campaign-move-next.d.ts +1 -1
  143. package/dist/operations/campaign-move-next.d.ts.map +1 -1
  144. package/dist/operations/campaign-move-next.js +3 -6
  145. package/dist/operations/campaign-move-next.js.map +1 -1
  146. package/dist/operations/campaign-remove-action.d.ts +1 -1
  147. package/dist/operations/campaign-remove-action.d.ts.map +1 -1
  148. package/dist/operations/campaign-remove-action.js +3 -6
  149. package/dist/operations/campaign-remove-action.js.map +1 -1
  150. package/dist/operations/campaign-remove-people.d.ts +1 -1
  151. package/dist/operations/campaign-remove-people.d.ts.map +1 -1
  152. package/dist/operations/campaign-remove-people.js +3 -6
  153. package/dist/operations/campaign-remove-people.js.map +1 -1
  154. package/dist/operations/campaign-reorder-actions.d.ts +1 -1
  155. package/dist/operations/campaign-reorder-actions.d.ts.map +1 -1
  156. package/dist/operations/campaign-reorder-actions.js +3 -6
  157. package/dist/operations/campaign-reorder-actions.js.map +1 -1
  158. package/dist/operations/campaign-retry.d.ts +1 -1
  159. package/dist/operations/campaign-retry.d.ts.map +1 -1
  160. package/dist/operations/campaign-retry.js +3 -6
  161. package/dist/operations/campaign-retry.js.map +1 -1
  162. package/dist/operations/campaign-start.d.ts +1 -1
  163. package/dist/operations/campaign-start.d.ts.map +1 -1
  164. package/dist/operations/campaign-start.js +3 -6
  165. package/dist/operations/campaign-start.js.map +1 -1
  166. package/dist/operations/campaign-statistics.d.ts +1 -1
  167. package/dist/operations/campaign-statistics.d.ts.map +1 -1
  168. package/dist/operations/campaign-statistics.js +3 -6
  169. package/dist/operations/campaign-statistics.js.map +1 -1
  170. package/dist/operations/campaign-status.d.ts +1 -1
  171. package/dist/operations/campaign-status.d.ts.map +1 -1
  172. package/dist/operations/campaign-status.js +3 -6
  173. package/dist/operations/campaign-status.js.map +1 -1
  174. package/dist/operations/campaign-stop.d.ts +1 -1
  175. package/dist/operations/campaign-stop.d.ts.map +1 -1
  176. package/dist/operations/campaign-stop.js +3 -6
  177. package/dist/operations/campaign-stop.js.map +1 -1
  178. package/dist/operations/campaign-update-action.d.ts +1 -1
  179. package/dist/operations/campaign-update-action.d.ts.map +1 -1
  180. package/dist/operations/campaign-update-action.js +3 -6
  181. package/dist/operations/campaign-update-action.js.map +1 -1
  182. package/dist/operations/campaign-update.d.ts +1 -1
  183. package/dist/operations/campaign-update.d.ts.map +1 -1
  184. package/dist/operations/campaign-update.js +3 -6
  185. package/dist/operations/campaign-update.js.map +1 -1
  186. package/dist/operations/check-replies.d.ts +3 -1
  187. package/dist/operations/check-replies.d.ts.map +1 -1
  188. package/dist/operations/check-replies.js +132 -17
  189. package/dist/operations/check-replies.js.map +1 -1
  190. package/dist/operations/check-replies.test.js +177 -17
  191. package/dist/operations/check-replies.test.js.map +1 -1
  192. package/dist/operations/collect-people.d.ts +1 -1
  193. package/dist/operations/collect-people.d.ts.map +1 -1
  194. package/dist/operations/collect-people.js +3 -6
  195. package/dist/operations/collect-people.js.map +1 -1
  196. package/dist/operations/comment-on-post.d.ts +37 -0
  197. package/dist/operations/comment-on-post.d.ts.map +1 -0
  198. package/dist/operations/comment-on-post.js +104 -0
  199. package/dist/operations/comment-on-post.js.map +1 -0
  200. package/dist/operations/comment-on-post.test.d.ts +2 -0
  201. package/dist/operations/comment-on-post.test.d.ts.map +1 -0
  202. package/dist/operations/comment-on-post.test.js +242 -0
  203. package/dist/operations/comment-on-post.test.js.map +1 -0
  204. package/dist/operations/create-collection.d.ts +1 -1
  205. package/dist/operations/create-collection.d.ts.map +1 -1
  206. package/dist/operations/create-collection.js +3 -6
  207. package/dist/operations/create-collection.js.map +1 -1
  208. package/dist/operations/delete-collection.d.ts +1 -1
  209. package/dist/operations/delete-collection.d.ts.map +1 -1
  210. package/dist/operations/delete-collection.js +3 -6
  211. package/dist/operations/delete-collection.js.map +1 -1
  212. package/dist/operations/dismiss-errors.d.ts +25 -0
  213. package/dist/operations/dismiss-errors.d.ts.map +1 -0
  214. package/dist/operations/dismiss-errors.js +74 -0
  215. package/dist/operations/dismiss-errors.js.map +1 -0
  216. package/dist/operations/dismiss-errors.test.d.ts +2 -0
  217. package/dist/operations/dismiss-errors.test.d.ts.map +1 -0
  218. package/dist/operations/dismiss-errors.test.js +183 -0
  219. package/dist/operations/dismiss-errors.test.js.map +1 -0
  220. package/dist/operations/endorse-skills.d.ts +10 -0
  221. package/dist/operations/endorse-skills.d.ts.map +1 -0
  222. package/dist/operations/endorse-skills.js +12 -0
  223. package/dist/operations/endorse-skills.js.map +1 -0
  224. package/dist/operations/endorse-skills.test.d.ts +2 -0
  225. package/dist/operations/endorse-skills.test.d.ts.map +1 -0
  226. package/dist/operations/endorse-skills.test.js +70 -0
  227. package/dist/operations/endorse-skills.test.js.map +1 -0
  228. package/dist/operations/enrich-profile.d.ts +18 -0
  229. package/dist/operations/enrich-profile.d.ts.map +1 -0
  230. package/dist/operations/enrich-profile.js +15 -0
  231. package/dist/operations/enrich-profile.js.map +1 -0
  232. package/dist/operations/enrich-profile.test.d.ts +2 -0
  233. package/dist/operations/enrich-profile.test.d.ts.map +1 -0
  234. package/dist/operations/enrich-profile.test.js +73 -0
  235. package/dist/operations/enrich-profile.test.js.map +1 -0
  236. package/dist/operations/ephemeral-action.d.ts +22 -0
  237. package/dist/operations/ephemeral-action.d.ts.map +1 -0
  238. package/dist/operations/ephemeral-action.js +28 -0
  239. package/dist/operations/ephemeral-action.js.map +1 -0
  240. package/dist/operations/ephemeral-action.test.d.ts +2 -0
  241. package/dist/operations/ephemeral-action.test.d.ts.map +1 -0
  242. package/dist/operations/ephemeral-action.test.js +140 -0
  243. package/dist/operations/ephemeral-action.test.js.map +1 -0
  244. package/dist/operations/follow-person.d.ts +9 -0
  245. package/dist/operations/follow-person.d.ts.map +1 -0
  246. package/dist/operations/follow-person.js +11 -0
  247. package/dist/operations/follow-person.js.map +1 -0
  248. package/dist/operations/follow-person.test.d.ts +2 -0
  249. package/dist/operations/follow-person.test.d.ts.map +1 -0
  250. package/dist/operations/follow-person.test.js +57 -0
  251. package/dist/operations/follow-person.test.js.map +1 -0
  252. package/dist/operations/get-action-budget.d.ts +6 -0
  253. package/dist/operations/get-action-budget.d.ts.map +1 -0
  254. package/dist/operations/get-action-budget.js +19 -0
  255. package/dist/operations/get-action-budget.js.map +1 -0
  256. package/dist/operations/get-action-budget.test.d.ts +2 -0
  257. package/dist/operations/get-action-budget.test.d.ts.map +1 -0
  258. package/dist/operations/get-action-budget.test.js +79 -0
  259. package/dist/operations/get-action-budget.test.js.map +1 -0
  260. package/dist/operations/get-errors.d.ts +14 -4
  261. package/dist/operations/get-errors.d.ts.map +1 -1
  262. package/dist/operations/get-errors.js +72 -13
  263. package/dist/operations/get-errors.js.map +1 -1
  264. package/dist/operations/get-errors.test.js +108 -43
  265. package/dist/operations/get-errors.test.js.map +1 -1
  266. package/dist/operations/get-feed.d.ts +112 -0
  267. package/dist/operations/get-feed.d.ts.map +1 -0
  268. package/dist/operations/get-feed.js +467 -0
  269. package/dist/operations/get-feed.js.map +1 -0
  270. package/dist/operations/get-feed.test.d.ts +2 -0
  271. package/dist/operations/get-feed.test.d.ts.map +1 -0
  272. package/dist/operations/get-feed.test.js +502 -0
  273. package/dist/operations/get-feed.test.js.map +1 -0
  274. package/dist/operations/get-post-engagers.d.ts +43 -0
  275. package/dist/operations/get-post-engagers.d.ts.map +1 -0
  276. package/dist/operations/get-post-engagers.js +328 -0
  277. package/dist/operations/get-post-engagers.js.map +1 -0
  278. package/dist/operations/get-post-engagers.test.d.ts +2 -0
  279. package/dist/operations/get-post-engagers.test.d.ts.map +1 -0
  280. package/dist/operations/get-post-engagers.test.js +297 -0
  281. package/dist/operations/get-post-engagers.test.js.map +1 -0
  282. package/dist/operations/get-post-stats.d.ts +43 -0
  283. package/dist/operations/get-post-stats.d.ts.map +1 -0
  284. package/dist/operations/get-post-stats.js +164 -0
  285. package/dist/operations/get-post-stats.js.map +1 -0
  286. package/dist/operations/get-post-stats.test.d.ts +2 -0
  287. package/dist/operations/get-post-stats.test.d.ts.map +1 -0
  288. package/dist/operations/get-post-stats.test.js +169 -0
  289. package/dist/operations/get-post-stats.test.js.map +1 -0
  290. package/dist/operations/get-post.d.ts +42 -0
  291. package/dist/operations/get-post.d.ts.map +1 -0
  292. package/dist/operations/get-post.js +416 -0
  293. package/dist/operations/get-post.js.map +1 -0
  294. package/dist/operations/get-post.test.d.ts +2 -0
  295. package/dist/operations/get-post.test.d.ts.map +1 -0
  296. package/dist/operations/get-post.test.js +272 -0
  297. package/dist/operations/get-post.test.js.map +1 -0
  298. package/dist/operations/get-profile-activity.d.ts +50 -0
  299. package/dist/operations/get-profile-activity.d.ts.map +1 -0
  300. package/dist/operations/get-profile-activity.js +381 -0
  301. package/dist/operations/get-profile-activity.js.map +1 -0
  302. package/dist/operations/get-profile-activity.test.d.ts +2 -0
  303. package/dist/operations/get-profile-activity.test.d.ts.map +1 -0
  304. package/dist/operations/get-profile-activity.test.js +324 -0
  305. package/dist/operations/get-profile-activity.test.js.map +1 -0
  306. package/dist/operations/get-throttle-status.d.ts +6 -0
  307. package/dist/operations/get-throttle-status.d.ts.map +1 -0
  308. package/dist/operations/get-throttle-status.js +24 -0
  309. package/dist/operations/get-throttle-status.js.map +1 -0
  310. package/dist/operations/get-throttle-status.test.d.ts +2 -0
  311. package/dist/operations/get-throttle-status.test.d.ts.map +1 -0
  312. package/dist/operations/get-throttle-status.test.js +62 -0
  313. package/dist/operations/get-throttle-status.test.js.map +1 -0
  314. package/dist/operations/import-people-from-collection.d.ts +1 -1
  315. package/dist/operations/import-people-from-collection.d.ts.map +1 -1
  316. package/dist/operations/import-people-from-collection.js +3 -6
  317. package/dist/operations/import-people-from-collection.js.map +1 -1
  318. package/dist/operations/import-people-from-urls.d.ts +1 -1
  319. package/dist/operations/import-people-from-urls.d.ts.map +1 -1
  320. package/dist/operations/import-people-from-urls.js +3 -6
  321. package/dist/operations/import-people-from-urls.js.map +1 -1
  322. package/dist/operations/index.d.ts +23 -1
  323. package/dist/operations/index.d.ts.map +1 -1
  324. package/dist/operations/index.js +33 -0
  325. package/dist/operations/index.js.map +1 -1
  326. package/dist/operations/like-person-posts.d.ts +14 -0
  327. package/dist/operations/like-person-posts.d.ts.map +1 -0
  328. package/dist/operations/like-person-posts.js +28 -0
  329. package/dist/operations/like-person-posts.js.map +1 -0
  330. package/dist/operations/like-person-posts.test.d.ts +2 -0
  331. package/dist/operations/like-person-posts.test.d.ts.map +1 -0
  332. package/dist/operations/like-person-posts.test.js +103 -0
  333. package/dist/operations/like-person-posts.test.js.map +1 -0
  334. package/dist/operations/list-collections.d.ts +1 -1
  335. package/dist/operations/list-collections.d.ts.map +1 -1
  336. package/dist/operations/list-collections.js +3 -6
  337. package/dist/operations/list-collections.js.map +1 -1
  338. package/dist/operations/message-person.d.ts +11 -0
  339. package/dist/operations/message-person.d.ts.map +1 -0
  340. package/dist/operations/message-person.js +19 -0
  341. package/dist/operations/message-person.js.map +1 -0
  342. package/dist/operations/message-person.test.d.ts +2 -0
  343. package/dist/operations/message-person.test.d.ts.map +1 -0
  344. package/dist/operations/message-person.test.js +108 -0
  345. package/dist/operations/message-person.test.js.map +1 -0
  346. package/dist/operations/navigate-away.d.ts +14 -0
  347. package/dist/operations/navigate-away.d.ts.map +1 -0
  348. package/dist/operations/navigate-away.js +24 -0
  349. package/dist/operations/navigate-away.js.map +1 -0
  350. package/dist/operations/navigate-away.test.d.ts +2 -0
  351. package/dist/operations/navigate-away.test.d.ts.map +1 -0
  352. package/dist/operations/navigate-away.test.js +51 -0
  353. package/dist/operations/navigate-away.test.js.map +1 -0
  354. package/dist/operations/query-messages.d.ts +1 -1
  355. package/dist/operations/query-messages.d.ts.map +1 -1
  356. package/dist/operations/query-messages.js +3 -6
  357. package/dist/operations/query-messages.js.map +1 -1
  358. package/dist/operations/react-to-post.d.ts +41 -0
  359. package/dist/operations/react-to-post.d.ts.map +1 -0
  360. package/dist/operations/react-to-post.js +80 -0
  361. package/dist/operations/react-to-post.js.map +1 -0
  362. package/dist/operations/react-to-post.test.d.ts +2 -0
  363. package/dist/operations/react-to-post.test.d.ts.map +1 -0
  364. package/dist/operations/react-to-post.test.js +157 -0
  365. package/dist/operations/react-to-post.test.js.map +1 -0
  366. package/dist/operations/remove-connection.d.ts +6 -0
  367. package/dist/operations/remove-connection.d.ts.map +1 -0
  368. package/dist/operations/remove-connection.js +7 -0
  369. package/dist/operations/remove-connection.js.map +1 -0
  370. package/dist/operations/remove-connection.test.d.ts +2 -0
  371. package/dist/operations/remove-connection.test.d.ts.map +1 -0
  372. package/dist/operations/remove-connection.test.js +45 -0
  373. package/dist/operations/remove-connection.test.js.map +1 -0
  374. package/dist/operations/remove-people-from-collection.d.ts +1 -1
  375. package/dist/operations/remove-people-from-collection.d.ts.map +1 -1
  376. package/dist/operations/remove-people-from-collection.js +3 -6
  377. package/dist/operations/remove-people-from-collection.js.map +1 -1
  378. package/dist/operations/resolve-linkedin-entity.d.ts.map +1 -1
  379. package/dist/operations/resolve-linkedin-entity.js +2 -2
  380. package/dist/operations/resolve-linkedin-entity.js.map +1 -1
  381. package/dist/operations/resolve-linkedin-entity.test.d.ts +2 -0
  382. package/dist/operations/resolve-linkedin-entity.test.d.ts.map +1 -0
  383. package/dist/operations/resolve-linkedin-entity.test.js +343 -0
  384. package/dist/operations/resolve-linkedin-entity.test.js.map +1 -0
  385. package/dist/operations/scrape-messaging-history.d.ts +2 -1
  386. package/dist/operations/scrape-messaging-history.d.ts.map +1 -1
  387. package/dist/operations/scrape-messaging-history.js +121 -18
  388. package/dist/operations/scrape-messaging-history.js.map +1 -1
  389. package/dist/operations/scrape-messaging-history.test.js +134 -12
  390. package/dist/operations/scrape-messaging-history.test.js.map +1 -1
  391. package/dist/operations/search-posts.d.ts +51 -0
  392. package/dist/operations/search-posts.d.ts.map +1 -0
  393. package/dist/operations/search-posts.js +419 -0
  394. package/dist/operations/search-posts.js.map +1 -0
  395. package/dist/operations/search-posts.test.d.ts +2 -0
  396. package/dist/operations/search-posts.test.d.ts.map +1 -0
  397. package/dist/operations/search-posts.test.js +300 -0
  398. package/dist/operations/search-posts.test.js.map +1 -0
  399. package/dist/operations/send-inmail.d.ts +11 -0
  400. package/dist/operations/send-inmail.d.ts.map +1 -0
  401. package/dist/operations/send-inmail.js +19 -0
  402. package/dist/operations/send-inmail.js.map +1 -0
  403. package/dist/operations/send-inmail.test.d.ts +2 -0
  404. package/dist/operations/send-inmail.test.d.ts.map +1 -0
  405. package/dist/operations/send-inmail.test.js +108 -0
  406. package/dist/operations/send-inmail.test.js.map +1 -0
  407. package/dist/operations/send-invite.d.ts +9 -0
  408. package/dist/operations/send-invite.d.ts.map +1 -0
  409. package/dist/operations/send-invite.js +14 -0
  410. package/dist/operations/send-invite.js.map +1 -0
  411. package/dist/operations/send-invite.test.d.ts +2 -0
  412. package/dist/operations/send-invite.test.d.ts.map +1 -0
  413. package/dist/operations/send-invite.test.js +59 -0
  414. package/dist/operations/send-invite.test.js.map +1 -0
  415. package/dist/operations/types.d.ts +24 -1
  416. package/dist/operations/types.d.ts.map +1 -1
  417. package/dist/operations/types.js +13 -1
  418. package/dist/operations/types.js.map +1 -1
  419. package/dist/operations/visit-profile.d.ts +14 -0
  420. package/dist/operations/visit-profile.d.ts.map +1 -0
  421. package/dist/operations/visit-profile.js +46 -0
  422. package/dist/operations/visit-profile.js.map +1 -0
  423. package/dist/operations/visit-profile.test.d.ts +2 -0
  424. package/dist/operations/visit-profile.test.d.ts.map +1 -0
  425. package/dist/operations/visit-profile.test.js +193 -0
  426. package/dist/operations/visit-profile.test.js.map +1 -0
  427. package/dist/services/account-resolution.d.ts +9 -4
  428. package/dist/services/account-resolution.d.ts.map +1 -1
  429. package/dist/services/account-resolution.js +60 -5
  430. package/dist/services/account-resolution.js.map +1 -1
  431. package/dist/services/app.d.ts +6 -2
  432. package/dist/services/app.d.ts.map +1 -1
  433. package/dist/services/app.js +18 -6
  434. package/dist/services/app.js.map +1 -1
  435. package/dist/services/app.test.js +41 -7
  436. package/dist/services/app.test.js.map +1 -1
  437. package/dist/services/campaign.d.ts +44 -2
  438. package/dist/services/campaign.d.ts.map +1 -1
  439. package/dist/services/campaign.js +124 -1
  440. package/dist/services/campaign.js.map +1 -1
  441. package/dist/services/collection.d.ts +5 -2
  442. package/dist/services/collection.d.ts.map +1 -1
  443. package/dist/services/collection.js +24 -5
  444. package/dist/services/collection.js.map +1 -1
  445. package/dist/services/collection.test.js +51 -9
  446. package/dist/services/collection.test.js.map +1 -1
  447. package/dist/services/ephemeral-campaign.d.ts +64 -0
  448. package/dist/services/ephemeral-campaign.d.ts.map +1 -0
  449. package/dist/services/ephemeral-campaign.js +210 -0
  450. package/dist/services/ephemeral-campaign.js.map +1 -0
  451. package/dist/services/ephemeral-campaign.test.d.ts +2 -0
  452. package/dist/services/ephemeral-campaign.test.d.ts.map +1 -0
  453. package/dist/services/ephemeral-campaign.test.js +333 -0
  454. package/dist/services/ephemeral-campaign.test.js.map +1 -0
  455. package/dist/services/errors.d.ts +12 -1
  456. package/dist/services/errors.d.ts.map +1 -1
  457. package/dist/services/errors.js +26 -3
  458. package/dist/services/errors.js.map +1 -1
  459. package/dist/services/index.d.ts +2 -1
  460. package/dist/services/index.d.ts.map +1 -1
  461. package/dist/services/index.js +2 -1
  462. package/dist/services/index.js.map +1 -1
  463. package/dist/services/instance-context.d.ts +5 -1
  464. package/dist/services/instance-context.d.ts.map +1 -1
  465. package/dist/services/instance-context.js +87 -20
  466. package/dist/services/instance-context.js.map +1 -1
  467. package/dist/services/instance-context.test.js +82 -2
  468. package/dist/services/instance-context.test.js.map +1 -1
  469. package/dist/services/instance-lifecycle.d.ts.map +1 -1
  470. package/dist/services/instance-lifecycle.js +32 -1
  471. package/dist/services/instance-lifecycle.js.map +1 -1
  472. package/dist/services/instance-lifecycle.test.js +52 -1
  473. package/dist/services/instance-lifecycle.test.js.map +1 -1
  474. package/dist/services/instance.d.ts +43 -0
  475. package/dist/services/instance.d.ts.map +1 -1
  476. package/dist/services/instance.js +163 -1
  477. package/dist/services/instance.js.map +1 -1
  478. package/dist/services/instance.test.js +135 -0
  479. package/dist/services/instance.test.js.map +1 -1
  480. package/dist/services/launcher.d.ts +54 -3
  481. package/dist/services/launcher.d.ts.map +1 -1
  482. package/dist/services/launcher.js +223 -34
  483. package/dist/services/launcher.js.map +1 -1
  484. package/dist/services/launcher.test.js +133 -6
  485. package/dist/services/launcher.test.js.map +1 -1
  486. package/dist/services/status.d.ts +6 -2
  487. package/dist/services/status.d.ts.map +1 -1
  488. package/dist/services/status.js +67 -34
  489. package/dist/services/status.js.map +1 -1
  490. package/dist/services/status.test.js +9 -2
  491. package/dist/services/status.test.js.map +1 -1
  492. package/dist/testing/e2e-helpers.d.ts +23 -1
  493. package/dist/testing/e2e-helpers.d.ts.map +1 -1
  494. package/dist/testing/e2e-helpers.js +110 -5
  495. package/dist/testing/e2e-helpers.js.map +1 -1
  496. package/dist/testing/index.d.ts +1 -1
  497. package/dist/testing/index.d.ts.map +1 -1
  498. package/dist/testing/index.js +1 -1
  499. package/dist/testing/index.js.map +1 -1
  500. package/dist/types/account.d.ts +1 -1
  501. package/dist/types/action-budget.d.ts +52 -0
  502. package/dist/types/action-budget.d.ts.map +1 -0
  503. package/dist/types/action-budget.js +4 -0
  504. package/dist/types/action-budget.js.map +1 -0
  505. package/dist/types/campaign.d.ts +24 -0
  506. package/dist/types/campaign.d.ts.map +1 -1
  507. package/dist/types/feed.d.ts +30 -0
  508. package/dist/types/feed.d.ts.map +1 -0
  509. package/dist/types/feed.js +4 -0
  510. package/dist/types/feed.js.map +1 -0
  511. package/dist/types/index.d.ts +6 -2
  512. package/dist/types/index.d.ts.map +1 -1
  513. package/dist/types/post-analytics.d.ts +40 -0
  514. package/dist/types/post-analytics.d.ts.map +1 -0
  515. package/dist/types/post-analytics.js +4 -0
  516. package/dist/types/post-analytics.js.map +1 -0
  517. package/dist/types/post.d.ts +43 -0
  518. package/dist/types/post.d.ts.map +1 -0
  519. package/dist/types/post.js +4 -0
  520. package/dist/types/post.js.map +1 -0
  521. package/dist/types/ui-health.d.ts +16 -0
  522. package/dist/types/ui-health.d.ts.map +1 -1
  523. package/dist/utils/cdp-port.d.ts.map +1 -1
  524. package/dist/utils/cdp-port.js +3 -1
  525. package/dist/utils/cdp-port.js.map +1 -1
  526. package/dist/utils/cdp-port.test.js +1 -1
  527. package/dist/utils/cdp-port.test.js.map +1 -1
  528. package/dist/utils/delay.d.ts +79 -0
  529. package/dist/utils/delay.d.ts.map +1 -1
  530. package/dist/utils/delay.js +118 -0
  531. package/dist/utils/delay.js.map +1 -1
  532. package/dist/utils/delay.test.js +111 -1
  533. package/dist/utils/delay.test.js.map +1 -1
  534. package/dist/utils/index.d.ts +2 -1
  535. package/dist/utils/index.d.ts.map +1 -1
  536. package/dist/utils/index.js +2 -1
  537. package/dist/utils/index.js.map +1 -1
  538. package/dist/utils/session-pacer.d.ts +27 -0
  539. package/dist/utils/session-pacer.d.ts.map +1 -0
  540. package/dist/utils/session-pacer.js +55 -0
  541. package/dist/utils/session-pacer.js.map +1 -0
  542. package/dist/utils/session-pacer.test.d.ts +2 -0
  543. package/dist/utils/session-pacer.test.d.ts.map +1 -0
  544. package/dist/utils/session-pacer.test.js +111 -0
  545. package/dist/utils/session-pacer.test.js.map +1 -0
  546. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  export { isCdpPort } from "./cdp-port.js";
2
- export { delay } from "./delay.js";
2
+ export { delay, randomDelay, gaussianRandom, gaussianDelay, gaussianBetween, maybeBreak, simulateReadingTime } from "./delay.js";
3
3
  export { errorMessage } from "./error-message.js";
4
4
  export { isLoopbackAddress } from "./loopback.js";
5
+ export { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-only
2
2
  // Copyright (C) 2026 Oleksii PELYKH
3
3
  export { isCdpPort } from "./cdp-port.js";
4
- export { delay } from "./delay.js";
4
+ export { delay, randomDelay, gaussianRandom, gaussianDelay, gaussianBetween, maybeBreak, simulateReadingTime } from "./delay.js";
5
5
  export { errorMessage } from "./error-message.js";
6
6
  export { isLoopbackAddress } from "./loopback.js";
7
+ export { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Compute the session rhythm multiplier based on operation count.
3
+ *
4
+ * Models the natural pacing of a human browsing session:
5
+ * - **Warm-up (ops 0–2):** 1.5× — slower, exploring, getting oriented
6
+ * - **Cruising (ops 3–8):** 0.85× — in the flow, comfortable pace
7
+ * - **Fatigue (ops 9+):** 1.0 + 0.05 × (n − 8) — gradually slowing down
8
+ */
9
+ export declare function rhythmMultiplier(operationCount: number): number;
10
+ /**
11
+ * Session-level pacer that tracks inter-operation timing and enforces
12
+ * minimum gaps between operations to prevent rapid-fire automation patterns.
13
+ *
14
+ * Each operation should call {@link paceBeforeOperation} before starting
15
+ * and {@link recordOperationEnd} after completing. The pacer applies a
16
+ * Gaussian-distributed cool-down scaled by a session rhythm multiplier
17
+ * that models warm-up, cruising, and fatigue phases.
18
+ */
19
+ export declare class SessionPacer {
20
+ private lastOperationEnd;
21
+ private operationCount;
22
+ /** Call before starting an operation. Resolves after the appropriate cool-down. */
23
+ paceBeforeOperation(operationType: "read" | "write"): Promise<void>;
24
+ /** Call after an operation completes to record its end timestamp. */
25
+ recordOperationEnd(): void;
26
+ }
27
+ //# sourceMappingURL=session-pacer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-pacer.d.ts","sourceRoot":"","sources":["../../src/utils/session-pacer.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,cAAc,CAAK;IAE3B,oFAAoF;IAC9E,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzE,qEAAqE;IACrE,kBAAkB,IAAI,IAAI;CAI3B"}
@@ -0,0 +1,55 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { delay, gaussianBetween } from "./delay.js";
4
+ /**
5
+ * Compute the session rhythm multiplier based on operation count.
6
+ *
7
+ * Models the natural pacing of a human browsing session:
8
+ * - **Warm-up (ops 0–2):** 1.5× — slower, exploring, getting oriented
9
+ * - **Cruising (ops 3–8):** 0.85× — in the flow, comfortable pace
10
+ * - **Fatigue (ops 9+):** 1.0 + 0.05 × (n − 8) — gradually slowing down
11
+ */
12
+ export function rhythmMultiplier(operationCount) {
13
+ if (operationCount <= 2)
14
+ return 1.5;
15
+ if (operationCount <= 8)
16
+ return 0.85;
17
+ return 1.0 + 0.05 * (operationCount - 8);
18
+ }
19
+ /**
20
+ * Session-level pacer that tracks inter-operation timing and enforces
21
+ * minimum gaps between operations to prevent rapid-fire automation patterns.
22
+ *
23
+ * Each operation should call {@link paceBeforeOperation} before starting
24
+ * and {@link recordOperationEnd} after completing. The pacer applies a
25
+ * Gaussian-distributed cool-down scaled by a session rhythm multiplier
26
+ * that models warm-up, cruising, and fatigue phases.
27
+ */
28
+ export class SessionPacer {
29
+ lastOperationEnd = 0;
30
+ operationCount = 0;
31
+ /** Call before starting an operation. Resolves after the appropriate cool-down. */
32
+ async paceBeforeOperation(operationType) {
33
+ const now = Date.now();
34
+ // First operation — no cool-down needed
35
+ if (this.lastOperationEnd === 0)
36
+ return;
37
+ const elapsed = now - this.lastOperationEnd;
38
+ const multiplier = rhythmMultiplier(this.operationCount);
39
+ // Base cool-down parameters per operation type
40
+ const baseDelay = operationType === "read"
41
+ ? gaussianBetween(2_500, 800, 1_000, 5_000)
42
+ : gaussianBetween(8_000, 3_000, 3_000, 18_000);
43
+ const required = baseDelay * multiplier;
44
+ const remaining = required - elapsed;
45
+ if (remaining > 0) {
46
+ await delay(remaining);
47
+ }
48
+ }
49
+ /** Call after an operation completes to record its end timestamp. */
50
+ recordOperationEnd() {
51
+ this.lastOperationEnd = Date.now();
52
+ this.operationCount++;
53
+ }
54
+ }
55
+ //# sourceMappingURL=session-pacer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-pacer.js","sourceRoot":"","sources":["../../src/utils/session-pacer.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAAsB;IACrD,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IACpC,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACf,gBAAgB,GAAG,CAAC,CAAC;IACrB,cAAc,GAAG,CAAC,CAAC;IAE3B,oFAAoF;IACpF,KAAK,CAAC,mBAAmB,CAAC,aAA+B;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEvB,wCAAwC;QACxC,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC;YAAE,OAAO;QAExC,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAEzD,+CAA+C;QAC/C,MAAM,SAAS,GACb,aAAa,KAAK,MAAM;YACtB,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC;YAC3C,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAEnD,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;QACxC,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;QAErC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;YAClB,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,qEAAqE;IACrE,kBAAkB;QAChB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=session-pacer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-pacer.test.d.ts","sourceRoot":"","sources":["../../src/utils/session-pacer.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,111 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
4
+ import { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
5
+ describe("rhythmMultiplier", () => {
6
+ it("returns 1.5 for warm-up phase (ops 0–2)", () => {
7
+ expect(rhythmMultiplier(0)).toBe(1.5);
8
+ expect(rhythmMultiplier(1)).toBe(1.5);
9
+ expect(rhythmMultiplier(2)).toBe(1.5);
10
+ });
11
+ it("returns 0.85 for cruising phase (ops 3–8)", () => {
12
+ expect(rhythmMultiplier(3)).toBe(0.85);
13
+ expect(rhythmMultiplier(5)).toBe(0.85);
14
+ expect(rhythmMultiplier(8)).toBe(0.85);
15
+ });
16
+ it("returns increasing multiplier for fatigue phase (ops 9+)", () => {
17
+ expect(rhythmMultiplier(9)).toBeCloseTo(1.05);
18
+ expect(rhythmMultiplier(10)).toBeCloseTo(1.1);
19
+ expect(rhythmMultiplier(18)).toBeCloseTo(1.5);
20
+ expect(rhythmMultiplier(28)).toBeCloseTo(2.0);
21
+ });
22
+ });
23
+ describe("SessionPacer", () => {
24
+ beforeEach(() => {
25
+ vi.useFakeTimers();
26
+ });
27
+ afterEach(() => {
28
+ vi.useRealTimers();
29
+ });
30
+ it("skips cool-down for the first operation", async () => {
31
+ const pacer = new SessionPacer();
32
+ const start = Date.now();
33
+ const promise = pacer.paceBeforeOperation("read");
34
+ await vi.runAllTimersAsync();
35
+ await promise;
36
+ // Should resolve immediately — no delay for first operation
37
+ expect(Date.now() - start).toBe(0);
38
+ });
39
+ it("enforces cool-down after first operation completes", async () => {
40
+ const pacer = new SessionPacer();
41
+ // Complete a first operation
42
+ pacer.recordOperationEnd();
43
+ // Immediately request pacing for the next — should delay
44
+ const promise = pacer.paceBeforeOperation("read");
45
+ // Advance timers to let the delay resolve
46
+ await vi.runAllTimersAsync();
47
+ await promise;
48
+ // The elapsed time should be positive (cool-down was applied)
49
+ expect(Date.now()).toBeGreaterThan(0);
50
+ });
51
+ it("skips cool-down when enough time has already elapsed", async () => {
52
+ const pacer = new SessionPacer();
53
+ // Complete first operation
54
+ pacer.recordOperationEnd();
55
+ // Advance time well past any possible cool-down
56
+ vi.advanceTimersByTime(60_000);
57
+ const timeBefore = Date.now();
58
+ const promise = pacer.paceBeforeOperation("read");
59
+ await vi.runAllTimersAsync();
60
+ await promise;
61
+ // No additional delay — the gap already exceeds the required cool-down
62
+ expect(Date.now() - timeBefore).toBe(0);
63
+ });
64
+ it("increments operation count on recordOperationEnd", async () => {
65
+ const pacer = new SessionPacer();
66
+ // First op — warm-up phase (1.5x), complete it
67
+ pacer.recordOperationEnd();
68
+ // Second op — still warm-up (1.5x)
69
+ const promise1 = pacer.paceBeforeOperation("read");
70
+ await vi.runAllTimersAsync();
71
+ await promise1;
72
+ pacer.recordOperationEnd();
73
+ // Third op — still warm-up (op count = 2)
74
+ const promise2 = pacer.paceBeforeOperation("read");
75
+ await vi.runAllTimersAsync();
76
+ await promise2;
77
+ pacer.recordOperationEnd();
78
+ // Fourth op — cruising phase (op count = 3, multiplier = 0.85)
79
+ const timeBefore = Date.now();
80
+ const promise3 = pacer.paceBeforeOperation("read");
81
+ await vi.runAllTimersAsync();
82
+ await promise3;
83
+ // The delay should be shorter in cruising than warm-up
84
+ // (0.85x vs 1.5x of the base Gaussian delay)
85
+ const elapsed = Date.now() - timeBefore;
86
+ expect(elapsed).toBeGreaterThan(0);
87
+ });
88
+ it("applies longer cool-down for write operations", async () => {
89
+ // Seed Math.random for deterministic comparison
90
+ vi.spyOn(Math, "random").mockReturnValue(0.5);
91
+ // Measure read cool-down
92
+ const readPacer = new SessionPacer();
93
+ readPacer.recordOperationEnd();
94
+ const readBefore = Date.now();
95
+ const readPromise = readPacer.paceBeforeOperation("read");
96
+ await vi.runAllTimersAsync();
97
+ await readPromise;
98
+ const readElapsed = Date.now() - readBefore;
99
+ // Measure write cool-down in a fresh pacer
100
+ const writePacer = new SessionPacer();
101
+ writePacer.recordOperationEnd();
102
+ const writeBefore = Date.now();
103
+ const writePromise = writePacer.paceBeforeOperation("write");
104
+ await vi.runAllTimersAsync();
105
+ await writePromise;
106
+ const writeElapsed = Date.now() - writeBefore;
107
+ // Write cool-down should be longer than read cool-down
108
+ expect(writeElapsed).toBeGreaterThan(readElapsed);
109
+ });
110
+ });
111
+ //# sourceMappingURL=session-pacer.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-pacer.test.js","sourceRoot":"","sources":["../../src/utils/session-pacer.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE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AAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,gDAAgD;QAChD,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAE9C,yBAAyB;QACzB,MAAM,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QACrC,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAC1D,MAAM,EAAE,CAAC,iBAAiB,EAAE,CAAC;QAC7B,MAAM,WAAW,CAAC;QAClB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC;QAE5C,2CAA2C;QAC3C,MAAM,UAAU,GAAG,IAAI,YAAY,EAAE,CAAC;QACtC,UAAU,CAAC,kBAAkB,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,EAAE,CAAC,iBAAiB,EAAE,CAAC;QAC7B,MAAM,YAAY,CAAC;QACnB,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;QAE9C,uDAAuD;QACvD,MAAM,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lhremote/core",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Core library for LinkedHelper automation",
5
5
  "type": "module",
6
6
  "engines": {