@growthub/cli 0.3.12 → 0.3.13

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 (1699) hide show
  1. package/dist/index.js +186 -183
  2. package/dist/index.js.map +3 -3
  3. package/package.json +1 -7
  4. package/dist/runtime/server/dist/adapters/codex-models.d.ts +0 -4
  5. package/dist/runtime/server/dist/adapters/codex-models.d.ts.map +0 -1
  6. package/dist/runtime/server/dist/adapters/codex-models.js +0 -98
  7. package/dist/runtime/server/dist/adapters/codex-models.js.map +0 -1
  8. package/dist/runtime/server/dist/adapters/cursor-models.d.ts +0 -13
  9. package/dist/runtime/server/dist/adapters/cursor-models.d.ts.map +0 -1
  10. package/dist/runtime/server/dist/adapters/cursor-models.js +0 -148
  11. package/dist/runtime/server/dist/adapters/cursor-models.js.map +0 -1
  12. package/dist/runtime/server/dist/adapters/http/execute.d.ts +0 -3
  13. package/dist/runtime/server/dist/adapters/http/execute.d.ts.map +0 -1
  14. package/dist/runtime/server/dist/adapters/http/execute.js +0 -39
  15. package/dist/runtime/server/dist/adapters/http/execute.js.map +0 -1
  16. package/dist/runtime/server/dist/adapters/http/index.d.ts +0 -3
  17. package/dist/runtime/server/dist/adapters/http/index.d.ts.map +0 -1
  18. package/dist/runtime/server/dist/adapters/http/index.js +0 -20
  19. package/dist/runtime/server/dist/adapters/http/index.js.map +0 -1
  20. package/dist/runtime/server/dist/adapters/http/test.d.ts +0 -3
  21. package/dist/runtime/server/dist/adapters/http/test.d.ts.map +0 -1
  22. package/dist/runtime/server/dist/adapters/http/test.js +0 -106
  23. package/dist/runtime/server/dist/adapters/http/test.js.map +0 -1
  24. package/dist/runtime/server/dist/adapters/index.d.ts +0 -4
  25. package/dist/runtime/server/dist/adapters/index.d.ts.map +0 -1
  26. package/dist/runtime/server/dist/adapters/index.js +0 -3
  27. package/dist/runtime/server/dist/adapters/index.js.map +0 -1
  28. package/dist/runtime/server/dist/adapters/process/execute.d.ts +0 -3
  29. package/dist/runtime/server/dist/adapters/process/execute.d.ts.map +0 -1
  30. package/dist/runtime/server/dist/adapters/process/execute.js +0 -63
  31. package/dist/runtime/server/dist/adapters/process/execute.js.map +0 -1
  32. package/dist/runtime/server/dist/adapters/process/index.d.ts +0 -3
  33. package/dist/runtime/server/dist/adapters/process/index.d.ts.map +0 -1
  34. package/dist/runtime/server/dist/adapters/process/index.js +0 -23
  35. package/dist/runtime/server/dist/adapters/process/index.js.map +0 -1
  36. package/dist/runtime/server/dist/adapters/process/test.d.ts +0 -3
  37. package/dist/runtime/server/dist/adapters/process/test.d.ts.map +0 -1
  38. package/dist/runtime/server/dist/adapters/process/test.js +0 -77
  39. package/dist/runtime/server/dist/adapters/process/test.js.map +0 -1
  40. package/dist/runtime/server/dist/adapters/registry.d.ts +0 -9
  41. package/dist/runtime/server/dist/adapters/registry.d.ts.map +0 -1
  42. package/dist/runtime/server/dist/adapters/registry.js +0 -142
  43. package/dist/runtime/server/dist/adapters/registry.js.map +0 -1
  44. package/dist/runtime/server/dist/adapters/types.d.ts +0 -2
  45. package/dist/runtime/server/dist/adapters/types.d.ts.map +0 -1
  46. package/dist/runtime/server/dist/adapters/types.js +0 -2
  47. package/dist/runtime/server/dist/adapters/types.js.map +0 -1
  48. package/dist/runtime/server/dist/adapters/utils.d.ts +0 -10
  49. package/dist/runtime/server/dist/adapters/utils.d.ts.map +0 -1
  50. package/dist/runtime/server/dist/adapters/utils.js +0 -14
  51. package/dist/runtime/server/dist/adapters/utils.js.map +0 -1
  52. package/dist/runtime/server/dist/agent-auth-jwt.d.ts +0 -14
  53. package/dist/runtime/server/dist/agent-auth-jwt.d.ts.map +0 -1
  54. package/dist/runtime/server/dist/agent-auth-jwt.js +0 -117
  55. package/dist/runtime/server/dist/agent-auth-jwt.js.map +0 -1
  56. package/dist/runtime/server/dist/app.d.ts +0 -26
  57. package/dist/runtime/server/dist/app.d.ts.map +0 -1
  58. package/dist/runtime/server/dist/app.js +0 -310
  59. package/dist/runtime/server/dist/app.js.map +0 -1
  60. package/dist/runtime/server/dist/attachment-types.d.ts +0 -33
  61. package/dist/runtime/server/dist/attachment-types.d.ts.map +0 -1
  62. package/dist/runtime/server/dist/attachment-types.js +0 -67
  63. package/dist/runtime/server/dist/attachment-types.js.map +0 -1
  64. package/dist/runtime/server/dist/auth/better-auth.d.ts +0 -24
  65. package/dist/runtime/server/dist/auth/better-auth.d.ts.map +0 -1
  66. package/dist/runtime/server/dist/auth/better-auth.js +0 -108
  67. package/dist/runtime/server/dist/auth/better-auth.js.map +0 -1
  68. package/dist/runtime/server/dist/board-claim.d.ts +0 -23
  69. package/dist/runtime/server/dist/board-claim.d.ts.map +0 -1
  70. package/dist/runtime/server/dist/board-claim.js +0 -115
  71. package/dist/runtime/server/dist/board-claim.js.map +0 -1
  72. package/dist/runtime/server/dist/config-file.d.ts +0 -4
  73. package/dist/runtime/server/dist/config-file.d.ts.map +0 -1
  74. package/dist/runtime/server/dist/config-file.js +0 -25
  75. package/dist/runtime/server/dist/config-file.js.map +0 -1
  76. package/dist/runtime/server/dist/config.d.ts +0 -39
  77. package/dist/runtime/server/dist/config.d.ts.map +0 -1
  78. package/dist/runtime/server/dist/config.js +0 -164
  79. package/dist/runtime/server/dist/config.js.map +0 -1
  80. package/dist/runtime/server/dist/errors.d.ts +0 -12
  81. package/dist/runtime/server/dist/errors.d.ts.map +0 -1
  82. package/dist/runtime/server/dist/errors.js +0 -28
  83. package/dist/runtime/server/dist/errors.js.map +0 -1
  84. package/dist/runtime/server/dist/home-paths.d.ts +0 -17
  85. package/dist/runtime/server/dist/home-paths.d.ts.map +0 -1
  86. package/dist/runtime/server/dist/home-paths.js +0 -75
  87. package/dist/runtime/server/dist/home-paths.js.map +0 -1
  88. package/dist/runtime/server/dist/index.d.ts +0 -10
  89. package/dist/runtime/server/dist/index.d.ts.map +0 -1
  90. package/dist/runtime/server/dist/index.js +0 -567
  91. package/dist/runtime/server/dist/index.js.map +0 -1
  92. package/dist/runtime/server/dist/log-redaction.d.ts +0 -10
  93. package/dist/runtime/server/dist/log-redaction.d.ts.map +0 -1
  94. package/dist/runtime/server/dist/log-redaction.js +0 -110
  95. package/dist/runtime/server/dist/log-redaction.js.map +0 -1
  96. package/dist/runtime/server/dist/middleware/auth.d.ts +0 -12
  97. package/dist/runtime/server/dist/middleware/auth.d.ts.map +0 -1
  98. package/dist/runtime/server/dist/middleware/auth.js +0 -124
  99. package/dist/runtime/server/dist/middleware/auth.js.map +0 -1
  100. package/dist/runtime/server/dist/middleware/board-mutation-guard.d.ts +0 -3
  101. package/dist/runtime/server/dist/middleware/board-mutation-guard.d.ts.map +0 -1
  102. package/dist/runtime/server/dist/middleware/board-mutation-guard.js +0 -60
  103. package/dist/runtime/server/dist/middleware/board-mutation-guard.js.map +0 -1
  104. package/dist/runtime/server/dist/middleware/error-handler.d.ts +0 -17
  105. package/dist/runtime/server/dist/middleware/error-handler.d.ts.map +0 -1
  106. package/dist/runtime/server/dist/middleware/error-handler.js +0 -37
  107. package/dist/runtime/server/dist/middleware/error-handler.js.map +0 -1
  108. package/dist/runtime/server/dist/middleware/index.d.ts +0 -4
  109. package/dist/runtime/server/dist/middleware/index.d.ts.map +0 -1
  110. package/dist/runtime/server/dist/middleware/index.js +0 -4
  111. package/dist/runtime/server/dist/middleware/index.js.map +0 -1
  112. package/dist/runtime/server/dist/middleware/logger.d.ts +0 -4
  113. package/dist/runtime/server/dist/middleware/logger.d.ts.map +0 -1
  114. package/dist/runtime/server/dist/middleware/logger.js +0 -87
  115. package/dist/runtime/server/dist/middleware/logger.js.map +0 -1
  116. package/dist/runtime/server/dist/middleware/private-hostname-guard.d.ts +0 -11
  117. package/dist/runtime/server/dist/middleware/private-hostname-guard.d.ts.map +0 -1
  118. package/dist/runtime/server/dist/middleware/private-hostname-guard.js +0 -78
  119. package/dist/runtime/server/dist/middleware/private-hostname-guard.js.map +0 -1
  120. package/dist/runtime/server/dist/middleware/validate.d.ts +0 -4
  121. package/dist/runtime/server/dist/middleware/validate.d.ts.map +0 -1
  122. package/dist/runtime/server/dist/middleware/validate.js +0 -7
  123. package/dist/runtime/server/dist/middleware/validate.js.map +0 -1
  124. package/dist/runtime/server/dist/paths.d.ts +0 -3
  125. package/dist/runtime/server/dist/paths.d.ts.map +0 -1
  126. package/dist/runtime/server/dist/paths.js +0 -31
  127. package/dist/runtime/server/dist/paths.js.map +0 -1
  128. package/dist/runtime/server/dist/realtime/live-events-ws.d.ts +0 -28
  129. package/dist/runtime/server/dist/realtime/live-events-ws.d.ts.map +0 -1
  130. package/dist/runtime/server/dist/realtime/live-events-ws.js +0 -187
  131. package/dist/runtime/server/dist/realtime/live-events-ws.js.map +0 -1
  132. package/dist/runtime/server/dist/redaction.d.ts +0 -4
  133. package/dist/runtime/server/dist/redaction.d.ts.map +0 -1
  134. package/dist/runtime/server/dist/redaction.js +0 -63
  135. package/dist/runtime/server/dist/redaction.js.map +0 -1
  136. package/dist/runtime/server/dist/routes/access.d.ts +0 -56
  137. package/dist/runtime/server/dist/routes/access.d.ts.map +0 -1
  138. package/dist/runtime/server/dist/routes/access.js +0 -2125
  139. package/dist/runtime/server/dist/routes/access.js.map +0 -1
  140. package/dist/runtime/server/dist/routes/activity.d.ts +0 -3
  141. package/dist/runtime/server/dist/routes/activity.d.ts.map +0 -1
  142. package/dist/runtime/server/dist/routes/activity.js +0 -78
  143. package/dist/runtime/server/dist/routes/activity.js.map +0 -1
  144. package/dist/runtime/server/dist/routes/agents.d.ts +0 -3
  145. package/dist/runtime/server/dist/routes/agents.d.ts.map +0 -1
  146. package/dist/runtime/server/dist/routes/agents.js +0 -1485
  147. package/dist/runtime/server/dist/routes/agents.js.map +0 -1
  148. package/dist/runtime/server/dist/routes/approvals.d.ts +0 -3
  149. package/dist/runtime/server/dist/routes/approvals.d.ts.map +0 -1
  150. package/dist/runtime/server/dist/routes/approvals.js +0 -275
  151. package/dist/runtime/server/dist/routes/approvals.js.map +0 -1
  152. package/dist/runtime/server/dist/routes/assets.d.ts +0 -4
  153. package/dist/runtime/server/dist/routes/assets.d.ts.map +0 -1
  154. package/dist/runtime/server/dist/routes/assets.js +0 -309
  155. package/dist/runtime/server/dist/routes/assets.js.map +0 -1
  156. package/dist/runtime/server/dist/routes/authz.d.ts +0 -15
  157. package/dist/runtime/server/dist/routes/authz.d.ts.map +0 -1
  158. package/dist/runtime/server/dist/routes/authz.js +0 -40
  159. package/dist/runtime/server/dist/routes/authz.js.map +0 -1
  160. package/dist/runtime/server/dist/routes/companies.d.ts +0 -3
  161. package/dist/runtime/server/dist/routes/companies.d.ts.map +0 -1
  162. package/dist/runtime/server/dist/routes/companies.js +0 -196
  163. package/dist/runtime/server/dist/routes/companies.js.map +0 -1
  164. package/dist/runtime/server/dist/routes/costs.d.ts +0 -3
  165. package/dist/runtime/server/dist/routes/costs.d.ts.map +0 -1
  166. package/dist/runtime/server/dist/routes/costs.js +0 -268
  167. package/dist/runtime/server/dist/routes/costs.js.map +0 -1
  168. package/dist/runtime/server/dist/routes/dashboard.d.ts +0 -3
  169. package/dist/runtime/server/dist/routes/dashboard.d.ts.map +0 -1
  170. package/dist/runtime/server/dist/routes/dashboard.js +0 -15
  171. package/dist/runtime/server/dist/routes/dashboard.js.map +0 -1
  172. package/dist/runtime/server/dist/routes/execution-workspaces.d.ts +0 -3
  173. package/dist/runtime/server/dist/routes/execution-workspaces.d.ts.map +0 -1
  174. package/dist/runtime/server/dist/routes/execution-workspaces.js +0 -165
  175. package/dist/runtime/server/dist/routes/execution-workspaces.js.map +0 -1
  176. package/dist/runtime/server/dist/routes/goals.d.ts +0 -3
  177. package/dist/runtime/server/dist/routes/goals.d.ts.map +0 -1
  178. package/dist/runtime/server/dist/routes/goals.js +0 -95
  179. package/dist/runtime/server/dist/routes/goals.js.map +0 -1
  180. package/dist/runtime/server/dist/routes/gtm.d.ts +0 -3
  181. package/dist/runtime/server/dist/routes/gtm.d.ts.map +0 -1
  182. package/dist/runtime/server/dist/routes/gtm.js +0 -478
  183. package/dist/runtime/server/dist/routes/gtm.js.map +0 -1
  184. package/dist/runtime/server/dist/routes/health.d.ts +0 -10
  185. package/dist/runtime/server/dist/routes/health.d.ts.map +0 -1
  186. package/dist/runtime/server/dist/routes/health.js +0 -53
  187. package/dist/runtime/server/dist/routes/health.js.map +0 -1
  188. package/dist/runtime/server/dist/routes/index.d.ts +0 -16
  189. package/dist/runtime/server/dist/routes/index.d.ts.map +0 -1
  190. package/dist/runtime/server/dist/routes/index.js +0 -16
  191. package/dist/runtime/server/dist/routes/index.js.map +0 -1
  192. package/dist/runtime/server/dist/routes/instance-settings.d.ts +0 -3
  193. package/dist/runtime/server/dist/routes/instance-settings.d.ts.map +0 -1
  194. package/dist/runtime/server/dist/routes/instance-settings.js +0 -46
  195. package/dist/runtime/server/dist/routes/instance-settings.js.map +0 -1
  196. package/dist/runtime/server/dist/routes/issues-checkout-wakeup.d.ts +0 -9
  197. package/dist/runtime/server/dist/routes/issues-checkout-wakeup.d.ts.map +0 -1
  198. package/dist/runtime/server/dist/routes/issues-checkout-wakeup.js +0 -12
  199. package/dist/runtime/server/dist/routes/issues-checkout-wakeup.js.map +0 -1
  200. package/dist/runtime/server/dist/routes/issues.d.ts +0 -4
  201. package/dist/runtime/server/dist/routes/issues.d.ts.map +0 -1
  202. package/dist/runtime/server/dist/routes/issues.js +0 -1454
  203. package/dist/runtime/server/dist/routes/issues.js.map +0 -1
  204. package/dist/runtime/server/dist/routes/llms.d.ts +0 -3
  205. package/dist/runtime/server/dist/routes/llms.d.ts.map +0 -1
  206. package/dist/runtime/server/dist/routes/llms.js +0 -78
  207. package/dist/runtime/server/dist/routes/llms.js.map +0 -1
  208. package/dist/runtime/server/dist/routes/plugin-ui-static.d.ts +0 -69
  209. package/dist/runtime/server/dist/routes/plugin-ui-static.d.ts.map +0 -1
  210. package/dist/runtime/server/dist/routes/plugin-ui-static.js +0 -411
  211. package/dist/runtime/server/dist/routes/plugin-ui-static.js.map +0 -1
  212. package/dist/runtime/server/dist/routes/plugins.d.ts +0 -120
  213. package/dist/runtime/server/dist/routes/plugins.d.ts.map +0 -1
  214. package/dist/runtime/server/dist/routes/plugins.js +0 -1784
  215. package/dist/runtime/server/dist/routes/plugins.js.map +0 -1
  216. package/dist/runtime/server/dist/routes/projects.d.ts +0 -3
  217. package/dist/runtime/server/dist/routes/projects.d.ts.map +0 -1
  218. package/dist/runtime/server/dist/routes/projects.js +0 -257
  219. package/dist/runtime/server/dist/routes/projects.js.map +0 -1
  220. package/dist/runtime/server/dist/routes/secrets.d.ts +0 -3
  221. package/dist/runtime/server/dist/routes/secrets.d.ts.map +0 -1
  222. package/dist/runtime/server/dist/routes/secrets.js +0 -128
  223. package/dist/runtime/server/dist/routes/secrets.js.map +0 -1
  224. package/dist/runtime/server/dist/routes/sidebar-badges.d.ts +0 -3
  225. package/dist/runtime/server/dist/routes/sidebar-badges.d.ts.map +0 -1
  226. package/dist/runtime/server/dist/routes/sidebar-badges.js +0 -45
  227. package/dist/runtime/server/dist/routes/sidebar-badges.js.map +0 -1
  228. package/dist/runtime/server/dist/routes/tickets.d.ts +0 -3
  229. package/dist/runtime/server/dist/routes/tickets.d.ts.map +0 -1
  230. package/dist/runtime/server/dist/routes/tickets.js +0 -112
  231. package/dist/runtime/server/dist/routes/tickets.js.map +0 -1
  232. package/dist/runtime/server/dist/secrets/external-stub-providers.d.ts +0 -5
  233. package/dist/runtime/server/dist/secrets/external-stub-providers.d.ts.map +0 -1
  234. package/dist/runtime/server/dist/secrets/external-stub-providers.js +0 -21
  235. package/dist/runtime/server/dist/secrets/external-stub-providers.js.map +0 -1
  236. package/dist/runtime/server/dist/secrets/local-encrypted-provider.d.ts +0 -3
  237. package/dist/runtime/server/dist/secrets/local-encrypted-provider.d.ts.map +0 -1
  238. package/dist/runtime/server/dist/secrets/local-encrypted-provider.js +0 -116
  239. package/dist/runtime/server/dist/secrets/local-encrypted-provider.js.map +0 -1
  240. package/dist/runtime/server/dist/secrets/provider-registry.d.ts +0 -5
  241. package/dist/runtime/server/dist/secrets/provider-registry.d.ts.map +0 -1
  242. package/dist/runtime/server/dist/secrets/provider-registry.js +0 -20
  243. package/dist/runtime/server/dist/secrets/provider-registry.js.map +0 -1
  244. package/dist/runtime/server/dist/secrets/types.d.ts +0 -21
  245. package/dist/runtime/server/dist/secrets/types.d.ts.map +0 -1
  246. package/dist/runtime/server/dist/secrets/types.js +0 -2
  247. package/dist/runtime/server/dist/secrets/types.js.map +0 -1
  248. package/dist/runtime/server/dist/services/access.d.ts +0 -93
  249. package/dist/runtime/server/dist/services/access.d.ts.map +0 -1
  250. package/dist/runtime/server/dist/services/access.js +0 -231
  251. package/dist/runtime/server/dist/services/access.js.map +0 -1
  252. package/dist/runtime/server/dist/services/activity-log.d.ts +0 -17
  253. package/dist/runtime/server/dist/services/activity-log.d.ts.map +0 -1
  254. package/dist/runtime/server/dist/services/activity-log.js +0 -68
  255. package/dist/runtime/server/dist/services/activity-log.js.map +0 -1
  256. package/dist/runtime/server/dist/services/activity.d.ts +0 -764
  257. package/dist/runtime/server/dist/services/activity.d.ts.map +0 -1
  258. package/dist/runtime/server/dist/services/activity.js +0 -105
  259. package/dist/runtime/server/dist/services/activity.js.map +0 -1
  260. package/dist/runtime/server/dist/services/agent-permissions.d.ts +0 -6
  261. package/dist/runtime/server/dist/services/agent-permissions.d.ts.map +0 -1
  262. package/dist/runtime/server/dist/services/agent-permissions.js +0 -18
  263. package/dist/runtime/server/dist/services/agent-permissions.js.map +0 -1
  264. package/dist/runtime/server/dist/services/agents.d.ts +0 -1670
  265. package/dist/runtime/server/dist/services/agents.d.ts.map +0 -1
  266. package/dist/runtime/server/dist/services/agents.js +0 -572
  267. package/dist/runtime/server/dist/services/agents.js.map +0 -1
  268. package/dist/runtime/server/dist/services/approvals.d.ts +0 -546
  269. package/dist/runtime/server/dist/services/approvals.d.ts.map +0 -1
  270. package/dist/runtime/server/dist/services/approvals.js +0 -206
  271. package/dist/runtime/server/dist/services/approvals.js.map +0 -1
  272. package/dist/runtime/server/dist/services/assets.d.ts +0 -33
  273. package/dist/runtime/server/dist/services/assets.d.ts.map +0 -1
  274. package/dist/runtime/server/dist/services/assets.js +0 -17
  275. package/dist/runtime/server/dist/services/assets.js.map +0 -1
  276. package/dist/runtime/server/dist/services/budgets.d.ts +0 -38
  277. package/dist/runtime/server/dist/services/budgets.d.ts.map +0 -1
  278. package/dist/runtime/server/dist/services/budgets.js +0 -784
  279. package/dist/runtime/server/dist/services/budgets.js.map +0 -1
  280. package/dist/runtime/server/dist/services/companies.d.ts +0 -124
  281. package/dist/runtime/server/dist/services/companies.d.ts.map +0 -1
  282. package/dist/runtime/server/dist/services/companies.js +0 -256
  283. package/dist/runtime/server/dist/services/companies.js.map +0 -1
  284. package/dist/runtime/server/dist/services/company-portability.d.ts +0 -8
  285. package/dist/runtime/server/dist/services/company-portability.d.ts.map +0 -1
  286. package/dist/runtime/server/dist/services/company-portability.js +0 -869
  287. package/dist/runtime/server/dist/services/company-portability.js.map +0 -1
  288. package/dist/runtime/server/dist/services/costs.d.ts +0 -114
  289. package/dist/runtime/server/dist/services/costs.d.ts.map +0 -1
  290. package/dist/runtime/server/dist/services/costs.js +0 -294
  291. package/dist/runtime/server/dist/services/costs.js.map +0 -1
  292. package/dist/runtime/server/dist/services/cron.d.ts +0 -80
  293. package/dist/runtime/server/dist/services/cron.d.ts.map +0 -1
  294. package/dist/runtime/server/dist/services/cron.js +0 -300
  295. package/dist/runtime/server/dist/services/cron.js.map +0 -1
  296. package/dist/runtime/server/dist/services/dashboard.d.ts +0 -26
  297. package/dist/runtime/server/dist/services/dashboard.d.ts.map +0 -1
  298. package/dist/runtime/server/dist/services/dashboard.js +0 -98
  299. package/dist/runtime/server/dist/services/dashboard.js.map +0 -1
  300. package/dist/runtime/server/dist/services/documents.d.ts +0 -164
  301. package/dist/runtime/server/dist/services/documents.d.ts.map +0 -1
  302. package/dist/runtime/server/dist/services/documents.js +0 -382
  303. package/dist/runtime/server/dist/services/documents.js.map +0 -1
  304. package/dist/runtime/server/dist/services/execution-workspace-policy.d.ts +0 -20
  305. package/dist/runtime/server/dist/services/execution-workspace-policy.d.ts.map +0 -1
  306. package/dist/runtime/server/dist/services/execution-workspace-policy.js +0 -165
  307. package/dist/runtime/server/dist/services/execution-workspace-policy.js.map +0 -1
  308. package/dist/runtime/server/dist/services/execution-workspaces.d.ts +0 -19
  309. package/dist/runtime/server/dist/services/execution-workspaces.d.ts.map +0 -1
  310. package/dist/runtime/server/dist/services/execution-workspaces.js +0 -87
  311. package/dist/runtime/server/dist/services/execution-workspaces.js.map +0 -1
  312. package/dist/runtime/server/dist/services/finance.d.ts +0 -93
  313. package/dist/runtime/server/dist/services/finance.d.ts.map +0 -1
  314. package/dist/runtime/server/dist/services/finance.js +0 -120
  315. package/dist/runtime/server/dist/services/finance.js.map +0 -1
  316. package/dist/runtime/server/dist/services/goals.d.ts +0 -433
  317. package/dist/runtime/server/dist/services/goals.d.ts.map +0 -1
  318. package/dist/runtime/server/dist/services/goals.js +0 -54
  319. package/dist/runtime/server/dist/services/goals.js.map +0 -1
  320. package/dist/runtime/server/dist/services/gtm-state.d.ts +0 -6
  321. package/dist/runtime/server/dist/services/gtm-state.d.ts.map +0 -1
  322. package/dist/runtime/server/dist/services/gtm-state.js +0 -88
  323. package/dist/runtime/server/dist/services/gtm-state.js.map +0 -1
  324. package/dist/runtime/server/dist/services/heartbeat-run-summary.d.ts +0 -2
  325. package/dist/runtime/server/dist/services/heartbeat-run-summary.d.ts.map +0 -1
  326. package/dist/runtime/server/dist/services/heartbeat-run-summary.js +0 -30
  327. package/dist/runtime/server/dist/services/heartbeat-run-summary.js.map +0 -1
  328. package/dist/runtime/server/dist/services/heartbeat.d.ts +0 -796
  329. package/dist/runtime/server/dist/services/heartbeat.d.ts.map +0 -1
  330. package/dist/runtime/server/dist/services/heartbeat.js +0 -3046
  331. package/dist/runtime/server/dist/services/heartbeat.js.map +0 -1
  332. package/dist/runtime/server/dist/services/hire-hook.d.ts +0 -14
  333. package/dist/runtime/server/dist/services/hire-hook.d.ts.map +0 -1
  334. package/dist/runtime/server/dist/services/hire-hook.js +0 -85
  335. package/dist/runtime/server/dist/services/hire-hook.js.map +0 -1
  336. package/dist/runtime/server/dist/services/index.d.ts +0 -30
  337. package/dist/runtime/server/dist/services/index.d.ts.map +0 -1
  338. package/dist/runtime/server/dist/services/index.js +0 -30
  339. package/dist/runtime/server/dist/services/index.js.map +0 -1
  340. package/dist/runtime/server/dist/services/instance-settings.d.ts +0 -9
  341. package/dist/runtime/server/dist/services/instance-settings.d.ts.map +0 -1
  342. package/dist/runtime/server/dist/services/instance-settings.js +0 -80
  343. package/dist/runtime/server/dist/services/instance-settings.js.map +0 -1
  344. package/dist/runtime/server/dist/services/issue-approvals.d.ts +0 -56
  345. package/dist/runtime/server/dist/services/issue-approvals.d.ts.map +0 -1
  346. package/dist/runtime/server/dist/services/issue-approvals.js +0 -153
  347. package/dist/runtime/server/dist/services/issue-approvals.js.map +0 -1
  348. package/dist/runtime/server/dist/services/issue-goal-fallback.d.ts +0 -15
  349. package/dist/runtime/server/dist/services/issue-goal-fallback.d.ts.map +0 -1
  350. package/dist/runtime/server/dist/services/issue-goal-fallback.js +0 -15
  351. package/dist/runtime/server/dist/services/issue-goal-fallback.js.map +0 -1
  352. package/dist/runtime/server/dist/services/issues.d.ts +0 -536
  353. package/dist/runtime/server/dist/services/issues.d.ts.map +0 -1
  354. package/dist/runtime/server/dist/services/issues.js +0 -1321
  355. package/dist/runtime/server/dist/services/issues.js.map +0 -1
  356. package/dist/runtime/server/dist/services/live-events.d.ts +0 -17
  357. package/dist/runtime/server/dist/services/live-events.d.ts.map +0 -1
  358. package/dist/runtime/server/dist/services/live-events.js +0 -33
  359. package/dist/runtime/server/dist/services/live-events.js.map +0 -1
  360. package/dist/runtime/server/dist/services/plugin-capability-validator.d.ts +0 -108
  361. package/dist/runtime/server/dist/services/plugin-capability-validator.d.ts.map +0 -1
  362. package/dist/runtime/server/dist/services/plugin-capability-validator.js +0 -268
  363. package/dist/runtime/server/dist/services/plugin-capability-validator.js.map +0 -1
  364. package/dist/runtime/server/dist/services/plugin-config-validator.d.ts +0 -26
  365. package/dist/runtime/server/dist/services/plugin-config-validator.d.ts.map +0 -1
  366. package/dist/runtime/server/dist/services/plugin-config-validator.js +0 -41
  367. package/dist/runtime/server/dist/services/plugin-config-validator.js.map +0 -1
  368. package/dist/runtime/server/dist/services/plugin-dev-watcher.d.ts +0 -30
  369. package/dist/runtime/server/dist/services/plugin-dev-watcher.d.ts.map +0 -1
  370. package/dist/runtime/server/dist/services/plugin-dev-watcher.js +0 -241
  371. package/dist/runtime/server/dist/services/plugin-dev-watcher.js.map +0 -1
  372. package/dist/runtime/server/dist/services/plugin-event-bus.d.ts +0 -149
  373. package/dist/runtime/server/dist/services/plugin-event-bus.d.ts.map +0 -1
  374. package/dist/runtime/server/dist/services/plugin-event-bus.js +0 -258
  375. package/dist/runtime/server/dist/services/plugin-event-bus.js.map +0 -1
  376. package/dist/runtime/server/dist/services/plugin-host-service-cleanup.d.ts +0 -14
  377. package/dist/runtime/server/dist/services/plugin-host-service-cleanup.d.ts.map +0 -1
  378. package/dist/runtime/server/dist/services/plugin-host-service-cleanup.js +0 -37
  379. package/dist/runtime/server/dist/services/plugin-host-service-cleanup.js.map +0 -1
  380. package/dist/runtime/server/dist/services/plugin-host-services.d.ts +0 -13
  381. package/dist/runtime/server/dist/services/plugin-host-services.d.ts.map +0 -1
  382. package/dist/runtime/server/dist/services/plugin-host-services.js +0 -969
  383. package/dist/runtime/server/dist/services/plugin-host-services.js.map +0 -1
  384. package/dist/runtime/server/dist/services/plugin-job-coordinator.d.ts +0 -81
  385. package/dist/runtime/server/dist/services/plugin-job-coordinator.d.ts.map +0 -1
  386. package/dist/runtime/server/dist/services/plugin-job-coordinator.js +0 -172
  387. package/dist/runtime/server/dist/services/plugin-job-coordinator.js.map +0 -1
  388. package/dist/runtime/server/dist/services/plugin-job-scheduler.d.ts +0 -163
  389. package/dist/runtime/server/dist/services/plugin-job-scheduler.d.ts.map +0 -1
  390. package/dist/runtime/server/dist/services/plugin-job-scheduler.js +0 -454
  391. package/dist/runtime/server/dist/services/plugin-job-scheduler.js.map +0 -1
  392. package/dist/runtime/server/dist/services/plugin-job-store.d.ts +0 -208
  393. package/dist/runtime/server/dist/services/plugin-job-store.d.ts.map +0 -1
  394. package/dist/runtime/server/dist/services/plugin-job-store.js +0 -350
  395. package/dist/runtime/server/dist/services/plugin-job-store.js.map +0 -1
  396. package/dist/runtime/server/dist/services/plugin-lifecycle.d.ts +0 -203
  397. package/dist/runtime/server/dist/services/plugin-lifecycle.d.ts.map +0 -1
  398. package/dist/runtime/server/dist/services/plugin-lifecycle.js +0 -476
  399. package/dist/runtime/server/dist/services/plugin-lifecycle.js.map +0 -1
  400. package/dist/runtime/server/dist/services/plugin-loader.d.ts +0 -441
  401. package/dist/runtime/server/dist/services/plugin-loader.d.ts.map +0 -1
  402. package/dist/runtime/server/dist/services/plugin-loader.js +0 -1192
  403. package/dist/runtime/server/dist/services/plugin-loader.js.map +0 -1
  404. package/dist/runtime/server/dist/services/plugin-log-retention.d.ts +0 -20
  405. package/dist/runtime/server/dist/services/plugin-log-retention.d.ts.map +0 -1
  406. package/dist/runtime/server/dist/services/plugin-log-retention.js +0 -63
  407. package/dist/runtime/server/dist/services/plugin-log-retention.js.map +0 -1
  408. package/dist/runtime/server/dist/services/plugin-manifest-validator.d.ts +0 -79
  409. package/dist/runtime/server/dist/services/plugin-manifest-validator.d.ts.map +0 -1
  410. package/dist/runtime/server/dist/services/plugin-manifest-validator.js +0 -84
  411. package/dist/runtime/server/dist/services/plugin-manifest-validator.js.map +0 -1
  412. package/dist/runtime/server/dist/services/plugin-registry.d.ts +0 -2542
  413. package/dist/runtime/server/dist/services/plugin-registry.d.ts.map +0 -1
  414. package/dist/runtime/server/dist/services/plugin-registry.js +0 -539
  415. package/dist/runtime/server/dist/services/plugin-registry.js.map +0 -1
  416. package/dist/runtime/server/dist/services/plugin-runtime-sandbox.d.ts +0 -40
  417. package/dist/runtime/server/dist/services/plugin-runtime-sandbox.d.ts.map +0 -1
  418. package/dist/runtime/server/dist/services/plugin-runtime-sandbox.js +0 -154
  419. package/dist/runtime/server/dist/services/plugin-runtime-sandbox.js.map +0 -1
  420. package/dist/runtime/server/dist/services/plugin-secrets-handler.d.ts +0 -81
  421. package/dist/runtime/server/dist/services/plugin-secrets-handler.d.ts.map +0 -1
  422. package/dist/runtime/server/dist/services/plugin-secrets-handler.js +0 -275
  423. package/dist/runtime/server/dist/services/plugin-secrets-handler.js.map +0 -1
  424. package/dist/runtime/server/dist/services/plugin-state-store.d.ts +0 -92
  425. package/dist/runtime/server/dist/services/plugin-state-store.d.ts.map +0 -1
  426. package/dist/runtime/server/dist/services/plugin-state-store.js +0 -190
  427. package/dist/runtime/server/dist/services/plugin-state-store.js.map +0 -1
  428. package/dist/runtime/server/dist/services/plugin-stream-bus.d.ts +0 -29
  429. package/dist/runtime/server/dist/services/plugin-stream-bus.d.ts.map +0 -1
  430. package/dist/runtime/server/dist/services/plugin-stream-bus.js +0 -48
  431. package/dist/runtime/server/dist/services/plugin-stream-bus.js.map +0 -1
  432. package/dist/runtime/server/dist/services/plugin-tool-dispatcher.d.ts +0 -180
  433. package/dist/runtime/server/dist/services/plugin-tool-dispatcher.d.ts.map +0 -1
  434. package/dist/runtime/server/dist/services/plugin-tool-dispatcher.js +0 -224
  435. package/dist/runtime/server/dist/services/plugin-tool-dispatcher.js.map +0 -1
  436. package/dist/runtime/server/dist/services/plugin-tool-registry.d.ts +0 -192
  437. package/dist/runtime/server/dist/services/plugin-tool-registry.d.ts.map +0 -1
  438. package/dist/runtime/server/dist/services/plugin-tool-registry.js +0 -224
  439. package/dist/runtime/server/dist/services/plugin-tool-registry.js.map +0 -1
  440. package/dist/runtime/server/dist/services/plugin-worker-manager.d.ts +0 -260
  441. package/dist/runtime/server/dist/services/plugin-worker-manager.d.ts.map +0 -1
  442. package/dist/runtime/server/dist/services/plugin-worker-manager.js +0 -835
  443. package/dist/runtime/server/dist/services/plugin-worker-manager.js.map +0 -1
  444. package/dist/runtime/server/dist/services/projects.d.ts +0 -87
  445. package/dist/runtime/server/dist/services/projects.d.ts.map +0 -1
  446. package/dist/runtime/server/dist/services/projects.js +0 -656
  447. package/dist/runtime/server/dist/services/projects.js.map +0 -1
  448. package/dist/runtime/server/dist/services/quota-windows.d.ts +0 -9
  449. package/dist/runtime/server/dist/services/quota-windows.d.ts.map +0 -1
  450. package/dist/runtime/server/dist/services/quota-windows.js +0 -56
  451. package/dist/runtime/server/dist/services/quota-windows.js.map +0 -1
  452. package/dist/runtime/server/dist/services/run-log-store.d.ts +0 -34
  453. package/dist/runtime/server/dist/services/run-log-store.d.ts.map +0 -1
  454. package/dist/runtime/server/dist/services/run-log-store.js +0 -109
  455. package/dist/runtime/server/dist/services/run-log-store.js.map +0 -1
  456. package/dist/runtime/server/dist/services/secrets.d.ts +0 -510
  457. package/dist/runtime/server/dist/services/secrets.d.ts.map +0 -1
  458. package/dist/runtime/server/dist/services/secrets.js +0 -288
  459. package/dist/runtime/server/dist/services/secrets.js.map +0 -1
  460. package/dist/runtime/server/dist/services/sidebar-badges.d.ts +0 -9
  461. package/dist/runtime/server/dist/services/sidebar-badges.d.ts.map +0 -1
  462. package/dist/runtime/server/dist/services/sidebar-badges.js +0 -33
  463. package/dist/runtime/server/dist/services/sidebar-badges.js.map +0 -1
  464. package/dist/runtime/server/dist/services/tickets.d.ts +0 -1869
  465. package/dist/runtime/server/dist/services/tickets.d.ts.map +0 -1
  466. package/dist/runtime/server/dist/services/tickets.js +0 -78
  467. package/dist/runtime/server/dist/services/tickets.js.map +0 -1
  468. package/dist/runtime/server/dist/services/work-products.d.ts +0 -14
  469. package/dist/runtime/server/dist/services/work-products.d.ts.map +0 -1
  470. package/dist/runtime/server/dist/services/work-products.js +0 -100
  471. package/dist/runtime/server/dist/services/work-products.js.map +0 -1
  472. package/dist/runtime/server/dist/services/workspace-operation-log-store.d.ts +0 -33
  473. package/dist/runtime/server/dist/services/workspace-operation-log-store.d.ts.map +0 -1
  474. package/dist/runtime/server/dist/services/workspace-operation-log-store.js +0 -110
  475. package/dist/runtime/server/dist/services/workspace-operation-log-store.js.map +0 -1
  476. package/dist/runtime/server/dist/services/workspace-operations.d.ts +0 -44
  477. package/dist/runtime/server/dist/services/workspace-operations.d.ts.map +0 -1
  478. package/dist/runtime/server/dist/services/workspace-operations.js +0 -204
  479. package/dist/runtime/server/dist/services/workspace-operations.js.map +0 -1
  480. package/dist/runtime/server/dist/services/workspace-runtime.d.ts +0 -164
  481. package/dist/runtime/server/dist/services/workspace-runtime.d.ts.map +0 -1
  482. package/dist/runtime/server/dist/services/workspace-runtime.js +0 -1235
  483. package/dist/runtime/server/dist/services/workspace-runtime.js.map +0 -1
  484. package/dist/runtime/server/dist/startup-banner.d.ts +0 -31
  485. package/dist/runtime/server/dist/startup-banner.d.ts.map +0 -1
  486. package/dist/runtime/server/dist/startup-banner.js +0 -117
  487. package/dist/runtime/server/dist/startup-banner.js.map +0 -1
  488. package/dist/runtime/server/dist/storage/index.d.ts +0 -6
  489. package/dist/runtime/server/dist/storage/index.d.ts.map +0 -1
  490. package/dist/runtime/server/dist/storage/index.js +0 -29
  491. package/dist/runtime/server/dist/storage/index.js.map +0 -1
  492. package/dist/runtime/server/dist/storage/local-disk-provider.d.ts +0 -3
  493. package/dist/runtime/server/dist/storage/local-disk-provider.d.ts.map +0 -1
  494. package/dist/runtime/server/dist/storage/local-disk-provider.js +0 -79
  495. package/dist/runtime/server/dist/storage/local-disk-provider.js.map +0 -1
  496. package/dist/runtime/server/dist/storage/provider-registry.d.ts +0 -4
  497. package/dist/runtime/server/dist/storage/provider-registry.d.ts.map +0 -1
  498. package/dist/runtime/server/dist/storage/provider-registry.js +0 -15
  499. package/dist/runtime/server/dist/storage/provider-registry.js.map +0 -1
  500. package/dist/runtime/server/dist/storage/s3-provider.d.ts +0 -11
  501. package/dist/runtime/server/dist/storage/s3-provider.d.ts.map +0 -1
  502. package/dist/runtime/server/dist/storage/s3-provider.js +0 -123
  503. package/dist/runtime/server/dist/storage/s3-provider.js.map +0 -1
  504. package/dist/runtime/server/dist/storage/service.d.ts +0 -3
  505. package/dist/runtime/server/dist/storage/service.d.ts.map +0 -1
  506. package/dist/runtime/server/dist/storage/service.js +0 -120
  507. package/dist/runtime/server/dist/storage/service.js.map +0 -1
  508. package/dist/runtime/server/dist/storage/types.d.ts +0 -55
  509. package/dist/runtime/server/dist/storage/types.d.ts.map +0 -1
  510. package/dist/runtime/server/dist/storage/types.js +0 -2
  511. package/dist/runtime/server/dist/storage/types.js.map +0 -1
  512. package/dist/runtime/server/dist/ui-branding.d.ts +0 -14
  513. package/dist/runtime/server/dist/ui-branding.d.ts.map +0 -1
  514. package/dist/runtime/server/dist/ui-branding.js +0 -189
  515. package/dist/runtime/server/dist/ui-branding.js.map +0 -1
  516. package/dist/runtime/server/dist/version.d.ts +0 -2
  517. package/dist/runtime/server/dist/version.d.ts.map +0 -1
  518. package/dist/runtime/server/dist/version.js +0 -5
  519. package/dist/runtime/server/dist/version.js.map +0 -1
  520. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.d.ts +0 -2
  521. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.d.ts.map +0 -1
  522. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.js +0 -94
  523. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/format-event.js.map +0 -1
  524. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.d.ts +0 -2
  525. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.d.ts.map +0 -1
  526. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.js +0 -2
  527. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/index.js.map +0 -1
  528. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.d.ts +0 -3
  529. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.d.ts.map +0 -1
  530. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.js +0 -106
  531. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/cli/quota-probe.js.map +0 -1
  532. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.d.ts +0 -8
  533. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.d.ts.map +0 -1
  534. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.js +0 -36
  535. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/index.js.map +0 -1
  536. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.d.ts +0 -18
  537. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.d.ts.map +0 -1
  538. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.js +0 -453
  539. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/execute.js.map +0 -1
  540. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.d.ts +0 -7
  541. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.d.ts.map +0 -1
  542. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.js +0 -56
  543. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/index.js.map +0 -1
  544. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.d.ts +0 -22
  545. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.d.ts.map +0 -1
  546. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.js +0 -158
  547. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/parse.js.map +0 -1
  548. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.d.ts +0 -20
  549. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.d.ts.map +0 -1
  550. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.js +0 -477
  551. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/quota.js.map +0 -1
  552. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.d.ts +0 -3
  553. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.d.ts.map +0 -1
  554. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.js +0 -201
  555. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/server/test.js.map +0 -1
  556. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.d.ts +0 -3
  557. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.d.ts.map +0 -1
  558. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.js +0 -115
  559. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/build-config.js.map +0 -1
  560. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.d.ts +0 -3
  561. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.d.ts.map +0 -1
  562. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.js +0 -3
  563. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/index.js.map +0 -1
  564. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.d.ts +0 -3
  565. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.d.ts.map +0 -1
  566. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.js +0 -149
  567. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/dist/ui/parse-stdout.js.map +0 -1
  568. package/dist/runtime/server/node_modules/@paperclipai/adapter-claude-local/package.json +0 -42
  569. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.d.ts +0 -2
  570. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.d.ts.map +0 -1
  571. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.js +0 -213
  572. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/format-event.js.map +0 -1
  573. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.d.ts +0 -2
  574. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.d.ts.map +0 -1
  575. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.js +0 -2
  576. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/index.js.map +0 -1
  577. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.d.ts +0 -3
  578. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.d.ts.map +0 -1
  579. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.js +0 -97
  580. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/cli/quota-probe.js.map +0 -1
  581. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.d.ts +0 -10
  582. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.d.ts.map +0 -1
  583. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.js +0 -45
  584. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/index.js.map +0 -1
  585. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.d.ts +0 -5
  586. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.d.ts.map +0 -1
  587. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.js +0 -86
  588. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/codex-home.js.map +0 -1
  589. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.d.ts +0 -11
  590. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.d.ts.map +0 -1
  591. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.js +0 -451
  592. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/execute.js.map +0 -1
  593. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.d.ts +0 -7
  594. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.d.ts.map +0 -1
  595. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.js +0 -56
  596. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/index.js.map +0 -1
  597. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.d.ts +0 -12
  598. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.d.ts.map +0 -1
  599. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.js +0 -67
  600. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/parse.js.map +0 -1
  601. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.d.ts +0 -64
  602. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.d.ts.map +0 -1
  603. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.js +0 -425
  604. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/quota.js.map +0 -1
  605. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.d.ts +0 -3
  606. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.d.ts.map +0 -1
  607. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.js +0 -194
  608. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/server/test.js.map +0 -1
  609. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.d.ts +0 -3
  610. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.d.ts.map +0 -1
  611. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.js +0 -116
  612. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/build-config.js.map +0 -1
  613. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.d.ts +0 -3
  614. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.d.ts.map +0 -1
  615. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.js +0 -3
  616. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/index.js.map +0 -1
  617. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.d.ts +0 -3
  618. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.d.ts.map +0 -1
  619. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.js +0 -233
  620. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/dist/ui/parse-stdout.js.map +0 -1
  621. package/dist/runtime/server/node_modules/@paperclipai/adapter-codex-local/package.json +0 -42
  622. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.d.ts +0 -2
  623. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.d.ts.map +0 -1
  624. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.js +0 -296
  625. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/format-event.js.map +0 -1
  626. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.d.ts +0 -2
  627. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.d.ts.map +0 -1
  628. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.js +0 -2
  629. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/cli/index.js.map +0 -1
  630. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.d.ts +0 -9
  631. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.d.ts.map +0 -1
  632. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.js +0 -81
  633. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/index.js.map +0 -1
  634. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.d.ts +0 -14
  635. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.d.ts.map +0 -1
  636. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.js +0 -416
  637. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/execute.js.map +0 -1
  638. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.d.ts +0 -6
  639. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.d.ts.map +0 -1
  640. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.js +0 -61
  641. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/index.js.map +0 -1
  642. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.d.ts +0 -13
  643. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.d.ts.map +0 -1
  644. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.js +0 -139
  645. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/parse.js.map +0 -1
  646. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.d.ts +0 -3
  647. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.d.ts.map +0 -1
  648. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.js +0 -188
  649. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/server/test.js.map +0 -1
  650. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.d.ts +0 -5
  651. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.d.ts.map +0 -1
  652. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.js +0 -13
  653. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/stream.js.map +0 -1
  654. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.d.ts +0 -2
  655. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.d.ts.map +0 -1
  656. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.js +0 -7
  657. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/shared/trust.js.map +0 -1
  658. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.d.ts +0 -3
  659. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.d.ts.map +0 -1
  660. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.js +0 -92
  661. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/build-config.js.map +0 -1
  662. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.d.ts +0 -3
  663. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.d.ts.map +0 -1
  664. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.js +0 -3
  665. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/index.js.map +0 -1
  666. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.d.ts +0 -3
  667. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.d.ts.map +0 -1
  668. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.js +0 -373
  669. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/dist/ui/parse-stdout.js.map +0 -1
  670. package/dist/runtime/server/node_modules/@paperclipai/adapter-cursor-local/package.json +0 -42
  671. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.d.ts +0 -2
  672. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.d.ts.map +0 -1
  673. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.js +0 -198
  674. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/format-event.js.map +0 -1
  675. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.d.ts +0 -2
  676. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.d.ts.map +0 -1
  677. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.js +0 -2
  678. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/cli/index.js.map +0 -1
  679. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.d.ts +0 -9
  680. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.d.ts.map +0 -1
  681. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.js +0 -46
  682. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/index.js.map +0 -1
  683. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.d.ts +0 -3
  684. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.d.ts.map +0 -1
  685. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.js +0 -364
  686. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/execute.js.map +0 -1
  687. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.d.ts +0 -6
  688. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.d.ts.map +0 -1
  689. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.js +0 -61
  690. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/index.js.map +0 -1
  691. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.d.ts +0 -31
  692. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.d.ts.map +0 -1
  693. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.js +0 -227
  694. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/parse.js.map +0 -1
  695. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.d.ts +0 -3
  696. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.d.ts.map +0 -1
  697. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.js +0 -203
  698. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/test.js.map +0 -1
  699. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.d.ts +0 -2
  700. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.d.ts.map +0 -1
  701. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.js +0 -7
  702. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/server/utils.js.map +0 -1
  703. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.d.ts +0 -3
  704. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.d.ts.map +0 -1
  705. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.js +0 -84
  706. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/build-config.js.map +0 -1
  707. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.d.ts +0 -3
  708. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.d.ts.map +0 -1
  709. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.js +0 -3
  710. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/index.js.map +0 -1
  711. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.d.ts +0 -3
  712. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.d.ts.map +0 -1
  713. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.js +0 -247
  714. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/dist/ui/parse-stdout.js.map +0 -1
  715. package/dist/runtime/server/node_modules/@paperclipai/adapter-gemini-local/package.json +0 -42
  716. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.d.ts +0 -2
  717. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.d.ts.map +0 -1
  718. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.js +0 -20
  719. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/format-event.js.map +0 -1
  720. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.d.ts +0 -2
  721. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.d.ts.map +0 -1
  722. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.js +0 -2
  723. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/cli/index.js.map +0 -1
  724. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.d.ts +0 -8
  725. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.d.ts.map +0 -1
  726. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.js +0 -53
  727. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/index.js.map +0 -1
  728. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.d.ts +0 -3
  729. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.d.ts.map +0 -1
  730. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.js +0 -1146
  731. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/execute.js.map +0 -1
  732. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.d.ts +0 -3
  733. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.d.ts.map +0 -1
  734. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.js +0 -3
  735. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/index.js.map +0 -1
  736. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.d.ts +0 -3
  737. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.d.ts.map +0 -1
  738. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.js +0 -290
  739. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/server/test.js.map +0 -1
  740. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.d.ts +0 -5
  741. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.d.ts.map +0 -1
  742. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.js +0 -13
  743. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/shared/stream.js.map +0 -1
  744. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.d.ts +0 -3
  745. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.d.ts.map +0 -1
  746. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.js +0 -33
  747. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/build-config.js.map +0 -1
  748. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.d.ts +0 -3
  749. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.d.ts.map +0 -1
  750. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.js +0 -3
  751. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/index.js.map +0 -1
  752. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.d.ts +0 -3
  753. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.d.ts.map +0 -1
  754. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.js +0 -64
  755. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/dist/ui/parse-stdout.js.map +0 -1
  756. package/dist/runtime/server/node_modules/@paperclipai/adapter-openclaw-gateway/package.json +0 -43
  757. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.d.ts +0 -2
  758. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.d.ts.map +0 -1
  759. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.js +0 -115
  760. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/format-event.js.map +0 -1
  761. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.d.ts +0 -2
  762. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.d.ts.map +0 -1
  763. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.js +0 -2
  764. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/cli/index.js.map +0 -1
  765. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.d.ts +0 -8
  766. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.d.ts.map +0 -1
  767. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.js +0 -39
  768. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/index.js.map +0 -1
  769. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.d.ts +0 -3
  770. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.d.ts.map +0 -1
  771. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.js +0 -337
  772. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/execute.js.map +0 -1
  773. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.d.ts +0 -7
  774. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.d.ts.map +0 -1
  775. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.js +0 -62
  776. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/index.js.map +0 -1
  777. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.d.ts +0 -20
  778. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.d.ts.map +0 -1
  779. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.js +0 -165
  780. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.js.map +0 -1
  781. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.d.ts +0 -2
  782. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.d.ts.map +0 -1
  783. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.js +0 -22
  784. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/models.test.js.map +0 -1
  785. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.d.ts +0 -13
  786. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.d.ts.map +0 -1
  787. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.js +0 -97
  788. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.js.map +0 -1
  789. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.d.ts +0 -2
  790. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.d.ts.map +0 -1
  791. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.js +0 -48
  792. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/parse.test.js.map +0 -1
  793. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.d.ts +0 -3
  794. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.d.ts.map +0 -1
  795. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.js +0 -300
  796. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/server/test.js.map +0 -1
  797. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.d.ts +0 -3
  798. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.d.ts.map +0 -1
  799. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.js +0 -87
  800. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/build-config.js.map +0 -1
  801. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.d.ts +0 -3
  802. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.d.ts.map +0 -1
  803. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.js +0 -3
  804. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/index.js.map +0 -1
  805. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.d.ts +0 -3
  806. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.d.ts.map +0 -1
  807. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.js +0 -141
  808. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/dist/ui/parse-stdout.js.map +0 -1
  809. package/dist/runtime/server/node_modules/@paperclipai/adapter-opencode-local/package.json +0 -42
  810. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.d.ts +0 -2
  811. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.d.ts.map +0 -1
  812. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.js +0 -99
  813. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/format-event.js.map +0 -1
  814. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.d.ts +0 -2
  815. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.d.ts.map +0 -1
  816. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.js +0 -2
  817. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/cli/index.js.map +0 -1
  818. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.d.ts +0 -8
  819. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.d.ts.map +0 -1
  820. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.js +0 -39
  821. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/index.js.map +0 -1
  822. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.d.ts +0 -3
  823. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.d.ts.map +0 -1
  824. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.js +0 -405
  825. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/execute.js.map +0 -1
  826. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.d.ts +0 -7
  827. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.d.ts.map +0 -1
  828. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.js +0 -50
  829. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/index.js.map +0 -1
  830. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.d.ts +0 -20
  831. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.d.ts.map +0 -1
  832. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.js +0 -161
  833. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.js.map +0 -1
  834. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.d.ts +0 -2
  835. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.d.ts.map +0 -1
  836. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.js +0 -22
  837. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/models.test.js.map +0 -1
  838. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.d.ts +0 -23
  839. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.d.ts.map +0 -1
  840. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.js +0 -180
  841. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.js.map +0 -1
  842. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.d.ts +0 -2
  843. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.d.ts.map +0 -1
  844. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.js +0 -206
  845. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/parse.test.js.map +0 -1
  846. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.d.ts +0 -3
  847. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.d.ts.map +0 -1
  848. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.js +0 -257
  849. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/server/test.js.map +0 -1
  850. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.d.ts +0 -3
  851. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.d.ts.map +0 -1
  852. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.js +0 -82
  853. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/build-config.js.map +0 -1
  854. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.d.ts +0 -3
  855. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.d.ts.map +0 -1
  856. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.js +0 -3
  857. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/index.js.map +0 -1
  858. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.d.ts +0 -3
  859. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.d.ts.map +0 -1
  860. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.js +0 -163
  861. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/dist/ui/parse-stdout.js.map +0 -1
  862. package/dist/runtime/server/node_modules/@paperclipai/adapter-pi-local/package.json +0 -42
  863. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.d.ts +0 -2
  864. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.d.ts.map +0 -1
  865. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.js +0 -16
  866. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.js.map +0 -1
  867. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.d.ts +0 -2
  868. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.d.ts.map +0 -1
  869. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.js +0 -14
  870. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/billing.test.js.map +0 -1
  871. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.d.ts +0 -6
  872. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.d.ts.map +0 -1
  873. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.js +0 -4
  874. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/index.js.map +0 -1
  875. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.d.ts +0 -6
  876. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.d.ts.map +0 -1
  877. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.js +0 -75
  878. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/log-redaction.js.map +0 -1
  879. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.d.ts +0 -62
  880. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.d.ts.map +0 -1
  881. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.js +0 -419
  882. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/server-utils.js.map +0 -1
  883. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.d.ts +0 -25
  884. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.d.ts.map +0 -1
  885. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.js +0 -142
  886. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/session-compaction.js.map +0 -1
  887. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.d.ts +0 -290
  888. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.d.ts.map +0 -1
  889. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.js +0 -5
  890. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/dist/types.js.map +0 -1
  891. package/dist/runtime/server/node_modules/@paperclipai/adapter-utils/package.json +0 -30
  892. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.d.ts +0 -24
  893. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.d.ts.map +0 -1
  894. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.js +0 -448
  895. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup-lib.js.map +0 -1
  896. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.d.ts +0 -2
  897. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.d.ts.map +0 -1
  898. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.js +0 -103
  899. package/dist/runtime/server/node_modules/@paperclipai/db/dist/backup.js.map +0 -1
  900. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.d.ts +0 -43
  901. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.d.ts.map +0 -1
  902. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.js +0 -574
  903. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.js.map +0 -1
  904. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.d.ts +0 -2
  905. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.d.ts.map +0 -1
  906. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.js +0 -117
  907. package/dist/runtime/server/node_modules/@paperclipai/db/dist/client.test.js.map +0 -1
  908. package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.d.ts +0 -4
  909. package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.d.ts.map +0 -1
  910. package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.js +0 -4
  911. package/dist/runtime/server/node_modules/@paperclipai/db/dist/index.js.map +0 -1
  912. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.d.ts +0 -2
  913. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.d.ts.map +0 -1
  914. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.js +0 -25
  915. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrate.js.map +0 -1
  916. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.d.ts +0 -7
  917. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.d.ts.map +0 -1
  918. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.js +0 -163
  919. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-runtime.js.map +0 -1
  920. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.d.ts +0 -2
  921. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.d.ts.map +0 -1
  922. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.js +0 -55
  923. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migration-status.js.map +0 -1
  924. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0000_mature_masked_marvel.sql +0 -208
  925. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0001_fast_northstar.sql +0 -87
  926. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0002_big_zaladane.sql +0 -1
  927. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0003_shallow_quentin_quire.sql +0 -5
  928. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0004_issue_identifiers.sql +0 -28
  929. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0005_chief_luke_cage.sql +0 -19
  930. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0006_overjoyed_mister_sinister.sql +0 -36
  931. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0007_new_quentin_quire.sql +0 -20
  932. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0008_amused_zzzax.sql +0 -1
  933. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0009_fast_jackal.sql +0 -36
  934. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0010_stale_justin_hammer.sql +0 -37
  935. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0011_windy_corsair.sql +0 -18
  936. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0012_perpetual_ser_duncan.sql +0 -2
  937. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0013_dashing_wasp.sql +0 -4
  938. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0014_many_mikhail_rasputin.sql +0 -135
  939. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0015_project_color_archived.sql +0 -2
  940. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0016_agent_icon.sql +0 -1
  941. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0017_tiresome_gabe_jones.sql +0 -51
  942. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0018_flat_sleepwalker.sql +0 -26
  943. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0019_public_victor_mancha.sql +0 -18
  944. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0020_white_anita_blake.sql +0 -1
  945. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0021_chief_vindicator.sql +0 -1
  946. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0022_company_brand_color.sql +0 -1
  947. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0023_fair_lethal_legion.sql +0 -3
  948. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0024_far_beast.sql +0 -2
  949. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0025_nasty_salo.sql +0 -15
  950. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0026_lying_pete_wisdom.sql +0 -39
  951. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0027_tranquil_tenebrous.sql +0 -2
  952. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0028_harsh_goliath.sql +0 -54
  953. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0029_plugin_tables.sql +0 -177
  954. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0030_rich_magneto.sql +0 -12
  955. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0031_zippy_magma.sql +0 -51
  956. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0032_pretty_doctor_octopus.sql +0 -102
  957. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0033_shiny_black_tarantula.sql +0 -2
  958. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0034_fat_dormammu.sql +0 -2
  959. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0035_marvelous_satana.sql +0 -91
  960. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0036_cheerful_nitro.sql +0 -9
  961. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0037_friendly_eddie_brock.sql +0 -29
  962. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0038_careless_iron_monger.sql +0 -5
  963. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0039_tickets.sql +0 -25
  964. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/0040_ticket_meta.sql +0 -3
  965. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0000_snapshot.json +0 -1743
  966. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0001_snapshot.json +0 -2441
  967. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0002_snapshot.json +0 -2454
  968. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0003_snapshot.json +0 -2502
  969. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0005_snapshot.json +0 -2719
  970. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0006_snapshot.json +0 -3048
  971. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0007_snapshot.json +0 -3258
  972. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0008_snapshot.json +0 -3264
  973. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0009_snapshot.json +0 -3587
  974. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0010_snapshot.json +0 -3929
  975. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0011_snapshot.json +0 -4068
  976. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0012_snapshot.json +0 -4087
  977. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0013_snapshot.json +0 -4118
  978. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0014_snapshot.json +0 -5187
  979. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0017_snapshot.json +0 -5215
  980. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0018_snapshot.json +0 -5450
  981. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0019_snapshot.json +0 -5603
  982. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0020_snapshot.json +0 -5603
  983. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0021_snapshot.json +0 -5609
  984. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0023_snapshot.json +0 -5633
  985. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0024_snapshot.json +0 -5693
  986. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0025_snapshot.json +0 -5849
  987. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0027_snapshot.json +0 -6205
  988. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0028_snapshot.json +0 -6710
  989. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0029_snapshot.json +0 -7899
  990. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0030_snapshot.json +0 -8003
  991. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0031_snapshot.json +0 -7242
  992. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0032_snapshot.json +0 -7733
  993. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0033_snapshot.json +0 -9038
  994. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0034_snapshot.json +0 -9039
  995. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0035_snapshot.json +0 -9959
  996. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0036_snapshot.json +0 -10023
  997. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0037_snapshot.json +0 -10263
  998. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/0038_snapshot.json +0 -10301
  999. package/dist/runtime/server/node_modules/@paperclipai/db/dist/migrations/meta/_journal.json +0 -293
  1000. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.d.ts +0 -16
  1001. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.d.ts.map +0 -1
  1002. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.js +0 -197
  1003. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.js.map +0 -1
  1004. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.d.ts +0 -2
  1005. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.d.ts.map +0 -1
  1006. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.js +0 -93
  1007. package/dist/runtime/server/node_modules/@paperclipai/db/dist/runtime-config.test.js.map +0 -1
  1008. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.d.ts +0 -197
  1009. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.d.ts.map +0 -1
  1010. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.js +0 -22
  1011. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/activity_log.js.map +0 -1
  1012. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.d.ts +0 -144
  1013. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.d.ts.map +0 -1
  1014. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.js +0 -17
  1015. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_api_keys.js.map +0 -1
  1016. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.d.ts +0 -201
  1017. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.d.ts.map +0 -1
  1018. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.js +0 -20
  1019. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_config_revisions.js.map +0 -1
  1020. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.d.ts +0 -248
  1021. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.d.ts.map +0 -1
  1022. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.js +0 -23
  1023. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_runtime_state.js.map +0 -1
  1024. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.d.ts +0 -197
  1025. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.d.ts.map +0 -1
  1026. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.js +0 -22
  1027. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_task_sessions.js.map +0 -1
  1028. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.d.ts +0 -333
  1029. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.d.ts.map +0 -1
  1030. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.js +0 -29
  1031. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agent_wakeup_requests.js.map +0 -1
  1032. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.d.ts +0 -373
  1033. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.d.ts.map +0 -1
  1034. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.js +0 -29
  1035. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/agents.js.map +0 -1
  1036. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.d.ts +0 -144
  1037. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.d.ts.map +0 -1
  1038. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.js +0 -19
  1039. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approval_comments.js.map +0 -1
  1040. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.d.ts +0 -214
  1041. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.d.ts.map +0 -1
  1042. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.js +0 -20
  1043. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/approvals.js.map +0 -1
  1044. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.d.ts +0 -212
  1045. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.d.ts.map +0 -1
  1046. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.js +0 -22
  1047. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/assets.js.map +0 -1
  1048. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.d.ts +0 -607
  1049. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.d.ts.map +0 -1
  1050. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.js +0 -44
  1051. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/auth.js.map +0 -1
  1052. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.d.ts +0 -297
  1053. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.d.ts.map +0 -1
  1054. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.js +0 -29
  1055. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_incidents.js.map +0 -1
  1056. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.d.ts +0 -263
  1057. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.d.ts.map +0 -1
  1058. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.js +0 -24
  1059. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/budget_policies.js.map +0 -1
  1060. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.d.ts +0 -246
  1061. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.d.ts.map +0 -1
  1062. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.js +0 -22
  1063. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/companies.js.map +0 -1
  1064. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.d.ts +0 -93
  1065. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.d.ts.map +0 -1
  1066. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.js +0 -14
  1067. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_logos.js.map +0 -1
  1068. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.d.ts +0 -144
  1069. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.d.ts.map +0 -1
  1070. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.js +0 -17
  1071. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_memberships.js.map +0 -1
  1072. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.d.ts +0 -163
  1073. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.d.ts.map +0 -1
  1074. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.js +0 -19
  1075. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secret_versions.js.map +0 -1
  1076. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.d.ts +0 -195
  1077. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.d.ts.map +0 -1
  1078. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.js +0 -21
  1079. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/company_secrets.js.map +0 -1
  1080. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.d.ts +0 -314
  1081. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.d.ts.map +0 -1
  1082. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.js +0 -34
  1083. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/cost_events.js.map +0 -1
  1084. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.d.ts +0 -161
  1085. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.d.ts.map +0 -1
  1086. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.js +0 -19
  1087. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/document_revisions.js.map +0 -1
  1088. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.d.ts +0 -229
  1089. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.d.ts.map +0 -1
  1090. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.js +0 -22
  1091. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/documents.js.map +0 -1
  1092. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.d.ts +0 -418
  1093. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.d.ts.map +0 -1
  1094. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.js +0 -39
  1095. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/execution_workspaces.js.map +0 -1
  1096. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.d.ts +0 -469
  1097. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.d.ts.map +0 -1
  1098. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.js +0 -45
  1099. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/finance_events.js.map +0 -1
  1100. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.d.ts +0 -178
  1101. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.d.ts.map +0 -1
  1102. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.js +0 -18
  1103. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/goals.js.map +0 -1
  1104. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.d.ts +0 -214
  1105. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.d.ts.map +0 -1
  1106. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.js +0 -23
  1107. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_run_events.js.map +0 -1
  1108. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.d.ts +0 -558
  1109. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.d.ts.map +0 -1
  1110. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.js +0 -43
  1111. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/heartbeat_runs.js.map +0 -1
  1112. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.d.ts +0 -55
  1113. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.d.ts.map +0 -1
  1114. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.js +0 -55
  1115. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/index.js.map +0 -1
  1116. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.d.ts +0 -95
  1117. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.d.ts.map +0 -1
  1118. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.js +0 -11
  1119. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_settings.js.map +0 -1
  1120. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.d.ts +0 -93
  1121. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.d.ts.map +0 -1
  1122. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.js +0 -12
  1123. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/instance_user_roles.js.map +0 -1
  1124. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.d.ts +0 -214
  1125. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.d.ts.map +0 -1
  1126. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.js +0 -20
  1127. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/invites.js.map +0 -1
  1128. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.d.ts +0 -110
  1129. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.d.ts.map +0 -1
  1130. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.js +0 -19
  1131. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_approvals.js.map +0 -1
  1132. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.d.ts +0 -127
  1133. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.d.ts.map +0 -1
  1134. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.js +0 -19
  1135. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_attachments.js.map +0 -1
  1136. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.d.ts +0 -144
  1137. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.d.ts.map +0 -1
  1138. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.js +0 -20
  1139. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_comments.js.map +0 -1
  1140. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.d.ts +0 -127
  1141. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.d.ts.map +0 -1
  1142. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.js +0 -18
  1143. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_documents.js.map +0 -1
  1144. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.d.ts +0 -76
  1145. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.d.ts.map +0 -1
  1146. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.js +0 -16
  1147. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_labels.js.map +0 -1
  1148. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.d.ts +0 -127
  1149. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.d.ts.map +0 -1
  1150. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.js +0 -17
  1151. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_read_states.js.map +0 -1
  1152. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.d.ts +0 -350
  1153. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.d.ts.map +0 -1
  1154. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.js +0 -37
  1155. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issue_work_products.js.map +0 -1
  1156. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.d.ts +0 -590
  1157. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.d.ts.map +0 -1
  1158. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.js +0 -58
  1159. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/issues.js.map +0 -1
  1160. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.d.ts +0 -384
  1161. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.d.ts.map +0 -1
  1162. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.js +0 -32
  1163. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/join_requests.js.map +0 -1
  1164. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.d.ts +0 -110
  1165. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.d.ts.map +0 -1
  1166. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.js +0 -14
  1167. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/labels.js.map +0 -1
  1168. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.d.ts +0 -158
  1169. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.d.ts.map +0 -1
  1170. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.js +0 -34
  1171. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_company_settings.js.map +0 -1
  1172. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.d.ts +0 -123
  1173. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.d.ts.map +0 -1
  1174. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.js +0 -26
  1175. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_config.js.map +0 -1
  1176. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.d.ts +0 -213
  1177. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.d.ts.map +0 -1
  1178. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.js +0 -37
  1179. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_entities.js.map +0 -1
  1180. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.d.ts +0 -392
  1181. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.d.ts.map +0 -1
  1182. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.js +0 -83
  1183. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_jobs.js.map +0 -1
  1184. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.d.ts +0 -125
  1185. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.d.ts.map +0 -1
  1186. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.js +0 -29
  1187. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_logs.js.map +0 -1
  1188. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.d.ts +0 -169
  1189. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.d.ts.map +0 -1
  1190. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.js +0 -68
  1191. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_state.js.map +0 -1
  1192. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.d.ts +0 -239
  1193. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.d.ts.map +0 -1
  1194. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.js +0 -52
  1195. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugin_webhooks.js.map +0 -1
  1196. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.d.ts +0 -246
  1197. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.d.ts.map +0 -1
  1198. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.js +0 -31
  1199. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/plugins.js.map +0 -1
  1200. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.d.ts +0 -163
  1201. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.d.ts.map +0 -1
  1202. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.js +0 -17
  1203. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/principal_permission_grants.js.map +0 -1
  1204. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.d.ts +0 -93
  1205. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.d.ts.map +0 -1
  1206. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.js +0 -17
  1207. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_goals.js.map +0 -1
  1208. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.d.ts +0 -333
  1209. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.d.ts.map +0 -1
  1210. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.js +0 -32
  1211. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/project_workspaces.js.map +0 -1
  1212. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.d.ts +0 -265
  1213. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.d.ts.map +0 -1
  1214. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.js +0 -24
  1215. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/projects.js.map +0 -1
  1216. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.d.ts +0 -284
  1217. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.d.ts.map +0 -1
  1218. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.js +0 -24
  1219. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/tickets.js.map +0 -1
  1220. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.d.ts +0 -367
  1221. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.d.ts.map +0 -1
  1222. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.js +0 -35
  1223. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_operations.js.map +0 -1
  1224. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.d.ts +0 -469
  1225. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.d.ts.map +0 -1
  1226. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.js +0 -44
  1227. package/dist/runtime/server/node_modules/@paperclipai/db/dist/schema/workspace_runtime_services.js.map +0 -1
  1228. package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.d.ts +0 -2
  1229. package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.d.ts.map +0 -1
  1230. package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.js +0 -91
  1231. package/dist/runtime/server/node_modules/@paperclipai/db/dist/seed.js.map +0 -1
  1232. package/dist/runtime/server/node_modules/@paperclipai/db/package.json +0 -36
  1233. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.d.ts +0 -57
  1234. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.d.ts.map +0 -1
  1235. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.js +0 -105
  1236. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/bundlers.js.map +0 -1
  1237. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.d.ts +0 -218
  1238. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.d.ts.map +0 -1
  1239. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.js +0 -85
  1240. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/define-plugin.js.map +0 -1
  1241. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.d.ts +0 -3
  1242. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.d.ts.map +0 -1
  1243. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.js +0 -49
  1244. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-cli.js.map +0 -1
  1245. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.d.ts +0 -34
  1246. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.d.ts.map +0 -1
  1247. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.js +0 -194
  1248. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/dev-server.js.map +0 -1
  1249. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.d.ts +0 -229
  1250. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.d.ts.map +0 -1
  1251. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.js +0 -353
  1252. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/host-client-factory.js.map +0 -1
  1253. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.d.ts +0 -84
  1254. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.d.ts.map +0 -1
  1255. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.js +0 -84
  1256. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/index.js.map +0 -1
  1257. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.d.ts +0 -881
  1258. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.d.ts.map +0 -1
  1259. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.js +0 -297
  1260. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/protocol.js.map +0 -1
  1261. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.d.ts +0 -63
  1262. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.d.ts.map +0 -1
  1263. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.js +0 -702
  1264. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/testing.js.map +0 -1
  1265. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.d.ts +0 -982
  1266. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.d.ts.map +0 -1
  1267. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.js +0 -12
  1268. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/types.js.map +0 -1
  1269. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.d.ts +0 -257
  1270. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.d.ts.map +0 -1
  1271. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.js +0 -97
  1272. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/components.js.map +0 -1
  1273. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.d.ts +0 -120
  1274. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.d.ts.map +0 -1
  1275. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.js +0 -148
  1276. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/hooks.js.map +0 -1
  1277. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.d.ts +0 -50
  1278. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.d.ts.map +0 -1
  1279. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.js +0 -48
  1280. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/index.js.map +0 -1
  1281. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.d.ts +0 -3
  1282. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.d.ts.map +0 -1
  1283. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.js +0 -30
  1284. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/runtime.js.map +0 -1
  1285. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.d.ts +0 -308
  1286. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.d.ts.map +0 -1
  1287. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.js +0 -17
  1288. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/ui/types.js.map +0 -1
  1289. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.d.ts +0 -127
  1290. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.d.ts.map +0 -1
  1291. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.js +0 -941
  1292. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/dist/worker-rpc-host.js.map +0 -1
  1293. package/dist/runtime/server/node_modules/@paperclipai/plugin-sdk/package.json +0 -74
  1294. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.d.ts +0 -4
  1295. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.d.ts.map +0 -1
  1296. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.js +0 -22
  1297. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/agent-url-key.js.map +0 -1
  1298. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.d.ts +0 -20
  1299. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.d.ts.map +0 -1
  1300. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.js +0 -20
  1301. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/api.js.map +0 -1
  1302. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.d.ts +0 -725
  1303. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.d.ts.map +0 -1
  1304. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.js +0 -151
  1305. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/config-schema.js.map +0 -1
  1306. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.d.ts +0 -214
  1307. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.d.ts.map +0 -1
  1308. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.js +0 -553
  1309. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/constants.js.map +0 -1
  1310. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.d.ts +0 -116
  1311. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.d.ts.map +0 -1
  1312. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.js +0 -181
  1313. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/gtm.js.map +0 -1
  1314. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.d.ts +0 -12
  1315. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.d.ts.map +0 -1
  1316. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.js +0 -11
  1317. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/index.js.map +0 -1
  1318. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.d.ts +0 -9
  1319. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.d.ts.map +0 -1
  1320. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.js +0 -71
  1321. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-mentions.js.map +0 -1
  1322. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.d.ts +0 -3
  1323. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.d.ts.map +0 -1
  1324. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.js +0 -16
  1325. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/project-url-key.js.map +0 -1
  1326. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.d.ts +0 -15
  1327. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.d.ts.map +0 -1
  1328. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.js +0 -40
  1329. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/surface-runtime.js.map +0 -1
  1330. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.d.ts +0 -67
  1331. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.d.ts.map +0 -1
  1332. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.js +0 -2
  1333. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/access.js.map +0 -1
  1334. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.d.ts +0 -14
  1335. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.d.ts.map +0 -1
  1336. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.js +0 -2
  1337. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/activity.js.map +0 -1
  1338. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.d.ts +0 -80
  1339. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.d.ts.map +0 -1
  1340. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.js +0 -2
  1341. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/agent.js.map +0 -1
  1342. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.d.ts +0 -26
  1343. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.d.ts.map +0 -1
  1344. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.js +0 -2
  1345. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/approval.js.map +0 -1
  1346. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.d.ts +0 -16
  1347. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.d.ts.map +0 -1
  1348. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.js +0 -2
  1349. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/asset.js.map +0 -1
  1350. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.d.ts +0 -86
  1351. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.d.ts.map +0 -1
  1352. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.js +0 -2
  1353. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/budget.js.map +0 -1
  1354. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.d.ts +0 -120
  1355. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.d.ts.map +0 -1
  1356. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.js +0 -2
  1357. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company-portability.js.map +0 -1
  1358. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.d.ts +0 -20
  1359. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.d.ts.map +0 -1
  1360. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.js +0 -2
  1361. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/company.js.map +0 -1
  1362. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.d.ts +0 -106
  1363. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.d.ts.map +0 -1
  1364. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.js +0 -2
  1365. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/cost.js.map +0 -1
  1366. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.d.ts +0 -28
  1367. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.d.ts.map +0 -1
  1368. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.js +0 -2
  1369. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/dashboard.js.map +0 -1
  1370. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.d.ts +0 -57
  1371. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.d.ts.map +0 -1
  1372. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.js +0 -2
  1373. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/finance.js.map +0 -1
  1374. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.d.ts +0 -14
  1375. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.d.ts.map +0 -1
  1376. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.js +0 -2
  1377. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/goal.js.map +0 -1
  1378. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.d.ts +0 -118
  1379. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.d.ts.map +0 -1
  1380. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.js +0 -2
  1381. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/heartbeat.js.map +0 -1
  1382. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.d.ts +0 -26
  1383. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.d.ts.map +0 -1
  1384. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.js +0 -2
  1385. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/index.js.map +0 -1
  1386. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.d.ts +0 -10
  1387. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.d.ts.map +0 -1
  1388. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.js +0 -2
  1389. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/instance.js.map +0 -1
  1390. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.d.ts +0 -164
  1391. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.d.ts.map +0 -1
  1392. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.js +0 -2
  1393. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/issue.js.map +0 -1
  1394. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.d.ts +0 -9
  1395. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.d.ts.map +0 -1
  1396. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.js +0 -2
  1397. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/live.js.map +0 -1
  1398. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.d.ts +0 -419
  1399. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.d.ts.map +0 -1
  1400. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.js +0 -2
  1401. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/plugin.js.map +0 -1
  1402. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.d.ts +0 -67
  1403. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.d.ts.map +0 -1
  1404. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.js +0 -2
  1405. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/project.js.map +0 -1
  1406. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.d.ts +0 -26
  1407. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.d.ts.map +0 -1
  1408. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.js +0 -2
  1409. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/quota.js.map +0 -1
  1410. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.d.ts +0 -32
  1411. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.d.ts.map +0 -1
  1412. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.js +0 -2
  1413. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/secrets.js.map +0 -1
  1414. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.d.ts +0 -7
  1415. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.d.ts.map +0 -1
  1416. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.js +0 -2
  1417. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/sidebar-badges.js.map +0 -1
  1418. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.d.ts +0 -26
  1419. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.d.ts.map +0 -1
  1420. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.js +0 -2
  1421. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/ticket.js.map +0 -1
  1422. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.d.ts +0 -27
  1423. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.d.ts.map +0 -1
  1424. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.js +0 -2
  1425. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/work-product.js.map +0 -1
  1426. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.d.ts +0 -26
  1427. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.d.ts.map +0 -1
  1428. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.js +0 -2
  1429. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-operation.js.map +0 -1
  1430. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.d.ts +0 -86
  1431. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.d.ts.map +0 -1
  1432. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.js +0 -2
  1433. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/types/workspace-runtime.js.map +0 -1
  1434. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.d.ts +0 -109
  1435. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.d.ts.map +0 -1
  1436. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.js +0 -40
  1437. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/access.js.map +0 -1
  1438. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.d.ts +0 -235
  1439. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.d.ts.map +0 -1
  1440. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.js +0 -71
  1441. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/agent.js.map +0 -1
  1442. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.d.ts +0 -57
  1443. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.d.ts.map +0 -1
  1444. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.js +0 -23
  1445. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/approval.js.map +0 -1
  1446. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.d.ts +0 -10
  1447. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.d.ts.map +0 -1
  1448. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.js +0 -11
  1449. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/asset.js.map +0 -1
  1450. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.d.ts +0 -56
  1451. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.d.ts.map +0 -1
  1452. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.js +0 -27
  1453. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/budget.js.map +0 -1
  1454. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.d.ts +0 -1535
  1455. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.d.ts.map +0 -1
  1456. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.js +0 -95
  1457. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company-portability.js.map +0 -1
  1458. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.d.ts +0 -64
  1459. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.d.ts.map +0 -1
  1460. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.js +0 -25
  1461. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/company.js.map +0 -1
  1462. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.d.ts +0 -92
  1463. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.d.ts.map +0 -1
  1464. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.js +0 -26
  1465. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/cost.js.map +0 -1
  1466. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.d.ts +0 -20
  1467. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.d.ts.map +0 -1
  1468. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.js +0 -15
  1469. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/execution-workspace.js.map +0 -1
  1470. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.d.ts +0 -129
  1471. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.d.ts.map +0 -1
  1472. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.js +0 -32
  1473. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/finance.js.map +0 -1
  1474. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.d.ts +0 -48
  1475. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.d.ts.map +0 -1
  1476. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.js +0 -12
  1477. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/goal.js.map +0 -1
  1478. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.d.ts +0 -19
  1479. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.d.ts.map +0 -1
  1480. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.js +0 -19
  1481. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/index.js.map +0 -1
  1482. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.d.ts +0 -18
  1483. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.d.ts.map +0 -1
  1484. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.js +0 -6
  1485. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/instance.js.map +0 -1
  1486. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.d.ts +0 -656
  1487. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.d.ts.map +0 -1
  1488. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.js +0 -95
  1489. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/issue.js.map +0 -1
  1490. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.d.ts +0 -1173
  1491. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.d.ts.map +0 -1
  1492. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.js +0 -547
  1493. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/plugin.js.map +0 -1
  1494. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.d.ts +0 -583
  1495. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.d.ts.map +0 -1
  1496. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.js +0 -93
  1497. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/project.js.map +0 -1
  1498. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.d.ts +0 -114
  1499. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.d.ts.map +0 -1
  1500. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.js +0 -35
  1501. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/secret.js.map +0 -1
  1502. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.d.ts +0 -56
  1503. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.d.ts.map +0 -1
  1504. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.js +0 -22
  1505. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/ticket.js.map +0 -1
  1506. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.d.ts +0 -105
  1507. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.d.ts.map +0 -1
  1508. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.js +0 -46
  1509. package/dist/runtime/server/node_modules/@paperclipai/shared/dist/validators/work-product.js.map +0 -1
  1510. package/dist/runtime/server/node_modules/@paperclipai/shared/package.json +0 -33
  1511. package/dist/runtime/server/package.json +0 -5
  1512. package/dist/runtime/server/ui-dist/android-chrome-192x192.png +0 -0
  1513. package/dist/runtime/server/ui-dist/android-chrome-512x512.png +0 -0
  1514. package/dist/runtime/server/ui-dist/apple-touch-icon.png +0 -0
  1515. package/dist/runtime/server/ui-dist/assets/OnboardingWizard-BiZHH3vY.js +0 -834
  1516. package/dist/runtime/server/ui-dist/assets/_basePickBy-DOJDGGWo.js +0 -1
  1517. package/dist/runtime/server/ui-dist/assets/_baseUniq-DjoWC9VG.js +0 -1
  1518. package/dist/runtime/server/ui-dist/assets/apl-B4CMkyY2.js +0 -1
  1519. package/dist/runtime/server/ui-dist/assets/arc-DzAhgPuQ.js +0 -1
  1520. package/dist/runtime/server/ui-dist/assets/architectureDiagram-VXUJARFQ-CFxoZ9U1.js +0 -36
  1521. package/dist/runtime/server/ui-dist/assets/asciiarmor-Df11BRmG.js +0 -1
  1522. package/dist/runtime/server/ui-dist/assets/asn1-EdZsLKOL.js +0 -1
  1523. package/dist/runtime/server/ui-dist/assets/asterisk-B-8jnY81.js +0 -1
  1524. package/dist/runtime/server/ui-dist/assets/blockDiagram-VD42YOAC-CmcNReYb.js +0 -122
  1525. package/dist/runtime/server/ui-dist/assets/brainfuck-C4LP7Hcl.js +0 -1
  1526. package/dist/runtime/server/ui-dist/assets/c4Diagram-YG6GDRKO-62g03z24.js +0 -10
  1527. package/dist/runtime/server/ui-dist/assets/channel-CyMiLt_6.js +0 -1
  1528. package/dist/runtime/server/ui-dist/assets/chunk-4BX2VUAB-DdKgkZWf.js +0 -1
  1529. package/dist/runtime/server/ui-dist/assets/chunk-55IACEB6-BG61sDBH.js +0 -1
  1530. package/dist/runtime/server/ui-dist/assets/chunk-B4BG7PRW-jHjDOzs3.js +0 -165
  1531. package/dist/runtime/server/ui-dist/assets/chunk-DI55MBZ5-QWOEgAft.js +0 -220
  1532. package/dist/runtime/server/ui-dist/assets/chunk-FMBD7UC4-BTtsDCBm.js +0 -15
  1533. package/dist/runtime/server/ui-dist/assets/chunk-QN33PNHL-DQ0G5mTp.js +0 -1
  1534. package/dist/runtime/server/ui-dist/assets/chunk-QZHKN3VN-CwD654Gq.js +0 -1
  1535. package/dist/runtime/server/ui-dist/assets/chunk-TZMSLE5B-BW4AfItk.js +0 -1
  1536. package/dist/runtime/server/ui-dist/assets/classDiagram-2ON5EDUG-Bpt4jbt_.js +0 -1
  1537. package/dist/runtime/server/ui-dist/assets/classDiagram-v2-WZHVMYZB-Bpt4jbt_.js +0 -1
  1538. package/dist/runtime/server/ui-dist/assets/clike-B9uivgTg.js +0 -1
  1539. package/dist/runtime/server/ui-dist/assets/clojure-BMjYHr_A.js +0 -1
  1540. package/dist/runtime/server/ui-dist/assets/clone-C1pAl4cM.js +0 -1
  1541. package/dist/runtime/server/ui-dist/assets/cmake-BQqOBYOt.js +0 -1
  1542. package/dist/runtime/server/ui-dist/assets/cobol-CWcv1MsR.js +0 -1
  1543. package/dist/runtime/server/ui-dist/assets/coffeescript-S37ZYGWr.js +0 -1
  1544. package/dist/runtime/server/ui-dist/assets/commonlisp-DBKNyK5s.js +0 -1
  1545. package/dist/runtime/server/ui-dist/assets/cose-bilkent-S5V4N54A-Cl5X2jL8.js +0 -1
  1546. package/dist/runtime/server/ui-dist/assets/crystal-SjHAIU92.js +0 -1
  1547. package/dist/runtime/server/ui-dist/assets/css-BnMrqG3P.js +0 -1
  1548. package/dist/runtime/server/ui-dist/assets/cypher-C_CwsFkJ.js +0 -1
  1549. package/dist/runtime/server/ui-dist/assets/cytoscape.esm-BQaXIfA_.js +0 -331
  1550. package/dist/runtime/server/ui-dist/assets/d-pRatUO7H.js +0 -1
  1551. package/dist/runtime/server/ui-dist/assets/dagre-6UL2VRFP-B2u9a5zG.js +0 -4
  1552. package/dist/runtime/server/ui-dist/assets/defaultLocale-DX6XiGOO.js +0 -1
  1553. package/dist/runtime/server/ui-dist/assets/diagram-PSM6KHXK-DsSVNioI.js +0 -24
  1554. package/dist/runtime/server/ui-dist/assets/diagram-QEK2KX5R-C2oaCik_.js +0 -43
  1555. package/dist/runtime/server/ui-dist/assets/diagram-S2PKOQOG-CuEvUbkw.js +0 -24
  1556. package/dist/runtime/server/ui-dist/assets/diff-DbItnlRl.js +0 -1
  1557. package/dist/runtime/server/ui-dist/assets/dockerfile-BKs6k2Af.js +0 -1
  1558. package/dist/runtime/server/ui-dist/assets/dtd-DF_7sFjM.js +0 -1
  1559. package/dist/runtime/server/ui-dist/assets/dx-root-B5r5o3mh.js +0 -280
  1560. package/dist/runtime/server/ui-dist/assets/dylan-DwRh75JA.js +0 -1
  1561. package/dist/runtime/server/ui-dist/assets/ebnf-CDyGwa7X.js +0 -1
  1562. package/dist/runtime/server/ui-dist/assets/ecl-Cabwm37j.js +0 -1
  1563. package/dist/runtime/server/ui-dist/assets/eiffel-CnydiIhH.js +0 -1
  1564. package/dist/runtime/server/ui-dist/assets/elm-vLlmbW-K.js +0 -1
  1565. package/dist/runtime/server/ui-dist/assets/erDiagram-Q2GNP2WA-_1lFdkqV.js +0 -60
  1566. package/dist/runtime/server/ui-dist/assets/erlang-BNw1qcRV.js +0 -1
  1567. package/dist/runtime/server/ui-dist/assets/factor-kuTfRLto.js +0 -1
  1568. package/dist/runtime/server/ui-dist/assets/fcl-Kvtd6kyn.js +0 -1
  1569. package/dist/runtime/server/ui-dist/assets/flowDiagram-NV44I4VS-DUoF0DLT.js +0 -162
  1570. package/dist/runtime/server/ui-dist/assets/forth-Ffai-XNe.js +0 -1
  1571. package/dist/runtime/server/ui-dist/assets/fortran-DYz_wnZ1.js +0 -1
  1572. package/dist/runtime/server/ui-dist/assets/ganttDiagram-JELNMOA3-CruQ7D3m.js +0 -267
  1573. package/dist/runtime/server/ui-dist/assets/gas-Bneqetm1.js +0 -1
  1574. package/dist/runtime/server/ui-dist/assets/gherkin-heZmZLOM.js +0 -1
  1575. package/dist/runtime/server/ui-dist/assets/gitGraphDiagram-V2S2FVAM-BDuS9ljz.js +0 -65
  1576. package/dist/runtime/server/ui-dist/assets/graph-BFy59M3M.js +0 -1
  1577. package/dist/runtime/server/ui-dist/assets/groovy-D9Dt4D0W.js +0 -1
  1578. package/dist/runtime/server/ui-dist/assets/gtm-root-bgiNL285.js +0 -11
  1579. package/dist/runtime/server/ui-dist/assets/haskell-Cw1EW3IL.js +0 -1
  1580. package/dist/runtime/server/ui-dist/assets/haxe-H-WmDvRZ.js +0 -1
  1581. package/dist/runtime/server/ui-dist/assets/http-DBlCnlav.js +0 -1
  1582. package/dist/runtime/server/ui-dist/assets/idl-BEugSyMb.js +0 -1
  1583. package/dist/runtime/server/ui-dist/assets/index--dv-yDMD.js +0 -1
  1584. package/dist/runtime/server/ui-dist/assets/index-A_Utfb1G.js +0 -1
  1585. package/dist/runtime/server/ui-dist/assets/index-AaLnuKvn.js +0 -1
  1586. package/dist/runtime/server/ui-dist/assets/index-B9Xd_vMV.js +0 -3
  1587. package/dist/runtime/server/ui-dist/assets/index-BCphYMJ8.js +0 -1
  1588. package/dist/runtime/server/ui-dist/assets/index-BKO_Nk8c.js +0 -7
  1589. package/dist/runtime/server/ui-dist/assets/index-BMwN19Gi.js +0 -2
  1590. package/dist/runtime/server/ui-dist/assets/index-Bz0rSFov.js +0 -1
  1591. package/dist/runtime/server/ui-dist/assets/index-BzNjBEzf.js +0 -1
  1592. package/dist/runtime/server/ui-dist/assets/index-CLWYCHoS.js +0 -1
  1593. package/dist/runtime/server/ui-dist/assets/index-CZVyxyFA.js +0 -1
  1594. package/dist/runtime/server/ui-dist/assets/index-ClbnJMz6.css +0 -1
  1595. package/dist/runtime/server/ui-dist/assets/index-Cpqm25YS.js +0 -1
  1596. package/dist/runtime/server/ui-dist/assets/index-Cv5ClxEP.js +0 -1
  1597. package/dist/runtime/server/ui-dist/assets/index-D2MHxpCH.js +0 -50
  1598. package/dist/runtime/server/ui-dist/assets/index-D3MPbMGr.js +0 -1
  1599. package/dist/runtime/server/ui-dist/assets/index-DFUgoz9_.js +0 -1
  1600. package/dist/runtime/server/ui-dist/assets/index-DL95rih-.js +0 -1
  1601. package/dist/runtime/server/ui-dist/assets/index-DY60bSWi.js +0 -1
  1602. package/dist/runtime/server/ui-dist/assets/index-DcoQC6ia.js +0 -13
  1603. package/dist/runtime/server/ui-dist/assets/index-DfnTp5y6.js +0 -6
  1604. package/dist/runtime/server/ui-dist/assets/index-Fb7iEaRG.js +0 -1
  1605. package/dist/runtime/server/ui-dist/assets/index-TPJ_0VD8.js +0 -1
  1606. package/dist/runtime/server/ui-dist/assets/index-WuexBBBr.js +0 -1
  1607. package/dist/runtime/server/ui-dist/assets/infoDiagram-HS3SLOUP-CiI6r25R.js +0 -2
  1608. package/dist/runtime/server/ui-dist/assets/init-Gi6I4Gst.js +0 -1
  1609. package/dist/runtime/server/ui-dist/assets/javascript-iXu5QeM3.js +0 -1
  1610. package/dist/runtime/server/ui-dist/assets/journeyDiagram-XKPGCS4Q-BMmOHrov.js +0 -139
  1611. package/dist/runtime/server/ui-dist/assets/julia-DuME0IfC.js +0 -1
  1612. package/dist/runtime/server/ui-dist/assets/kanban-definition-3W4ZIXB7-BxeYeVi1.js +0 -89
  1613. package/dist/runtime/server/ui-dist/assets/katex-O9d3_IXG.js +0 -261
  1614. package/dist/runtime/server/ui-dist/assets/layout-anG6DZ8y.js +0 -1
  1615. package/dist/runtime/server/ui-dist/assets/linear-CDTAlHE-.js +0 -1
  1616. package/dist/runtime/server/ui-dist/assets/livescript-BwQOo05w.js +0 -1
  1617. package/dist/runtime/server/ui-dist/assets/lua-BgMRiT3U.js +0 -1
  1618. package/dist/runtime/server/ui-dist/assets/mathematica-DTrFuWx2.js +0 -1
  1619. package/dist/runtime/server/ui-dist/assets/mbox-CNhZ1qSd.js +0 -1
  1620. package/dist/runtime/server/ui-dist/assets/mermaid.core-DNt7uRm5.js +0 -256
  1621. package/dist/runtime/server/ui-dist/assets/mindmap-definition-VGOIOE7T-DTO5b9so.js +0 -68
  1622. package/dist/runtime/server/ui-dist/assets/mirc-CjQqDB4T.js +0 -1
  1623. package/dist/runtime/server/ui-dist/assets/mllike-CXdrOF99.js +0 -1
  1624. package/dist/runtime/server/ui-dist/assets/modelica-Dc1JOy9r.js +0 -1
  1625. package/dist/runtime/server/ui-dist/assets/mscgen-BA5vi2Kp.js +0 -1
  1626. package/dist/runtime/server/ui-dist/assets/mumps-BT43cFF4.js +0 -1
  1627. package/dist/runtime/server/ui-dist/assets/nginx-DdIZxoE0.js +0 -1
  1628. package/dist/runtime/server/ui-dist/assets/nsis-LdVXkNf5.js +0 -1
  1629. package/dist/runtime/server/ui-dist/assets/ntriples-BfvgReVJ.js +0 -1
  1630. package/dist/runtime/server/ui-dist/assets/octave-Ck1zUtKM.js +0 -1
  1631. package/dist/runtime/server/ui-dist/assets/ordinal-Cboi1Yqb.js +0 -1
  1632. package/dist/runtime/server/ui-dist/assets/oz-BzwKVEFT.js +0 -1
  1633. package/dist/runtime/server/ui-dist/assets/pascal--L3eBynH.js +0 -1
  1634. package/dist/runtime/server/ui-dist/assets/perl-CdXCOZ3F.js +0 -1
  1635. package/dist/runtime/server/ui-dist/assets/pieDiagram-ADFJNKIX-BteTAzPn.js +0 -30
  1636. package/dist/runtime/server/ui-dist/assets/pig-CevX1Tat.js +0 -1
  1637. package/dist/runtime/server/ui-dist/assets/powershell-CFHJl5sT.js +0 -1
  1638. package/dist/runtime/server/ui-dist/assets/properties-C78fOPTZ.js +0 -1
  1639. package/dist/runtime/server/ui-dist/assets/protobuf-ChK-085T.js +0 -1
  1640. package/dist/runtime/server/ui-dist/assets/pug-DeIclll2.js +0 -1
  1641. package/dist/runtime/server/ui-dist/assets/puppet-DMA9R1ak.js +0 -1
  1642. package/dist/runtime/server/ui-dist/assets/python-BuPzkPfP.js +0 -1
  1643. package/dist/runtime/server/ui-dist/assets/q-pXgVlZs6.js +0 -1
  1644. package/dist/runtime/server/ui-dist/assets/quadrantDiagram-AYHSOK5B-_gG2aKm4.js +0 -7
  1645. package/dist/runtime/server/ui-dist/assets/r-B6wPVr8A.js +0 -1
  1646. package/dist/runtime/server/ui-dist/assets/requirementDiagram-UZGBJVZJ-CcOvI4e8.js +0 -64
  1647. package/dist/runtime/server/ui-dist/assets/rpm-CTu-6PCP.js +0 -1
  1648. package/dist/runtime/server/ui-dist/assets/ruby-B2Rjki9n.js +0 -1
  1649. package/dist/runtime/server/ui-dist/assets/sankeyDiagram-TZEHDZUN-C1Rbdzvp.js +0 -10
  1650. package/dist/runtime/server/ui-dist/assets/sas-B4kiWyti.js +0 -1
  1651. package/dist/runtime/server/ui-dist/assets/scheme-C41bIUwD.js +0 -1
  1652. package/dist/runtime/server/ui-dist/assets/sequenceDiagram-WL72ISMW-DPx4fWtG.js +0 -145
  1653. package/dist/runtime/server/ui-dist/assets/shell-CjFT_Tl9.js +0 -1
  1654. package/dist/runtime/server/ui-dist/assets/sieve-C3Gn_uJK.js +0 -1
  1655. package/dist/runtime/server/ui-dist/assets/simple-mode-GW_nhZxv.js +0 -1
  1656. package/dist/runtime/server/ui-dist/assets/smalltalk-CnHTOXQT.js +0 -1
  1657. package/dist/runtime/server/ui-dist/assets/solr-DehyRSwq.js +0 -1
  1658. package/dist/runtime/server/ui-dist/assets/sparql-DkYu6x3z.js +0 -1
  1659. package/dist/runtime/server/ui-dist/assets/spreadsheet-BCZA_wO0.js +0 -1
  1660. package/dist/runtime/server/ui-dist/assets/sql-D0XecflT.js +0 -1
  1661. package/dist/runtime/server/ui-dist/assets/stateDiagram-FKZM4ZOC-CID-77J9.js +0 -1
  1662. package/dist/runtime/server/ui-dist/assets/stateDiagram-v2-4FDKWEC3-DF70krIP.js +0 -1
  1663. package/dist/runtime/server/ui-dist/assets/stex-C3f8Ysf7.js +0 -1
  1664. package/dist/runtime/server/ui-dist/assets/stylus-B533Al4x.js +0 -1
  1665. package/dist/runtime/server/ui-dist/assets/swift-BzpIVaGY.js +0 -1
  1666. package/dist/runtime/server/ui-dist/assets/tcl-DVfN8rqt.js +0 -1
  1667. package/dist/runtime/server/ui-dist/assets/textile-CnDTJFAw.js +0 -1
  1668. package/dist/runtime/server/ui-dist/assets/tiddlywiki-DO-Gjzrf.js +0 -1
  1669. package/dist/runtime/server/ui-dist/assets/tiki-DGYXhP31.js +0 -1
  1670. package/dist/runtime/server/ui-dist/assets/timeline-definition-IT6M3QCI-CyA1h3jY.js +0 -61
  1671. package/dist/runtime/server/ui-dist/assets/toml-Bm5Em-hy.js +0 -1
  1672. package/dist/runtime/server/ui-dist/assets/treemap-GDKQZRPO-nqrXf2kh.js +0 -162
  1673. package/dist/runtime/server/ui-dist/assets/troff-wAsdV37c.js +0 -1
  1674. package/dist/runtime/server/ui-dist/assets/ttcn-CfJYG6tj.js +0 -1
  1675. package/dist/runtime/server/ui-dist/assets/ttcn-cfg-B9xdYoR4.js +0 -1
  1676. package/dist/runtime/server/ui-dist/assets/turtle-B1tBg_DP.js +0 -1
  1677. package/dist/runtime/server/ui-dist/assets/vb-CmGdzxic.js +0 -1
  1678. package/dist/runtime/server/ui-dist/assets/vbscript-BuJXcnF6.js +0 -1
  1679. package/dist/runtime/server/ui-dist/assets/velocity-D8B20fx6.js +0 -1
  1680. package/dist/runtime/server/ui-dist/assets/verilog-C6RDOZhf.js +0 -1
  1681. package/dist/runtime/server/ui-dist/assets/vhdl-lSbBsy5d.js +0 -1
  1682. package/dist/runtime/server/ui-dist/assets/webidl-ZXfAyPTL.js +0 -1
  1683. package/dist/runtime/server/ui-dist/assets/xquery-DzFWVndE.js +0 -1
  1684. package/dist/runtime/server/ui-dist/assets/xychartDiagram-PRI3JC2R-CS0bUj41.js +0 -7
  1685. package/dist/runtime/server/ui-dist/assets/yacas-BJ4BC0dw.js +0 -1
  1686. package/dist/runtime/server/ui-dist/assets/z80-Hz9HOZM7.js +0 -1
  1687. package/dist/runtime/server/ui-dist/brands/opencode-logo-dark-square.svg +0 -18
  1688. package/dist/runtime/server/ui-dist/brands/opencode-logo-light-square.svg +0 -18
  1689. package/dist/runtime/server/ui-dist/favicon-16x16.png +0 -0
  1690. package/dist/runtime/server/ui-dist/favicon-32x32.png +0 -0
  1691. package/dist/runtime/server/ui-dist/favicon.ico +0 -0
  1692. package/dist/runtime/server/ui-dist/favicon.svg +0 -9
  1693. package/dist/runtime/server/ui-dist/index.html +0 -48
  1694. package/dist/runtime/server/ui-dist/site.webmanifest +0 -30
  1695. package/dist/runtime/server/ui-dist/sw.js +0 -42
  1696. package/dist/runtime/server/ui-dist/worktree-favicon-16x16.png +0 -0
  1697. package/dist/runtime/server/ui-dist/worktree-favicon-32x32.png +0 -0
  1698. package/dist/runtime/server/ui-dist/worktree-favicon.ico +0 -0
  1699. package/dist/runtime/server/ui-dist/worktree-favicon.svg +0 -9
@@ -1,3046 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- import { execFile as execFileCallback } from "node:child_process";
4
- import { promisify } from "node:util";
5
- import { and, asc, desc, eq, gt, inArray, sql } from "drizzle-orm";
6
- import { agents, agentRuntimeState, agentTaskSessions, agentWakeupRequests, heartbeatRunEvents, heartbeatRuns, issues, projects, projectWorkspaces, } from "@paperclipai/db";
7
- import { conflict, notFound } from "../errors.js";
8
- import { logger } from "../middleware/logger.js";
9
- import { publishLiveEvent } from "./live-events.js";
10
- import { getRunLogStore } from "./run-log-store.js";
11
- import { getServerAdapter, runningProcesses } from "../adapters/index.js";
12
- import { createLocalAgentJwt } from "../agent-auth-jwt.js";
13
- import { parseObject, asBoolean, asNumber, appendWithCap, MAX_EXCERPT_BYTES } from "../adapters/utils.js";
14
- import { costService } from "./costs.js";
15
- import { budgetService } from "./budgets.js";
16
- import { secretService } from "./secrets.js";
17
- import { resolveDefaultAgentWorkspaceDir, resolveManagedProjectWorkspaceDir } from "../home-paths.js";
18
- import { summarizeHeartbeatRunResultJson } from "./heartbeat-run-summary.js";
19
- import { buildWorkspaceReadyComment, cleanupExecutionWorkspaceArtifacts, ensureRuntimeServicesForRun, persistAdapterManagedRuntimeServices, realizeExecutionWorkspace, releaseRuntimeServicesForRun, sanitizeRuntimeServiceBaseEnv, } from "./workspace-runtime.js";
20
- import { issueService } from "./issues.js";
21
- import { executionWorkspaceService } from "./execution-workspaces.js";
22
- import { workspaceOperationService } from "./workspace-operations.js";
23
- import { buildExecutionWorkspaceAdapterConfig, gateProjectExecutionWorkspacePolicy, parseIssueExecutionWorkspaceSettings, parseProjectExecutionWorkspacePolicy, resolveExecutionWorkspaceMode, } from "./execution-workspace-policy.js";
24
- import { instanceSettingsService } from "./instance-settings.js";
25
- import { redactCurrentUserText, redactCurrentUserValue } from "../log-redaction.js";
26
- import { hasSessionCompactionThresholds, resolveSessionCompactionPolicy, } from "@paperclipai/adapter-utils";
27
- const MAX_LIVE_LOG_CHUNK_BYTES = 8 * 1024;
28
- const HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT = 1;
29
- const HEARTBEAT_MAX_CONCURRENT_RUNS_MAX = 10;
30
- const DEFERRED_WAKE_CONTEXT_KEY = "_paperclipWakeContext";
31
- const DETACHED_PROCESS_ERROR_CODE = "process_detached";
32
- const startLocksByAgent = new Map();
33
- const REPO_ONLY_CWD_SENTINEL = "/__paperclip_repo_only__";
34
- const MANAGED_WORKSPACE_GIT_CLONE_TIMEOUT_MS = 10 * 60 * 1000;
35
- const execFile = promisify(execFileCallback);
36
- const SESSIONED_LOCAL_ADAPTERS = new Set([
37
- "claude_local",
38
- "codex_local",
39
- "cursor",
40
- "gemini_local",
41
- "opencode_local",
42
- "pi_local",
43
- ]);
44
- function deriveRepoNameFromRepoUrl(repoUrl) {
45
- const trimmed = repoUrl?.trim() ?? "";
46
- if (!trimmed)
47
- return null;
48
- try {
49
- const parsed = new URL(trimmed);
50
- const cleanedPath = parsed.pathname.replace(/\/+$/, "");
51
- const repoName = cleanedPath.split("/").filter(Boolean).pop()?.replace(/\.git$/i, "") ?? "";
52
- return repoName || null;
53
- }
54
- catch {
55
- return null;
56
- }
57
- }
58
- async function ensureManagedProjectWorkspace(input) {
59
- const cwd = resolveManagedProjectWorkspaceDir({
60
- companyId: input.companyId,
61
- projectId: input.projectId,
62
- repoName: deriveRepoNameFromRepoUrl(input.repoUrl),
63
- });
64
- await fs.mkdir(path.dirname(cwd), { recursive: true });
65
- const stats = await fs.stat(cwd).catch(() => null);
66
- if (!input.repoUrl) {
67
- if (!stats) {
68
- await fs.mkdir(cwd, { recursive: true });
69
- }
70
- return { cwd, warning: null };
71
- }
72
- const gitDirExists = await fs
73
- .stat(path.resolve(cwd, ".git"))
74
- .then((entry) => entry.isDirectory())
75
- .catch(() => false);
76
- if (gitDirExists) {
77
- return { cwd, warning: null };
78
- }
79
- if (stats) {
80
- const entries = await fs.readdir(cwd).catch(() => []);
81
- if (entries.length > 0) {
82
- return {
83
- cwd,
84
- warning: `Managed workspace path "${cwd}" already exists but is not a git checkout. Using it as-is.`,
85
- };
86
- }
87
- await fs.rm(cwd, { recursive: true, force: true });
88
- }
89
- try {
90
- await execFile("git", ["clone", input.repoUrl, cwd], {
91
- env: sanitizeRuntimeServiceBaseEnv(process.env),
92
- timeout: MANAGED_WORKSPACE_GIT_CLONE_TIMEOUT_MS,
93
- });
94
- return { cwd, warning: null };
95
- }
96
- catch (error) {
97
- const reason = error instanceof Error ? error.message : String(error);
98
- throw new Error(`Failed to prepare managed checkout for "${input.repoUrl}" at "${cwd}": ${reason}`);
99
- }
100
- }
101
- const heartbeatRunListColumns = {
102
- id: heartbeatRuns.id,
103
- companyId: heartbeatRuns.companyId,
104
- agentId: heartbeatRuns.agentId,
105
- invocationSource: heartbeatRuns.invocationSource,
106
- triggerDetail: heartbeatRuns.triggerDetail,
107
- status: heartbeatRuns.status,
108
- startedAt: heartbeatRuns.startedAt,
109
- finishedAt: heartbeatRuns.finishedAt,
110
- error: heartbeatRuns.error,
111
- wakeupRequestId: heartbeatRuns.wakeupRequestId,
112
- exitCode: heartbeatRuns.exitCode,
113
- signal: heartbeatRuns.signal,
114
- usageJson: heartbeatRuns.usageJson,
115
- resultJson: heartbeatRuns.resultJson,
116
- sessionIdBefore: heartbeatRuns.sessionIdBefore,
117
- sessionIdAfter: heartbeatRuns.sessionIdAfter,
118
- logStore: heartbeatRuns.logStore,
119
- logRef: heartbeatRuns.logRef,
120
- logBytes: heartbeatRuns.logBytes,
121
- logSha256: heartbeatRuns.logSha256,
122
- logCompressed: heartbeatRuns.logCompressed,
123
- stdoutExcerpt: sql `NULL`.as("stdoutExcerpt"),
124
- stderrExcerpt: sql `NULL`.as("stderrExcerpt"),
125
- errorCode: heartbeatRuns.errorCode,
126
- externalRunId: heartbeatRuns.externalRunId,
127
- processPid: heartbeatRuns.processPid,
128
- processStartedAt: heartbeatRuns.processStartedAt,
129
- retryOfRunId: heartbeatRuns.retryOfRunId,
130
- processLossRetryCount: heartbeatRuns.processLossRetryCount,
131
- contextSnapshot: heartbeatRuns.contextSnapshot,
132
- createdAt: heartbeatRuns.createdAt,
133
- updatedAt: heartbeatRuns.updatedAt,
134
- };
135
- function appendExcerpt(prev, chunk) {
136
- return appendWithCap(prev, chunk, MAX_EXCERPT_BYTES);
137
- }
138
- function normalizeMaxConcurrentRuns(value) {
139
- const parsed = Math.floor(asNumber(value, HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT));
140
- if (!Number.isFinite(parsed))
141
- return HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT;
142
- return Math.max(HEARTBEAT_MAX_CONCURRENT_RUNS_DEFAULT, Math.min(HEARTBEAT_MAX_CONCURRENT_RUNS_MAX, parsed));
143
- }
144
- async function withAgentStartLock(agentId, fn) {
145
- const previous = startLocksByAgent.get(agentId) ?? Promise.resolve();
146
- const run = previous.then(fn);
147
- const marker = run.then(() => undefined, () => undefined);
148
- startLocksByAgent.set(agentId, marker);
149
- try {
150
- return await run;
151
- }
152
- finally {
153
- if (startLocksByAgent.get(agentId) === marker) {
154
- startLocksByAgent.delete(agentId);
155
- }
156
- }
157
- }
158
- export function prioritizeProjectWorkspaceCandidatesForRun(rows, preferredWorkspaceId) {
159
- if (!preferredWorkspaceId)
160
- return rows;
161
- const preferredIndex = rows.findIndex((row) => row.id === preferredWorkspaceId);
162
- if (preferredIndex <= 0)
163
- return rows;
164
- return [rows[preferredIndex], ...rows.slice(0, preferredIndex), ...rows.slice(preferredIndex + 1)];
165
- }
166
- function readNonEmptyString(value) {
167
- return typeof value === "string" && value.trim().length > 0 ? value : null;
168
- }
169
- function normalizeLedgerBillingType(value) {
170
- const raw = readNonEmptyString(value);
171
- switch (raw) {
172
- case "api":
173
- case "metered_api":
174
- return "metered_api";
175
- case "subscription":
176
- case "subscription_included":
177
- return "subscription_included";
178
- case "subscription_overage":
179
- return "subscription_overage";
180
- case "credits":
181
- return "credits";
182
- case "fixed":
183
- return "fixed";
184
- default:
185
- return "unknown";
186
- }
187
- }
188
- function resolveLedgerBiller(result) {
189
- return readNonEmptyString(result.biller) ?? readNonEmptyString(result.provider) ?? "unknown";
190
- }
191
- function normalizeBilledCostCents(costUsd, billingType) {
192
- if (billingType === "subscription_included")
193
- return 0;
194
- if (typeof costUsd !== "number" || !Number.isFinite(costUsd))
195
- return 0;
196
- return Math.max(0, Math.round(costUsd * 100));
197
- }
198
- async function resolveLedgerScopeForRun(db, companyId, run) {
199
- const context = parseObject(run.contextSnapshot);
200
- const contextIssueId = readNonEmptyString(context.issueId);
201
- const contextProjectId = readNonEmptyString(context.projectId);
202
- if (!contextIssueId) {
203
- return {
204
- issueId: null,
205
- projectId: contextProjectId,
206
- };
207
- }
208
- const issue = await db
209
- .select({
210
- id: issues.id,
211
- projectId: issues.projectId,
212
- })
213
- .from(issues)
214
- .where(and(eq(issues.id, contextIssueId), eq(issues.companyId, companyId)))
215
- .then((rows) => rows[0] ?? null);
216
- return {
217
- issueId: issue?.id ?? null,
218
- projectId: issue?.projectId ?? contextProjectId,
219
- };
220
- }
221
- function normalizeUsageTotals(usage) {
222
- if (!usage)
223
- return null;
224
- return {
225
- inputTokens: Math.max(0, Math.floor(asNumber(usage.inputTokens, 0))),
226
- cachedInputTokens: Math.max(0, Math.floor(asNumber(usage.cachedInputTokens, 0))),
227
- outputTokens: Math.max(0, Math.floor(asNumber(usage.outputTokens, 0))),
228
- };
229
- }
230
- function readRawUsageTotals(usageJson) {
231
- const parsed = parseObject(usageJson);
232
- if (Object.keys(parsed).length === 0)
233
- return null;
234
- const inputTokens = Math.max(0, Math.floor(asNumber(parsed.rawInputTokens, asNumber(parsed.inputTokens, 0))));
235
- const cachedInputTokens = Math.max(0, Math.floor(asNumber(parsed.rawCachedInputTokens, asNumber(parsed.cachedInputTokens, 0))));
236
- const outputTokens = Math.max(0, Math.floor(asNumber(parsed.rawOutputTokens, asNumber(parsed.outputTokens, 0))));
237
- if (inputTokens <= 0 && cachedInputTokens <= 0 && outputTokens <= 0) {
238
- return null;
239
- }
240
- return {
241
- inputTokens,
242
- cachedInputTokens,
243
- outputTokens,
244
- };
245
- }
246
- function deriveNormalizedUsageDelta(current, previous) {
247
- if (!current)
248
- return null;
249
- if (!previous)
250
- return { ...current };
251
- const inputTokens = current.inputTokens >= previous.inputTokens
252
- ? current.inputTokens - previous.inputTokens
253
- : current.inputTokens;
254
- const cachedInputTokens = current.cachedInputTokens >= previous.cachedInputTokens
255
- ? current.cachedInputTokens - previous.cachedInputTokens
256
- : current.cachedInputTokens;
257
- const outputTokens = current.outputTokens >= previous.outputTokens
258
- ? current.outputTokens - previous.outputTokens
259
- : current.outputTokens;
260
- return {
261
- inputTokens: Math.max(0, inputTokens),
262
- cachedInputTokens: Math.max(0, cachedInputTokens),
263
- outputTokens: Math.max(0, outputTokens),
264
- };
265
- }
266
- function formatCount(value) {
267
- if (typeof value !== "number" || !Number.isFinite(value))
268
- return "0";
269
- return value.toLocaleString("en-US");
270
- }
271
- export function parseSessionCompactionPolicy(agent) {
272
- return resolveSessionCompactionPolicy(agent.adapterType, agent.runtimeConfig).policy;
273
- }
274
- export function resolveRuntimeSessionParamsForWorkspace(input) {
275
- const { agentId, previousSessionParams, resolvedWorkspace } = input;
276
- const previousSessionId = readNonEmptyString(previousSessionParams?.sessionId);
277
- const previousCwd = readNonEmptyString(previousSessionParams?.cwd);
278
- if (!previousSessionId || !previousCwd) {
279
- return {
280
- sessionParams: previousSessionParams,
281
- warning: null,
282
- };
283
- }
284
- if (resolvedWorkspace.source !== "project_primary") {
285
- return {
286
- sessionParams: previousSessionParams,
287
- warning: null,
288
- };
289
- }
290
- const projectCwd = readNonEmptyString(resolvedWorkspace.cwd);
291
- if (!projectCwd) {
292
- return {
293
- sessionParams: previousSessionParams,
294
- warning: null,
295
- };
296
- }
297
- const fallbackAgentHomeCwd = resolveDefaultAgentWorkspaceDir(agentId);
298
- if (path.resolve(previousCwd) !== path.resolve(fallbackAgentHomeCwd)) {
299
- return {
300
- sessionParams: previousSessionParams,
301
- warning: null,
302
- };
303
- }
304
- if (path.resolve(projectCwd) === path.resolve(previousCwd)) {
305
- return {
306
- sessionParams: previousSessionParams,
307
- warning: null,
308
- };
309
- }
310
- const previousWorkspaceId = readNonEmptyString(previousSessionParams?.workspaceId);
311
- if (previousWorkspaceId &&
312
- resolvedWorkspace.workspaceId &&
313
- previousWorkspaceId !== resolvedWorkspace.workspaceId) {
314
- return {
315
- sessionParams: previousSessionParams,
316
- warning: null,
317
- };
318
- }
319
- const migratedSessionParams = {
320
- ...(previousSessionParams ?? {}),
321
- cwd: projectCwd,
322
- };
323
- if (resolvedWorkspace.workspaceId)
324
- migratedSessionParams.workspaceId = resolvedWorkspace.workspaceId;
325
- if (resolvedWorkspace.repoUrl)
326
- migratedSessionParams.repoUrl = resolvedWorkspace.repoUrl;
327
- if (resolvedWorkspace.repoRef)
328
- migratedSessionParams.repoRef = resolvedWorkspace.repoRef;
329
- return {
330
- sessionParams: migratedSessionParams,
331
- warning: `Project workspace "${projectCwd}" is now available. ` +
332
- `Attempting to resume session "${previousSessionId}" that was previously saved in fallback workspace "${previousCwd}".`,
333
- };
334
- }
335
- function parseIssueAssigneeAdapterOverrides(raw) {
336
- const parsed = parseObject(raw);
337
- const parsedAdapterConfig = parseObject(parsed.adapterConfig);
338
- const adapterConfig = Object.keys(parsedAdapterConfig).length > 0 ? parsedAdapterConfig : null;
339
- const useProjectWorkspace = typeof parsed.useProjectWorkspace === "boolean"
340
- ? parsed.useProjectWorkspace
341
- : null;
342
- if (!adapterConfig && useProjectWorkspace === null)
343
- return null;
344
- return {
345
- adapterConfig,
346
- useProjectWorkspace,
347
- };
348
- }
349
- function deriveTaskKey(contextSnapshot, payload) {
350
- return (readNonEmptyString(contextSnapshot?.taskKey) ??
351
- readNonEmptyString(contextSnapshot?.taskId) ??
352
- readNonEmptyString(contextSnapshot?.issueId) ??
353
- readNonEmptyString(payload?.taskKey) ??
354
- readNonEmptyString(payload?.taskId) ??
355
- readNonEmptyString(payload?.issueId) ??
356
- null);
357
- }
358
- export function shouldResetTaskSessionForWake(contextSnapshot) {
359
- if (contextSnapshot?.forceFreshSession === true)
360
- return true;
361
- const wakeReason = readNonEmptyString(contextSnapshot?.wakeReason);
362
- if (wakeReason === "issue_assigned")
363
- return true;
364
- return false;
365
- }
366
- export function formatRuntimeWorkspaceWarningLog(warning) {
367
- return {
368
- stream: "stdout",
369
- chunk: `[paperclip] ${warning}\n`,
370
- };
371
- }
372
- function describeSessionResetReason(contextSnapshot) {
373
- if (contextSnapshot?.forceFreshSession === true)
374
- return "forceFreshSession was requested";
375
- const wakeReason = readNonEmptyString(contextSnapshot?.wakeReason);
376
- if (wakeReason === "issue_assigned")
377
- return "wake reason is issue_assigned";
378
- return null;
379
- }
380
- function deriveCommentId(contextSnapshot, payload) {
381
- return (readNonEmptyString(contextSnapshot?.wakeCommentId) ??
382
- readNonEmptyString(contextSnapshot?.commentId) ??
383
- readNonEmptyString(payload?.commentId) ??
384
- null);
385
- }
386
- function enrichWakeContextSnapshot(input) {
387
- const { contextSnapshot, reason, source, triggerDetail, payload } = input;
388
- const issueIdFromPayload = readNonEmptyString(payload?.["issueId"]);
389
- const commentIdFromPayload = readNonEmptyString(payload?.["commentId"]);
390
- const taskKey = deriveTaskKey(contextSnapshot, payload);
391
- const wakeCommentId = deriveCommentId(contextSnapshot, payload);
392
- if (!readNonEmptyString(contextSnapshot["wakeReason"]) && reason) {
393
- contextSnapshot.wakeReason = reason;
394
- }
395
- if (!readNonEmptyString(contextSnapshot["issueId"]) && issueIdFromPayload) {
396
- contextSnapshot.issueId = issueIdFromPayload;
397
- }
398
- if (!readNonEmptyString(contextSnapshot["taskId"]) && issueIdFromPayload) {
399
- contextSnapshot.taskId = issueIdFromPayload;
400
- }
401
- if (!readNonEmptyString(contextSnapshot["taskKey"]) && taskKey) {
402
- contextSnapshot.taskKey = taskKey;
403
- }
404
- if (!readNonEmptyString(contextSnapshot["commentId"]) && commentIdFromPayload) {
405
- contextSnapshot.commentId = commentIdFromPayload;
406
- }
407
- if (!readNonEmptyString(contextSnapshot["wakeCommentId"]) && wakeCommentId) {
408
- contextSnapshot.wakeCommentId = wakeCommentId;
409
- }
410
- if (!readNonEmptyString(contextSnapshot["wakeSource"]) && source) {
411
- contextSnapshot.wakeSource = source;
412
- }
413
- if (!readNonEmptyString(contextSnapshot["wakeTriggerDetail"]) && triggerDetail) {
414
- contextSnapshot.wakeTriggerDetail = triggerDetail;
415
- }
416
- return {
417
- contextSnapshot,
418
- issueIdFromPayload,
419
- commentIdFromPayload,
420
- taskKey,
421
- wakeCommentId,
422
- };
423
- }
424
- function mergeCoalescedContextSnapshot(existingRaw, incoming) {
425
- const existing = parseObject(existingRaw);
426
- const merged = {
427
- ...existing,
428
- ...incoming,
429
- };
430
- const commentId = deriveCommentId(incoming, null);
431
- if (commentId) {
432
- merged.commentId = commentId;
433
- merged.wakeCommentId = commentId;
434
- }
435
- return merged;
436
- }
437
- function runTaskKey(run) {
438
- return deriveTaskKey(run.contextSnapshot, null);
439
- }
440
- function isSameTaskScope(left, right) {
441
- return (left ?? null) === (right ?? null);
442
- }
443
- function isTrackedLocalChildProcessAdapter(adapterType) {
444
- return SESSIONED_LOCAL_ADAPTERS.has(adapterType);
445
- }
446
- // A positive liveness check means some process currently owns the PID.
447
- // On Linux, PIDs can be recycled, so this is a best-effort signal rather
448
- // than proof that the original child is still alive.
449
- function isProcessAlive(pid) {
450
- if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0)
451
- return false;
452
- try {
453
- process.kill(pid, 0);
454
- return true;
455
- }
456
- catch (error) {
457
- const code = error?.code;
458
- if (code === "EPERM")
459
- return true;
460
- if (code === "ESRCH")
461
- return false;
462
- return false;
463
- }
464
- }
465
- function truncateDisplayId(value, max = 128) {
466
- if (!value)
467
- return null;
468
- return value.length > max ? value.slice(0, max) : value;
469
- }
470
- function normalizeAgentNameKey(value) {
471
- if (typeof value !== "string")
472
- return null;
473
- const normalized = value.trim().toLowerCase();
474
- return normalized.length > 0 ? normalized : null;
475
- }
476
- const defaultSessionCodec = {
477
- deserialize(raw) {
478
- const asObj = parseObject(raw);
479
- if (Object.keys(asObj).length > 0)
480
- return asObj;
481
- const sessionId = readNonEmptyString(raw?.sessionId);
482
- if (sessionId)
483
- return { sessionId };
484
- return null;
485
- },
486
- serialize(params) {
487
- if (!params || Object.keys(params).length === 0)
488
- return null;
489
- return params;
490
- },
491
- getDisplayId(params) {
492
- return readNonEmptyString(params?.sessionId);
493
- },
494
- };
495
- function getAdapterSessionCodec(adapterType) {
496
- const adapter = getServerAdapter(adapterType);
497
- return adapter.sessionCodec ?? defaultSessionCodec;
498
- }
499
- function normalizeSessionParams(params) {
500
- if (!params)
501
- return null;
502
- return Object.keys(params).length > 0 ? params : null;
503
- }
504
- function resolveNextSessionState(input) {
505
- const { codec, adapterResult, previousParams, previousDisplayId, previousLegacySessionId } = input;
506
- if (adapterResult.clearSession) {
507
- return {
508
- params: null,
509
- displayId: null,
510
- legacySessionId: null,
511
- };
512
- }
513
- const explicitParams = adapterResult.sessionParams;
514
- const hasExplicitParams = adapterResult.sessionParams !== undefined;
515
- const hasExplicitSessionId = adapterResult.sessionId !== undefined;
516
- const explicitSessionId = readNonEmptyString(adapterResult.sessionId);
517
- const hasExplicitDisplay = adapterResult.sessionDisplayId !== undefined;
518
- const explicitDisplayId = readNonEmptyString(adapterResult.sessionDisplayId);
519
- const shouldUsePrevious = !hasExplicitParams && !hasExplicitSessionId && !hasExplicitDisplay;
520
- const candidateParams = hasExplicitParams
521
- ? explicitParams
522
- : hasExplicitSessionId
523
- ? (explicitSessionId ? { sessionId: explicitSessionId } : null)
524
- : previousParams;
525
- const serialized = normalizeSessionParams(codec.serialize(normalizeSessionParams(candidateParams) ?? null));
526
- const deserialized = normalizeSessionParams(codec.deserialize(serialized));
527
- const displayId = truncateDisplayId(explicitDisplayId ??
528
- (codec.getDisplayId ? codec.getDisplayId(deserialized) : null) ??
529
- readNonEmptyString(deserialized?.sessionId) ??
530
- (shouldUsePrevious ? previousDisplayId : null) ??
531
- explicitSessionId ??
532
- (shouldUsePrevious ? previousLegacySessionId : null));
533
- const legacySessionId = explicitSessionId ??
534
- readNonEmptyString(deserialized?.sessionId) ??
535
- displayId ??
536
- (shouldUsePrevious ? previousLegacySessionId : null);
537
- return {
538
- params: serialized,
539
- displayId,
540
- legacySessionId,
541
- };
542
- }
543
- export function heartbeatService(db) {
544
- const instanceSettings = instanceSettingsService(db);
545
- const runLogStore = getRunLogStore();
546
- const secretsSvc = secretService(db);
547
- const issuesSvc = issueService(db);
548
- const executionWorkspacesSvc = executionWorkspaceService(db);
549
- const workspaceOperationsSvc = workspaceOperationService(db);
550
- const activeRunExecutions = new Set();
551
- const budgetHooks = {
552
- cancelWorkForScope: cancelBudgetScopeWork,
553
- };
554
- const budgets = budgetService(db, budgetHooks);
555
- async function getAgent(agentId) {
556
- return db
557
- .select()
558
- .from(agents)
559
- .where(eq(agents.id, agentId))
560
- .then((rows) => rows[0] ?? null);
561
- }
562
- async function getRun(runId) {
563
- return db
564
- .select()
565
- .from(heartbeatRuns)
566
- .where(eq(heartbeatRuns.id, runId))
567
- .then((rows) => rows[0] ?? null);
568
- }
569
- async function getRuntimeState(agentId) {
570
- return db
571
- .select()
572
- .from(agentRuntimeState)
573
- .where(eq(agentRuntimeState.agentId, agentId))
574
- .then((rows) => rows[0] ?? null);
575
- }
576
- async function getTaskSession(companyId, agentId, adapterType, taskKey) {
577
- return db
578
- .select()
579
- .from(agentTaskSessions)
580
- .where(and(eq(agentTaskSessions.companyId, companyId), eq(agentTaskSessions.agentId, agentId), eq(agentTaskSessions.adapterType, adapterType), eq(agentTaskSessions.taskKey, taskKey)))
581
- .then((rows) => rows[0] ?? null);
582
- }
583
- async function getLatestRunForSession(agentId, sessionId, opts) {
584
- const conditions = [
585
- eq(heartbeatRuns.agentId, agentId),
586
- eq(heartbeatRuns.sessionIdAfter, sessionId),
587
- ];
588
- if (opts?.excludeRunId) {
589
- conditions.push(sql `${heartbeatRuns.id} <> ${opts.excludeRunId}`);
590
- }
591
- return db
592
- .select()
593
- .from(heartbeatRuns)
594
- .where(and(...conditions))
595
- .orderBy(desc(heartbeatRuns.createdAt))
596
- .limit(1)
597
- .then((rows) => rows[0] ?? null);
598
- }
599
- async function getOldestRunForSession(agentId, sessionId) {
600
- return db
601
- .select({
602
- id: heartbeatRuns.id,
603
- createdAt: heartbeatRuns.createdAt,
604
- })
605
- .from(heartbeatRuns)
606
- .where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.sessionIdAfter, sessionId)))
607
- .orderBy(asc(heartbeatRuns.createdAt), asc(heartbeatRuns.id))
608
- .limit(1)
609
- .then((rows) => rows[0] ?? null);
610
- }
611
- async function resolveNormalizedUsageForSession(input) {
612
- const { agentId, runId, sessionId, rawUsage } = input;
613
- if (!sessionId || !rawUsage) {
614
- return {
615
- normalizedUsage: rawUsage,
616
- previousRawUsage: null,
617
- derivedFromSessionTotals: false,
618
- };
619
- }
620
- const previousRun = await getLatestRunForSession(agentId, sessionId, { excludeRunId: runId });
621
- const previousRawUsage = readRawUsageTotals(previousRun?.usageJson);
622
- return {
623
- normalizedUsage: deriveNormalizedUsageDelta(rawUsage, previousRawUsage),
624
- previousRawUsage,
625
- derivedFromSessionTotals: previousRawUsage !== null,
626
- };
627
- }
628
- async function evaluateSessionCompaction(input) {
629
- const { agent, sessionId, issueId } = input;
630
- if (!sessionId) {
631
- return {
632
- rotate: false,
633
- reason: null,
634
- handoffMarkdown: null,
635
- previousRunId: null,
636
- };
637
- }
638
- const policy = parseSessionCompactionPolicy(agent);
639
- if (!policy.enabled || !hasSessionCompactionThresholds(policy)) {
640
- return {
641
- rotate: false,
642
- reason: null,
643
- handoffMarkdown: null,
644
- previousRunId: null,
645
- };
646
- }
647
- const fetchLimit = Math.max(policy.maxSessionRuns > 0 ? policy.maxSessionRuns + 1 : 0, 4);
648
- const runs = await db
649
- .select({
650
- id: heartbeatRuns.id,
651
- createdAt: heartbeatRuns.createdAt,
652
- usageJson: heartbeatRuns.usageJson,
653
- resultJson: heartbeatRuns.resultJson,
654
- error: heartbeatRuns.error,
655
- })
656
- .from(heartbeatRuns)
657
- .where(and(eq(heartbeatRuns.agentId, agent.id), eq(heartbeatRuns.sessionIdAfter, sessionId)))
658
- .orderBy(desc(heartbeatRuns.createdAt))
659
- .limit(fetchLimit);
660
- if (runs.length === 0) {
661
- return {
662
- rotate: false,
663
- reason: null,
664
- handoffMarkdown: null,
665
- previousRunId: null,
666
- };
667
- }
668
- const latestRun = runs[0] ?? null;
669
- const oldestRun = policy.maxSessionAgeHours > 0
670
- ? await getOldestRunForSession(agent.id, sessionId)
671
- : runs[runs.length - 1] ?? latestRun;
672
- const latestRawUsage = readRawUsageTotals(latestRun?.usageJson);
673
- const sessionAgeHours = latestRun && oldestRun
674
- ? Math.max(0, (new Date(latestRun.createdAt).getTime() - new Date(oldestRun.createdAt).getTime()) / (1000 * 60 * 60))
675
- : 0;
676
- let reason = null;
677
- if (policy.maxSessionRuns > 0 && runs.length > policy.maxSessionRuns) {
678
- reason = `session exceeded ${policy.maxSessionRuns} runs`;
679
- }
680
- else if (policy.maxRawInputTokens > 0 &&
681
- latestRawUsage &&
682
- latestRawUsage.inputTokens >= policy.maxRawInputTokens) {
683
- reason =
684
- `session raw input reached ${formatCount(latestRawUsage.inputTokens)} tokens ` +
685
- `(threshold ${formatCount(policy.maxRawInputTokens)})`;
686
- }
687
- else if (policy.maxSessionAgeHours > 0 && sessionAgeHours >= policy.maxSessionAgeHours) {
688
- reason = `session age reached ${Math.floor(sessionAgeHours)} hours`;
689
- }
690
- if (!reason || !latestRun) {
691
- return {
692
- rotate: false,
693
- reason: null,
694
- handoffMarkdown: null,
695
- previousRunId: latestRun?.id ?? null,
696
- };
697
- }
698
- const latestSummary = summarizeHeartbeatRunResultJson(latestRun.resultJson);
699
- const latestTextSummary = readNonEmptyString(latestSummary?.summary) ??
700
- readNonEmptyString(latestSummary?.result) ??
701
- readNonEmptyString(latestSummary?.message) ??
702
- readNonEmptyString(latestRun.error);
703
- const handoffMarkdown = [
704
- "Paperclip session handoff:",
705
- `- Previous session: ${sessionId}`,
706
- issueId ? `- Issue: ${issueId}` : "",
707
- `- Rotation reason: ${reason}`,
708
- latestTextSummary ? `- Last run summary: ${latestTextSummary}` : "",
709
- "Continue from the current task state. Rebuild only the minimum context you need.",
710
- ]
711
- .filter(Boolean)
712
- .join("\n");
713
- return {
714
- rotate: true,
715
- reason,
716
- handoffMarkdown,
717
- previousRunId: latestRun.id,
718
- };
719
- }
720
- async function resolveSessionBeforeForWakeup(agent, taskKey) {
721
- if (taskKey) {
722
- const codec = getAdapterSessionCodec(agent.adapterType);
723
- const existingTaskSession = await getTaskSession(agent.companyId, agent.id, agent.adapterType, taskKey);
724
- const parsedParams = normalizeSessionParams(codec.deserialize(existingTaskSession?.sessionParamsJson ?? null));
725
- return truncateDisplayId(existingTaskSession?.sessionDisplayId ??
726
- (codec.getDisplayId ? codec.getDisplayId(parsedParams) : null) ??
727
- readNonEmptyString(parsedParams?.sessionId));
728
- }
729
- const runtimeForRun = await getRuntimeState(agent.id);
730
- return runtimeForRun?.sessionId ?? null;
731
- }
732
- async function resolveWorkspaceForRun(agent, context, previousSessionParams, opts) {
733
- const issueId = readNonEmptyString(context.issueId);
734
- const contextProjectId = readNonEmptyString(context.projectId);
735
- const contextProjectWorkspaceId = readNonEmptyString(context.projectWorkspaceId);
736
- const issueProjectRef = issueId
737
- ? await db
738
- .select({
739
- projectId: issues.projectId,
740
- projectWorkspaceId: issues.projectWorkspaceId,
741
- })
742
- .from(issues)
743
- .where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
744
- .then((rows) => rows[0] ?? null)
745
- : null;
746
- const issueProjectId = issueProjectRef?.projectId ?? null;
747
- const preferredProjectWorkspaceId = issueProjectRef?.projectWorkspaceId ?? contextProjectWorkspaceId ?? null;
748
- const resolvedProjectId = issueProjectId ?? contextProjectId;
749
- const useProjectWorkspace = opts?.useProjectWorkspace !== false;
750
- const workspaceProjectId = useProjectWorkspace ? resolvedProjectId : null;
751
- const unorderedProjectWorkspaceRows = workspaceProjectId
752
- ? await db
753
- .select()
754
- .from(projectWorkspaces)
755
- .where(and(eq(projectWorkspaces.companyId, agent.companyId), eq(projectWorkspaces.projectId, workspaceProjectId)))
756
- .orderBy(asc(projectWorkspaces.createdAt), asc(projectWorkspaces.id))
757
- : [];
758
- const projectWorkspaceRows = prioritizeProjectWorkspaceCandidatesForRun(unorderedProjectWorkspaceRows, preferredProjectWorkspaceId);
759
- const workspaceHints = projectWorkspaceRows.map((workspace) => ({
760
- workspaceId: workspace.id,
761
- cwd: readNonEmptyString(workspace.cwd),
762
- repoUrl: readNonEmptyString(workspace.repoUrl),
763
- repoRef: readNonEmptyString(workspace.repoRef),
764
- }));
765
- if (projectWorkspaceRows.length > 0) {
766
- const preferredWorkspace = preferredProjectWorkspaceId
767
- ? projectWorkspaceRows.find((workspace) => workspace.id === preferredProjectWorkspaceId) ?? null
768
- : null;
769
- const missingProjectCwds = [];
770
- let hasConfiguredProjectCwd = false;
771
- let preferredWorkspaceWarning = null;
772
- if (preferredProjectWorkspaceId && !preferredWorkspace) {
773
- preferredWorkspaceWarning =
774
- `Selected project workspace "${preferredProjectWorkspaceId}" is not available on this project.`;
775
- }
776
- for (const workspace of projectWorkspaceRows) {
777
- let projectCwd = readNonEmptyString(workspace.cwd);
778
- let managedWorkspaceWarning = null;
779
- if (!projectCwd || projectCwd === REPO_ONLY_CWD_SENTINEL) {
780
- try {
781
- const managedWorkspace = await ensureManagedProjectWorkspace({
782
- companyId: agent.companyId,
783
- projectId: workspaceProjectId ?? resolvedProjectId ?? workspace.projectId,
784
- repoUrl: readNonEmptyString(workspace.repoUrl),
785
- });
786
- projectCwd = managedWorkspace.cwd;
787
- managedWorkspaceWarning = managedWorkspace.warning;
788
- }
789
- catch (error) {
790
- if (preferredWorkspace?.id === workspace.id) {
791
- preferredWorkspaceWarning = error instanceof Error ? error.message : String(error);
792
- }
793
- continue;
794
- }
795
- }
796
- hasConfiguredProjectCwd = true;
797
- const projectCwdExists = await fs
798
- .stat(projectCwd)
799
- .then((stats) => stats.isDirectory())
800
- .catch(() => false);
801
- if (projectCwdExists) {
802
- return {
803
- cwd: projectCwd,
804
- source: "project_primary",
805
- projectId: resolvedProjectId,
806
- workspaceId: workspace.id,
807
- repoUrl: workspace.repoUrl,
808
- repoRef: workspace.repoRef,
809
- workspaceHints,
810
- warnings: [preferredWorkspaceWarning, managedWorkspaceWarning].filter((value) => Boolean(value)),
811
- };
812
- }
813
- if (preferredWorkspace?.id === workspace.id) {
814
- preferredWorkspaceWarning =
815
- `Selected project workspace path "${projectCwd}" is not available yet.`;
816
- }
817
- missingProjectCwds.push(projectCwd);
818
- }
819
- const fallbackCwd = resolveDefaultAgentWorkspaceDir(agent.id);
820
- await fs.mkdir(fallbackCwd, { recursive: true });
821
- const warnings = [];
822
- if (preferredWorkspaceWarning) {
823
- warnings.push(preferredWorkspaceWarning);
824
- }
825
- if (missingProjectCwds.length > 0) {
826
- const firstMissing = missingProjectCwds[0];
827
- const extraMissingCount = Math.max(0, missingProjectCwds.length - 1);
828
- warnings.push(extraMissingCount > 0
829
- ? `Project workspace path "${firstMissing}" and ${extraMissingCount} other configured path(s) are not available yet. Using fallback workspace "${fallbackCwd}" for this run.`
830
- : `Project workspace path "${firstMissing}" is not available yet. Using fallback workspace "${fallbackCwd}" for this run.`);
831
- }
832
- else if (!hasConfiguredProjectCwd) {
833
- warnings.push(`Project workspace has no local cwd configured. Using fallback workspace "${fallbackCwd}" for this run.`);
834
- }
835
- return {
836
- cwd: fallbackCwd,
837
- source: "project_primary",
838
- projectId: resolvedProjectId,
839
- workspaceId: projectWorkspaceRows[0]?.id ?? null,
840
- repoUrl: projectWorkspaceRows[0]?.repoUrl ?? null,
841
- repoRef: projectWorkspaceRows[0]?.repoRef ?? null,
842
- workspaceHints,
843
- warnings,
844
- };
845
- }
846
- if (workspaceProjectId) {
847
- const managedWorkspace = await ensureManagedProjectWorkspace({
848
- companyId: agent.companyId,
849
- projectId: workspaceProjectId,
850
- repoUrl: null,
851
- });
852
- return {
853
- cwd: managedWorkspace.cwd,
854
- source: "project_primary",
855
- projectId: resolvedProjectId,
856
- workspaceId: null,
857
- repoUrl: null,
858
- repoRef: null,
859
- workspaceHints,
860
- warnings: managedWorkspace.warning ? [managedWorkspace.warning] : [],
861
- };
862
- }
863
- const sessionCwd = readNonEmptyString(previousSessionParams?.cwd);
864
- if (sessionCwd) {
865
- const sessionCwdExists = await fs
866
- .stat(sessionCwd)
867
- .then((stats) => stats.isDirectory())
868
- .catch(() => false);
869
- if (sessionCwdExists) {
870
- return {
871
- cwd: sessionCwd,
872
- source: "task_session",
873
- projectId: resolvedProjectId,
874
- workspaceId: readNonEmptyString(previousSessionParams?.workspaceId),
875
- repoUrl: readNonEmptyString(previousSessionParams?.repoUrl),
876
- repoRef: readNonEmptyString(previousSessionParams?.repoRef),
877
- workspaceHints,
878
- warnings: [],
879
- };
880
- }
881
- }
882
- const cwd = resolveDefaultAgentWorkspaceDir(agent.id);
883
- await fs.mkdir(cwd, { recursive: true });
884
- const warnings = [];
885
- if (sessionCwd) {
886
- warnings.push(`Saved session workspace "${sessionCwd}" is not available. Using fallback workspace "${cwd}" for this run.`);
887
- }
888
- else if (resolvedProjectId) {
889
- warnings.push(`No project workspace directory is currently available for this issue. Using fallback workspace "${cwd}" for this run.`);
890
- }
891
- else {
892
- warnings.push(`No project or prior session workspace was available. Using fallback workspace "${cwd}" for this run.`);
893
- }
894
- return {
895
- cwd,
896
- source: "agent_home",
897
- projectId: resolvedProjectId,
898
- workspaceId: null,
899
- repoUrl: null,
900
- repoRef: null,
901
- workspaceHints,
902
- warnings,
903
- };
904
- }
905
- async function upsertTaskSession(input) {
906
- const existing = await getTaskSession(input.companyId, input.agentId, input.adapterType, input.taskKey);
907
- if (existing) {
908
- return db
909
- .update(agentTaskSessions)
910
- .set({
911
- sessionParamsJson: input.sessionParamsJson,
912
- sessionDisplayId: input.sessionDisplayId,
913
- lastRunId: input.lastRunId,
914
- lastError: input.lastError,
915
- updatedAt: new Date(),
916
- })
917
- .where(eq(agentTaskSessions.id, existing.id))
918
- .returning()
919
- .then((rows) => rows[0] ?? null);
920
- }
921
- return db
922
- .insert(agentTaskSessions)
923
- .values({
924
- companyId: input.companyId,
925
- agentId: input.agentId,
926
- adapterType: input.adapterType,
927
- taskKey: input.taskKey,
928
- sessionParamsJson: input.sessionParamsJson,
929
- sessionDisplayId: input.sessionDisplayId,
930
- lastRunId: input.lastRunId,
931
- lastError: input.lastError,
932
- })
933
- .returning()
934
- .then((rows) => rows[0] ?? null);
935
- }
936
- async function clearTaskSessions(companyId, agentId, opts) {
937
- const conditions = [
938
- eq(agentTaskSessions.companyId, companyId),
939
- eq(agentTaskSessions.agentId, agentId),
940
- ];
941
- if (opts?.taskKey) {
942
- conditions.push(eq(agentTaskSessions.taskKey, opts.taskKey));
943
- }
944
- if (opts?.adapterType) {
945
- conditions.push(eq(agentTaskSessions.adapterType, opts.adapterType));
946
- }
947
- return db
948
- .delete(agentTaskSessions)
949
- .where(and(...conditions))
950
- .returning()
951
- .then((rows) => rows.length);
952
- }
953
- async function ensureRuntimeState(agent) {
954
- const existing = await getRuntimeState(agent.id);
955
- if (existing)
956
- return existing;
957
- return db
958
- .insert(agentRuntimeState)
959
- .values({
960
- agentId: agent.id,
961
- companyId: agent.companyId,
962
- adapterType: agent.adapterType,
963
- stateJson: {},
964
- })
965
- .returning()
966
- .then((rows) => rows[0]);
967
- }
968
- async function setRunStatus(runId, status, patch) {
969
- const updated = await db
970
- .update(heartbeatRuns)
971
- .set({ status, ...patch, updatedAt: new Date() })
972
- .where(eq(heartbeatRuns.id, runId))
973
- .returning()
974
- .then((rows) => rows[0] ?? null);
975
- if (updated) {
976
- publishLiveEvent({
977
- companyId: updated.companyId,
978
- type: "heartbeat.run.status",
979
- payload: {
980
- runId: updated.id,
981
- agentId: updated.agentId,
982
- status: updated.status,
983
- invocationSource: updated.invocationSource,
984
- triggerDetail: updated.triggerDetail,
985
- error: updated.error ?? null,
986
- errorCode: updated.errorCode ?? null,
987
- startedAt: updated.startedAt ? new Date(updated.startedAt).toISOString() : null,
988
- finishedAt: updated.finishedAt ? new Date(updated.finishedAt).toISOString() : null,
989
- },
990
- });
991
- }
992
- return updated;
993
- }
994
- async function setWakeupStatus(wakeupRequestId, status, patch) {
995
- if (!wakeupRequestId)
996
- return;
997
- await db
998
- .update(agentWakeupRequests)
999
- .set({ status, ...patch, updatedAt: new Date() })
1000
- .where(eq(agentWakeupRequests.id, wakeupRequestId));
1001
- }
1002
- async function appendRunEvent(run, seq, event) {
1003
- const sanitizedMessage = event.message ? redactCurrentUserText(event.message) : event.message;
1004
- const sanitizedPayload = event.payload ? redactCurrentUserValue(event.payload) : event.payload;
1005
- await db.insert(heartbeatRunEvents).values({
1006
- companyId: run.companyId,
1007
- runId: run.id,
1008
- agentId: run.agentId,
1009
- seq,
1010
- eventType: event.eventType,
1011
- stream: event.stream,
1012
- level: event.level,
1013
- color: event.color,
1014
- message: sanitizedMessage,
1015
- payload: sanitizedPayload,
1016
- });
1017
- publishLiveEvent({
1018
- companyId: run.companyId,
1019
- type: "heartbeat.run.event",
1020
- payload: {
1021
- runId: run.id,
1022
- agentId: run.agentId,
1023
- seq,
1024
- eventType: event.eventType,
1025
- stream: event.stream ?? null,
1026
- level: event.level ?? null,
1027
- color: event.color ?? null,
1028
- message: sanitizedMessage ?? null,
1029
- payload: sanitizedPayload ?? null,
1030
- },
1031
- });
1032
- }
1033
- async function nextRunEventSeq(runId) {
1034
- const [row] = await db
1035
- .select({ maxSeq: sql `max(${heartbeatRunEvents.seq})` })
1036
- .from(heartbeatRunEvents)
1037
- .where(eq(heartbeatRunEvents.runId, runId));
1038
- return Number(row?.maxSeq ?? 0) + 1;
1039
- }
1040
- async function persistRunProcessMetadata(runId, meta) {
1041
- const startedAt = new Date(meta.startedAt);
1042
- return db
1043
- .update(heartbeatRuns)
1044
- .set({
1045
- processPid: meta.pid,
1046
- processStartedAt: Number.isNaN(startedAt.getTime()) ? new Date() : startedAt,
1047
- updatedAt: new Date(),
1048
- })
1049
- .where(eq(heartbeatRuns.id, runId))
1050
- .returning()
1051
- .then((rows) => rows[0] ?? null);
1052
- }
1053
- async function clearDetachedRunWarning(runId) {
1054
- const updated = await db
1055
- .update(heartbeatRuns)
1056
- .set({
1057
- error: null,
1058
- errorCode: null,
1059
- updatedAt: new Date(),
1060
- })
1061
- .where(and(eq(heartbeatRuns.id, runId), eq(heartbeatRuns.status, "running"), eq(heartbeatRuns.errorCode, DETACHED_PROCESS_ERROR_CODE)))
1062
- .returning()
1063
- .then((rows) => rows[0] ?? null);
1064
- if (!updated)
1065
- return null;
1066
- await appendRunEvent(updated, await nextRunEventSeq(updated.id), {
1067
- eventType: "lifecycle",
1068
- stream: "system",
1069
- level: "info",
1070
- message: "Detached child process reported activity; cleared detached warning",
1071
- });
1072
- return updated;
1073
- }
1074
- async function enqueueProcessLossRetry(run, agent, now) {
1075
- const contextSnapshot = parseObject(run.contextSnapshot);
1076
- const issueId = readNonEmptyString(contextSnapshot.issueId);
1077
- const taskKey = deriveTaskKey(contextSnapshot, null);
1078
- const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
1079
- const retryContextSnapshot = {
1080
- ...contextSnapshot,
1081
- retryOfRunId: run.id,
1082
- wakeReason: "process_lost_retry",
1083
- retryReason: "process_lost",
1084
- };
1085
- const queued = await db.transaction(async (tx) => {
1086
- const wakeupRequest = await tx
1087
- .insert(agentWakeupRequests)
1088
- .values({
1089
- companyId: run.companyId,
1090
- agentId: run.agentId,
1091
- source: "automation",
1092
- triggerDetail: "system",
1093
- reason: "process_lost_retry",
1094
- payload: {
1095
- ...(issueId ? { issueId } : {}),
1096
- retryOfRunId: run.id,
1097
- },
1098
- status: "queued",
1099
- requestedByActorType: "system",
1100
- requestedByActorId: null,
1101
- updatedAt: now,
1102
- })
1103
- .returning()
1104
- .then((rows) => rows[0]);
1105
- const retryRun = await tx
1106
- .insert(heartbeatRuns)
1107
- .values({
1108
- companyId: run.companyId,
1109
- agentId: run.agentId,
1110
- invocationSource: "automation",
1111
- triggerDetail: "system",
1112
- status: "queued",
1113
- wakeupRequestId: wakeupRequest.id,
1114
- contextSnapshot: retryContextSnapshot,
1115
- sessionIdBefore: sessionBefore,
1116
- retryOfRunId: run.id,
1117
- processLossRetryCount: (run.processLossRetryCount ?? 0) + 1,
1118
- updatedAt: now,
1119
- })
1120
- .returning()
1121
- .then((rows) => rows[0]);
1122
- await tx
1123
- .update(agentWakeupRequests)
1124
- .set({
1125
- runId: retryRun.id,
1126
- updatedAt: now,
1127
- })
1128
- .where(eq(agentWakeupRequests.id, wakeupRequest.id));
1129
- if (issueId) {
1130
- await tx
1131
- .update(issues)
1132
- .set({
1133
- executionRunId: retryRun.id,
1134
- executionAgentNameKey: normalizeAgentNameKey(agent.name),
1135
- executionLockedAt: now,
1136
- updatedAt: now,
1137
- })
1138
- .where(and(eq(issues.id, issueId), eq(issues.companyId, run.companyId), eq(issues.executionRunId, run.id)));
1139
- }
1140
- return retryRun;
1141
- });
1142
- publishLiveEvent({
1143
- companyId: queued.companyId,
1144
- type: "heartbeat.run.queued",
1145
- payload: {
1146
- runId: queued.id,
1147
- agentId: queued.agentId,
1148
- invocationSource: queued.invocationSource,
1149
- triggerDetail: queued.triggerDetail,
1150
- wakeupRequestId: queued.wakeupRequestId,
1151
- },
1152
- });
1153
- await appendRunEvent(queued, 1, {
1154
- eventType: "lifecycle",
1155
- stream: "system",
1156
- level: "warn",
1157
- message: "Queued automatic retry after orphaned child process was confirmed dead",
1158
- payload: {
1159
- retryOfRunId: run.id,
1160
- },
1161
- });
1162
- return queued;
1163
- }
1164
- function parseHeartbeatPolicy(agent) {
1165
- const runtimeConfig = parseObject(agent.runtimeConfig);
1166
- const heartbeat = parseObject(runtimeConfig.heartbeat);
1167
- // globalWakeOnDemand is the legacy single flag — per-source flags take precedence.
1168
- // Separating these means disabling on_demand wakeups won't accidentally block
1169
- // assignment-triggered wakeups (the primary pipeline path).
1170
- const globalWakeOnDemand = heartbeat.wakeOnDemand;
1171
- return {
1172
- enabled: asBoolean(heartbeat.enabled, true),
1173
- intervalSec: Math.max(0, asNumber(heartbeat.intervalSec, 0)),
1174
- wakeOnAssignment: asBoolean(heartbeat.wakeOnAssignment ?? globalWakeOnDemand, true),
1175
- wakeOnAutomation: asBoolean(heartbeat.wakeOnAutomation ?? globalWakeOnDemand, true),
1176
- wakeOnDemand: asBoolean(heartbeat.wakeOnOnDemand ?? globalWakeOnDemand, true),
1177
- maxConcurrentRuns: normalizeMaxConcurrentRuns(heartbeat.maxConcurrentRuns),
1178
- };
1179
- }
1180
- async function countRunningRunsForAgent(agentId) {
1181
- const [{ count }] = await db
1182
- .select({ count: sql `count(*)` })
1183
- .from(heartbeatRuns)
1184
- .where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "running")));
1185
- return Number(count ?? 0);
1186
- }
1187
- async function claimQueuedRun(run) {
1188
- if (run.status !== "queued")
1189
- return run;
1190
- const agent = await getAgent(run.agentId);
1191
- if (!agent) {
1192
- await cancelRunInternal(run.id, "Cancelled because the agent no longer exists");
1193
- return null;
1194
- }
1195
- if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval") {
1196
- await cancelRunInternal(run.id, "Cancelled because the agent is not invokable");
1197
- return null;
1198
- }
1199
- const context = parseObject(run.contextSnapshot);
1200
- const budgetBlock = await budgets.getInvocationBlock(run.companyId, run.agentId, {
1201
- issueId: readNonEmptyString(context.issueId),
1202
- projectId: readNonEmptyString(context.projectId),
1203
- });
1204
- if (budgetBlock) {
1205
- await cancelRunInternal(run.id, budgetBlock.reason);
1206
- return null;
1207
- }
1208
- const claimedAt = new Date();
1209
- const claimed = await db
1210
- .update(heartbeatRuns)
1211
- .set({
1212
- status: "running",
1213
- startedAt: run.startedAt ?? claimedAt,
1214
- updatedAt: claimedAt,
1215
- })
1216
- .where(and(eq(heartbeatRuns.id, run.id), eq(heartbeatRuns.status, "queued")))
1217
- .returning()
1218
- .then((rows) => rows[0] ?? null);
1219
- if (!claimed)
1220
- return null;
1221
- publishLiveEvent({
1222
- companyId: claimed.companyId,
1223
- type: "heartbeat.run.status",
1224
- payload: {
1225
- runId: claimed.id,
1226
- agentId: claimed.agentId,
1227
- status: claimed.status,
1228
- invocationSource: claimed.invocationSource,
1229
- triggerDetail: claimed.triggerDetail,
1230
- error: claimed.error ?? null,
1231
- errorCode: claimed.errorCode ?? null,
1232
- startedAt: claimed.startedAt ? new Date(claimed.startedAt).toISOString() : null,
1233
- finishedAt: claimed.finishedAt ? new Date(claimed.finishedAt).toISOString() : null,
1234
- },
1235
- });
1236
- await setWakeupStatus(claimed.wakeupRequestId, "claimed", { claimedAt });
1237
- return claimed;
1238
- }
1239
- async function finalizeAgentStatus(agentId, outcome) {
1240
- const existing = await getAgent(agentId);
1241
- if (!existing)
1242
- return;
1243
- if (existing.status === "paused" || existing.status === "terminated") {
1244
- return;
1245
- }
1246
- const runningCount = await countRunningRunsForAgent(agentId);
1247
- const nextStatus = runningCount > 0
1248
- ? "running"
1249
- : outcome === "succeeded" || outcome === "cancelled"
1250
- ? "idle"
1251
- : "error";
1252
- const updated = await db
1253
- .update(agents)
1254
- .set({
1255
- status: nextStatus,
1256
- lastHeartbeatAt: new Date(),
1257
- updatedAt: new Date(),
1258
- })
1259
- .where(eq(agents.id, agentId))
1260
- .returning()
1261
- .then((rows) => rows[0] ?? null);
1262
- if (updated) {
1263
- publishLiveEvent({
1264
- companyId: updated.companyId,
1265
- type: "agent.status",
1266
- payload: {
1267
- agentId: updated.id,
1268
- status: updated.status,
1269
- lastHeartbeatAt: updated.lastHeartbeatAt
1270
- ? new Date(updated.lastHeartbeatAt).toISOString()
1271
- : null,
1272
- outcome,
1273
- },
1274
- });
1275
- }
1276
- }
1277
- async function reapOrphanedRuns(opts) {
1278
- const staleThresholdMs = opts?.staleThresholdMs ?? 0;
1279
- const now = new Date();
1280
- // Find all runs stuck in "running" state (queued runs are legitimately waiting; resumeQueuedRuns handles them)
1281
- const activeRuns = await db
1282
- .select({
1283
- run: heartbeatRuns,
1284
- adapterType: agents.adapterType,
1285
- })
1286
- .from(heartbeatRuns)
1287
- .innerJoin(agents, eq(heartbeatRuns.agentId, agents.id))
1288
- .where(eq(heartbeatRuns.status, "running"));
1289
- const reaped = [];
1290
- for (const { run, adapterType } of activeRuns) {
1291
- if (runningProcesses.has(run.id) || activeRunExecutions.has(run.id))
1292
- continue;
1293
- // Apply staleness threshold to avoid false positives
1294
- if (staleThresholdMs > 0) {
1295
- const refTime = run.updatedAt ? new Date(run.updatedAt).getTime() : 0;
1296
- if (now.getTime() - refTime < staleThresholdMs)
1297
- continue;
1298
- }
1299
- const tracksLocalChild = isTrackedLocalChildProcessAdapter(adapterType);
1300
- if (tracksLocalChild && run.processPid && isProcessAlive(run.processPid)) {
1301
- if (run.errorCode !== DETACHED_PROCESS_ERROR_CODE) {
1302
- const detachedMessage = `Lost in-memory process handle, but child pid ${run.processPid} is still alive`;
1303
- const detachedRun = await setRunStatus(run.id, "running", {
1304
- error: detachedMessage,
1305
- errorCode: DETACHED_PROCESS_ERROR_CODE,
1306
- });
1307
- if (detachedRun) {
1308
- await appendRunEvent(detachedRun, await nextRunEventSeq(detachedRun.id), {
1309
- eventType: "lifecycle",
1310
- stream: "system",
1311
- level: "warn",
1312
- message: detachedMessage,
1313
- payload: {
1314
- processPid: run.processPid,
1315
- },
1316
- });
1317
- }
1318
- }
1319
- continue;
1320
- }
1321
- const shouldRetry = tracksLocalChild && !!run.processPid && (run.processLossRetryCount ?? 0) < 1;
1322
- const baseMessage = run.processPid
1323
- ? `Process lost -- child pid ${run.processPid} is no longer running`
1324
- : "Process lost -- server may have restarted";
1325
- let finalizedRun = await setRunStatus(run.id, "failed", {
1326
- error: shouldRetry ? `${baseMessage}; retrying once` : baseMessage,
1327
- errorCode: "process_lost",
1328
- finishedAt: now,
1329
- });
1330
- await setWakeupStatus(run.wakeupRequestId, "failed", {
1331
- finishedAt: now,
1332
- error: shouldRetry ? `${baseMessage}; retrying once` : baseMessage,
1333
- });
1334
- if (!finalizedRun)
1335
- finalizedRun = await getRun(run.id);
1336
- if (!finalizedRun)
1337
- continue;
1338
- let retriedRun = null;
1339
- if (shouldRetry) {
1340
- const agent = await getAgent(run.agentId);
1341
- if (agent) {
1342
- retriedRun = await enqueueProcessLossRetry(finalizedRun, agent, now);
1343
- }
1344
- }
1345
- else {
1346
- await releaseIssueExecutionAndPromote(finalizedRun);
1347
- }
1348
- await appendRunEvent(finalizedRun, await nextRunEventSeq(finalizedRun.id), {
1349
- eventType: "lifecycle",
1350
- stream: "system",
1351
- level: "error",
1352
- message: shouldRetry
1353
- ? `${baseMessage}; queued retry ${retriedRun?.id ?? ""}`.trim()
1354
- : baseMessage,
1355
- payload: {
1356
- ...(run.processPid ? { processPid: run.processPid } : {}),
1357
- ...(retriedRun ? { retryRunId: retriedRun.id } : {}),
1358
- },
1359
- });
1360
- await finalizeAgentStatus(run.agentId, "failed");
1361
- await startNextQueuedRunForAgent(run.agentId);
1362
- runningProcesses.delete(run.id);
1363
- reaped.push(run.id);
1364
- }
1365
- if (reaped.length > 0) {
1366
- logger.warn({ reapedCount: reaped.length, runIds: reaped }, "reaped orphaned heartbeat runs");
1367
- }
1368
- return { reaped: reaped.length, runIds: reaped };
1369
- }
1370
- async function resumeQueuedRuns() {
1371
- const queuedRuns = await db
1372
- .select({ agentId: heartbeatRuns.agentId })
1373
- .from(heartbeatRuns)
1374
- .where(eq(heartbeatRuns.status, "queued"));
1375
- const agentIds = [...new Set(queuedRuns.map((r) => r.agentId))];
1376
- for (const agentId of agentIds) {
1377
- await startNextQueuedRunForAgent(agentId);
1378
- }
1379
- }
1380
- async function updateRuntimeState(agent, run, result, session, normalizedUsage) {
1381
- await ensureRuntimeState(agent);
1382
- const usage = normalizedUsage ?? normalizeUsageTotals(result.usage);
1383
- const inputTokens = usage?.inputTokens ?? 0;
1384
- const outputTokens = usage?.outputTokens ?? 0;
1385
- const cachedInputTokens = usage?.cachedInputTokens ?? 0;
1386
- const billingType = normalizeLedgerBillingType(result.billingType);
1387
- const additionalCostCents = normalizeBilledCostCents(result.costUsd, billingType);
1388
- const hasTokenUsage = inputTokens > 0 || outputTokens > 0 || cachedInputTokens > 0;
1389
- const provider = result.provider ?? "unknown";
1390
- const biller = resolveLedgerBiller(result);
1391
- const ledgerScope = await resolveLedgerScopeForRun(db, agent.companyId, run);
1392
- await db
1393
- .update(agentRuntimeState)
1394
- .set({
1395
- adapterType: agent.adapterType,
1396
- sessionId: session.legacySessionId,
1397
- lastRunId: run.id,
1398
- lastRunStatus: run.status,
1399
- lastError: result.errorMessage ?? null,
1400
- totalInputTokens: sql `${agentRuntimeState.totalInputTokens} + ${inputTokens}`,
1401
- totalOutputTokens: sql `${agentRuntimeState.totalOutputTokens} + ${outputTokens}`,
1402
- totalCachedInputTokens: sql `${agentRuntimeState.totalCachedInputTokens} + ${cachedInputTokens}`,
1403
- totalCostCents: sql `${agentRuntimeState.totalCostCents} + ${additionalCostCents}`,
1404
- updatedAt: new Date(),
1405
- })
1406
- .where(eq(agentRuntimeState.agentId, agent.id));
1407
- if (additionalCostCents > 0 || hasTokenUsage) {
1408
- const costs = costService(db, budgetHooks);
1409
- await costs.createEvent(agent.companyId, {
1410
- heartbeatRunId: run.id,
1411
- agentId: agent.id,
1412
- issueId: ledgerScope.issueId,
1413
- projectId: ledgerScope.projectId,
1414
- provider,
1415
- biller,
1416
- billingType,
1417
- model: result.model ?? "unknown",
1418
- inputTokens,
1419
- cachedInputTokens,
1420
- outputTokens,
1421
- costCents: additionalCostCents,
1422
- occurredAt: new Date(),
1423
- });
1424
- }
1425
- }
1426
- async function startNextQueuedRunForAgent(agentId) {
1427
- return withAgentStartLock(agentId, async () => {
1428
- const agent = await getAgent(agentId);
1429
- if (!agent)
1430
- return [];
1431
- if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval") {
1432
- return [];
1433
- }
1434
- const policy = parseHeartbeatPolicy(agent);
1435
- const runningCount = await countRunningRunsForAgent(agentId);
1436
- const availableSlots = Math.max(0, policy.maxConcurrentRuns - runningCount);
1437
- if (availableSlots <= 0)
1438
- return [];
1439
- const queuedRuns = await db
1440
- .select()
1441
- .from(heartbeatRuns)
1442
- .where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "queued")))
1443
- .orderBy(asc(heartbeatRuns.createdAt))
1444
- .limit(availableSlots);
1445
- if (queuedRuns.length === 0)
1446
- return [];
1447
- const claimedRuns = [];
1448
- for (const queuedRun of queuedRuns) {
1449
- const claimed = await claimQueuedRun(queuedRun);
1450
- if (claimed)
1451
- claimedRuns.push(claimed);
1452
- }
1453
- if (claimedRuns.length === 0)
1454
- return [];
1455
- for (const claimedRun of claimedRuns) {
1456
- void executeRun(claimedRun.id).catch((err) => {
1457
- logger.error({ err, runId: claimedRun.id }, "queued heartbeat execution failed");
1458
- });
1459
- }
1460
- return claimedRuns;
1461
- });
1462
- }
1463
- async function executeRun(runId) {
1464
- let run = await getRun(runId);
1465
- if (!run)
1466
- return;
1467
- if (run.status !== "queued" && run.status !== "running")
1468
- return;
1469
- if (run.status === "queued") {
1470
- const claimed = await claimQueuedRun(run);
1471
- if (!claimed) {
1472
- // Another worker has already claimed or finalized this run.
1473
- return;
1474
- }
1475
- run = claimed;
1476
- }
1477
- activeRunExecutions.add(run.id);
1478
- try {
1479
- const agent = await getAgent(run.agentId);
1480
- if (!agent) {
1481
- await setRunStatus(runId, "failed", {
1482
- error: "Agent not found",
1483
- errorCode: "agent_not_found",
1484
- finishedAt: new Date(),
1485
- });
1486
- await setWakeupStatus(run.wakeupRequestId, "failed", {
1487
- finishedAt: new Date(),
1488
- error: "Agent not found",
1489
- });
1490
- const failedRun = await getRun(runId);
1491
- if (failedRun)
1492
- await releaseIssueExecutionAndPromote(failedRun);
1493
- return;
1494
- }
1495
- const runtime = await ensureRuntimeState(agent);
1496
- const context = parseObject(run.contextSnapshot);
1497
- const taskKey = deriveTaskKey(context, null);
1498
- const sessionCodec = getAdapterSessionCodec(agent.adapterType);
1499
- const issueId = readNonEmptyString(context.issueId);
1500
- const issueContext = issueId
1501
- ? await db
1502
- .select({
1503
- id: issues.id,
1504
- identifier: issues.identifier,
1505
- title: issues.title,
1506
- projectId: issues.projectId,
1507
- projectWorkspaceId: issues.projectWorkspaceId,
1508
- executionWorkspaceId: issues.executionWorkspaceId,
1509
- executionWorkspacePreference: issues.executionWorkspacePreference,
1510
- assigneeAgentId: issues.assigneeAgentId,
1511
- assigneeAdapterOverrides: issues.assigneeAdapterOverrides,
1512
- executionWorkspaceSettings: issues.executionWorkspaceSettings,
1513
- })
1514
- .from(issues)
1515
- .where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
1516
- .then((rows) => rows[0] ?? null)
1517
- : null;
1518
- const issueAssigneeOverrides = issueContext && issueContext.assigneeAgentId === agent.id
1519
- ? parseIssueAssigneeAdapterOverrides(issueContext.assigneeAdapterOverrides)
1520
- : null;
1521
- const isolatedWorkspacesEnabled = (await instanceSettings.getExperimental()).enableIsolatedWorkspaces;
1522
- const issueExecutionWorkspaceSettings = isolatedWorkspacesEnabled
1523
- ? parseIssueExecutionWorkspaceSettings(issueContext?.executionWorkspaceSettings)
1524
- : null;
1525
- const contextProjectId = readNonEmptyString(context.projectId);
1526
- const executionProjectId = issueContext?.projectId ?? contextProjectId;
1527
- const projectExecutionWorkspacePolicy = executionProjectId
1528
- ? await db
1529
- .select({ executionWorkspacePolicy: projects.executionWorkspacePolicy })
1530
- .from(projects)
1531
- .where(and(eq(projects.id, executionProjectId), eq(projects.companyId, agent.companyId)))
1532
- .then((rows) => gateProjectExecutionWorkspacePolicy(parseProjectExecutionWorkspacePolicy(rows[0]?.executionWorkspacePolicy), isolatedWorkspacesEnabled))
1533
- : null;
1534
- const taskSession = taskKey
1535
- ? await getTaskSession(agent.companyId, agent.id, agent.adapterType, taskKey)
1536
- : null;
1537
- const resetTaskSession = shouldResetTaskSessionForWake(context);
1538
- const sessionResetReason = describeSessionResetReason(context);
1539
- const taskSessionForRun = resetTaskSession ? null : taskSession;
1540
- const previousSessionParams = normalizeSessionParams(sessionCodec.deserialize(taskSessionForRun?.sessionParamsJson ?? null));
1541
- const config = parseObject(agent.adapterConfig);
1542
- const executionWorkspaceMode = resolveExecutionWorkspaceMode({
1543
- projectPolicy: projectExecutionWorkspacePolicy,
1544
- issueSettings: issueExecutionWorkspaceSettings,
1545
- legacyUseProjectWorkspace: issueAssigneeOverrides?.useProjectWorkspace ?? null,
1546
- });
1547
- const resolvedWorkspace = await resolveWorkspaceForRun(agent, context, previousSessionParams, { useProjectWorkspace: executionWorkspaceMode !== "agent_default" });
1548
- const workspaceManagedConfig = buildExecutionWorkspaceAdapterConfig({
1549
- agentConfig: config,
1550
- projectPolicy: projectExecutionWorkspacePolicy,
1551
- issueSettings: issueExecutionWorkspaceSettings,
1552
- mode: executionWorkspaceMode,
1553
- legacyUseProjectWorkspace: issueAssigneeOverrides?.useProjectWorkspace ?? null,
1554
- });
1555
- const mergedConfig = issueAssigneeOverrides?.adapterConfig
1556
- ? { ...workspaceManagedConfig, ...issueAssigneeOverrides.adapterConfig }
1557
- : workspaceManagedConfig;
1558
- const { config: resolvedConfig, secretKeys } = await secretsSvc.resolveAdapterConfigForRuntime(agent.companyId, mergedConfig);
1559
- const issueRef = issueContext
1560
- ? {
1561
- id: issueContext.id,
1562
- identifier: issueContext.identifier,
1563
- title: issueContext.title,
1564
- projectId: issueContext.projectId,
1565
- projectWorkspaceId: issueContext.projectWorkspaceId,
1566
- executionWorkspaceId: issueContext.executionWorkspaceId,
1567
- executionWorkspacePreference: issueContext.executionWorkspacePreference,
1568
- }
1569
- : null;
1570
- const existingExecutionWorkspace = issueRef?.executionWorkspaceId ? await executionWorkspacesSvc.getById(issueRef.executionWorkspaceId) : null;
1571
- const workspaceOperationRecorder = workspaceOperationsSvc.createRecorder({
1572
- companyId: agent.companyId,
1573
- heartbeatRunId: run.id,
1574
- executionWorkspaceId: existingExecutionWorkspace?.id ?? null,
1575
- });
1576
- const executionWorkspace = await realizeExecutionWorkspace({
1577
- base: {
1578
- baseCwd: resolvedWorkspace.cwd,
1579
- source: resolvedWorkspace.source,
1580
- projectId: resolvedWorkspace.projectId,
1581
- workspaceId: resolvedWorkspace.workspaceId,
1582
- repoUrl: resolvedWorkspace.repoUrl,
1583
- repoRef: resolvedWorkspace.repoRef,
1584
- },
1585
- config: resolvedConfig,
1586
- issue: issueRef,
1587
- agent: {
1588
- id: agent.id,
1589
- name: agent.name,
1590
- companyId: agent.companyId,
1591
- },
1592
- recorder: workspaceOperationRecorder,
1593
- });
1594
- const resolvedProjectId = executionWorkspace.projectId ?? issueRef?.projectId ?? executionProjectId ?? null;
1595
- const resolvedProjectWorkspaceId = issueRef?.projectWorkspaceId ?? resolvedWorkspace.workspaceId ?? null;
1596
- const shouldReuseExisting = issueRef?.executionWorkspacePreference === "reuse_existing" &&
1597
- existingExecutionWorkspace &&
1598
- existingExecutionWorkspace.status !== "archived";
1599
- let persistedExecutionWorkspace = null;
1600
- try {
1601
- persistedExecutionWorkspace = shouldReuseExisting && existingExecutionWorkspace
1602
- ? await executionWorkspacesSvc.update(existingExecutionWorkspace.id, {
1603
- cwd: executionWorkspace.cwd,
1604
- repoUrl: executionWorkspace.repoUrl,
1605
- baseRef: executionWorkspace.repoRef,
1606
- branchName: executionWorkspace.branchName,
1607
- providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
1608
- providerRef: executionWorkspace.worktreePath,
1609
- status: "active",
1610
- lastUsedAt: new Date(),
1611
- metadata: {
1612
- ...(existingExecutionWorkspace.metadata ?? {}),
1613
- source: executionWorkspace.source,
1614
- createdByRuntime: executionWorkspace.created,
1615
- },
1616
- })
1617
- : resolvedProjectId
1618
- ? await executionWorkspacesSvc.create({
1619
- companyId: agent.companyId,
1620
- projectId: resolvedProjectId,
1621
- projectWorkspaceId: resolvedProjectWorkspaceId,
1622
- sourceIssueId: issueRef?.id ?? null,
1623
- mode: executionWorkspaceMode === "isolated_workspace"
1624
- ? "isolated_workspace"
1625
- : executionWorkspaceMode === "operator_branch"
1626
- ? "operator_branch"
1627
- : executionWorkspaceMode === "agent_default"
1628
- ? "adapter_managed"
1629
- : "shared_workspace",
1630
- strategyType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "project_primary",
1631
- name: executionWorkspace.branchName ?? issueRef?.identifier ?? `workspace-${agent.id.slice(0, 8)}`,
1632
- status: "active",
1633
- cwd: executionWorkspace.cwd,
1634
- repoUrl: executionWorkspace.repoUrl,
1635
- baseRef: executionWorkspace.repoRef,
1636
- branchName: executionWorkspace.branchName,
1637
- providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
1638
- providerRef: executionWorkspace.worktreePath,
1639
- lastUsedAt: new Date(),
1640
- openedAt: new Date(),
1641
- metadata: {
1642
- source: executionWorkspace.source,
1643
- createdByRuntime: executionWorkspace.created,
1644
- },
1645
- })
1646
- : null;
1647
- }
1648
- catch (error) {
1649
- if (executionWorkspace.created) {
1650
- try {
1651
- await cleanupExecutionWorkspaceArtifacts({
1652
- workspace: {
1653
- id: existingExecutionWorkspace?.id ?? `transient-${run.id}`,
1654
- cwd: executionWorkspace.cwd,
1655
- providerType: executionWorkspace.strategy === "git_worktree" ? "git_worktree" : "local_fs",
1656
- providerRef: executionWorkspace.worktreePath,
1657
- branchName: executionWorkspace.branchName,
1658
- repoUrl: executionWorkspace.repoUrl,
1659
- baseRef: executionWorkspace.repoRef,
1660
- projectId: resolvedProjectId,
1661
- projectWorkspaceId: resolvedProjectWorkspaceId,
1662
- sourceIssueId: issueRef?.id ?? null,
1663
- metadata: {
1664
- createdByRuntime: true,
1665
- source: executionWorkspace.source,
1666
- },
1667
- },
1668
- projectWorkspace: {
1669
- cwd: resolvedWorkspace.cwd,
1670
- cleanupCommand: null,
1671
- },
1672
- teardownCommand: projectExecutionWorkspacePolicy?.workspaceStrategy?.teardownCommand ?? null,
1673
- recorder: workspaceOperationRecorder,
1674
- });
1675
- }
1676
- catch (cleanupError) {
1677
- logger.warn({
1678
- runId: run.id,
1679
- issueId,
1680
- executionWorkspaceCwd: executionWorkspace.cwd,
1681
- cleanupError: cleanupError instanceof Error ? cleanupError.message : String(cleanupError),
1682
- }, "Failed to cleanup realized execution workspace after persistence failure");
1683
- }
1684
- }
1685
- throw error;
1686
- }
1687
- await workspaceOperationRecorder.attachExecutionWorkspaceId(persistedExecutionWorkspace?.id ?? null);
1688
- if (existingExecutionWorkspace &&
1689
- persistedExecutionWorkspace &&
1690
- existingExecutionWorkspace.id !== persistedExecutionWorkspace.id &&
1691
- existingExecutionWorkspace.status === "active") {
1692
- await executionWorkspacesSvc.update(existingExecutionWorkspace.id, {
1693
- status: "idle",
1694
- cleanupReason: null,
1695
- });
1696
- }
1697
- if (issueId && persistedExecutionWorkspace && issueRef?.executionWorkspaceId !== persistedExecutionWorkspace.id) {
1698
- await issuesSvc.update(issueId, {
1699
- executionWorkspaceId: persistedExecutionWorkspace.id,
1700
- ...(resolvedProjectWorkspaceId ? { projectWorkspaceId: resolvedProjectWorkspaceId } : {}),
1701
- });
1702
- }
1703
- if (persistedExecutionWorkspace) {
1704
- context.executionWorkspaceId = persistedExecutionWorkspace.id;
1705
- await db
1706
- .update(heartbeatRuns)
1707
- .set({
1708
- contextSnapshot: context,
1709
- updatedAt: new Date(),
1710
- })
1711
- .where(eq(heartbeatRuns.id, run.id));
1712
- }
1713
- const runtimeSessionResolution = resolveRuntimeSessionParamsForWorkspace({
1714
- agentId: agent.id,
1715
- previousSessionParams,
1716
- resolvedWorkspace: {
1717
- ...resolvedWorkspace,
1718
- cwd: executionWorkspace.cwd,
1719
- },
1720
- });
1721
- const runtimeSessionParams = runtimeSessionResolution.sessionParams;
1722
- const runtimeWorkspaceWarnings = [
1723
- ...resolvedWorkspace.warnings,
1724
- ...executionWorkspace.warnings,
1725
- ...(runtimeSessionResolution.warning ? [runtimeSessionResolution.warning] : []),
1726
- ...(resetTaskSession && sessionResetReason
1727
- ? [
1728
- taskKey
1729
- ? `Skipping saved session resume for task "${taskKey}" because ${sessionResetReason}.`
1730
- : `Skipping saved session resume because ${sessionResetReason}.`,
1731
- ]
1732
- : []),
1733
- ];
1734
- context.paperclipWorkspace = {
1735
- cwd: executionWorkspace.cwd,
1736
- source: executionWorkspace.source,
1737
- mode: executionWorkspaceMode,
1738
- strategy: executionWorkspace.strategy,
1739
- projectId: executionWorkspace.projectId,
1740
- workspaceId: executionWorkspace.workspaceId,
1741
- repoUrl: executionWorkspace.repoUrl,
1742
- repoRef: executionWorkspace.repoRef,
1743
- branchName: executionWorkspace.branchName,
1744
- worktreePath: executionWorkspace.worktreePath,
1745
- agentHome: resolveDefaultAgentWorkspaceDir(agent.id),
1746
- };
1747
- context.paperclipWorkspaces = resolvedWorkspace.workspaceHints;
1748
- const runtimeServiceIntents = (() => {
1749
- const runtimeConfig = parseObject(resolvedConfig.workspaceRuntime);
1750
- return Array.isArray(runtimeConfig.services)
1751
- ? runtimeConfig.services.filter((value) => typeof value === "object" && value !== null)
1752
- : [];
1753
- })();
1754
- if (runtimeServiceIntents.length > 0) {
1755
- context.paperclipRuntimeServiceIntents = runtimeServiceIntents;
1756
- }
1757
- else {
1758
- delete context.paperclipRuntimeServiceIntents;
1759
- }
1760
- if (executionWorkspace.projectId && !readNonEmptyString(context.projectId)) {
1761
- context.projectId = executionWorkspace.projectId;
1762
- }
1763
- const runtimeSessionFallback = taskKey || resetTaskSession ? null : runtime.sessionId;
1764
- let previousSessionDisplayId = truncateDisplayId(taskSessionForRun?.sessionDisplayId ??
1765
- (sessionCodec.getDisplayId ? sessionCodec.getDisplayId(runtimeSessionParams) : null) ??
1766
- readNonEmptyString(runtimeSessionParams?.sessionId) ??
1767
- runtimeSessionFallback);
1768
- let runtimeSessionIdForAdapter = readNonEmptyString(runtimeSessionParams?.sessionId) ?? runtimeSessionFallback;
1769
- let runtimeSessionParamsForAdapter = runtimeSessionParams;
1770
- const sessionCompaction = await evaluateSessionCompaction({
1771
- agent,
1772
- sessionId: previousSessionDisplayId ?? runtimeSessionIdForAdapter,
1773
- issueId,
1774
- });
1775
- if (sessionCompaction.rotate) {
1776
- context.paperclipSessionHandoffMarkdown = sessionCompaction.handoffMarkdown;
1777
- context.paperclipSessionRotationReason = sessionCompaction.reason;
1778
- context.paperclipPreviousSessionId = previousSessionDisplayId ?? runtimeSessionIdForAdapter;
1779
- runtimeSessionIdForAdapter = null;
1780
- runtimeSessionParamsForAdapter = null;
1781
- previousSessionDisplayId = null;
1782
- if (sessionCompaction.reason) {
1783
- runtimeWorkspaceWarnings.push(`Starting a fresh session because ${sessionCompaction.reason}.`);
1784
- }
1785
- }
1786
- else {
1787
- delete context.paperclipSessionHandoffMarkdown;
1788
- delete context.paperclipSessionRotationReason;
1789
- delete context.paperclipPreviousSessionId;
1790
- }
1791
- const runtimeForAdapter = {
1792
- sessionId: runtimeSessionIdForAdapter,
1793
- sessionParams: runtimeSessionParamsForAdapter,
1794
- sessionDisplayId: previousSessionDisplayId,
1795
- taskKey,
1796
- };
1797
- let seq = 1;
1798
- let handle = null;
1799
- let stdoutExcerpt = "";
1800
- let stderrExcerpt = "";
1801
- try {
1802
- const startedAt = run.startedAt ?? new Date();
1803
- const runningWithSession = await db
1804
- .update(heartbeatRuns)
1805
- .set({
1806
- startedAt,
1807
- sessionIdBefore: runtimeForAdapter.sessionDisplayId ?? runtimeForAdapter.sessionId,
1808
- contextSnapshot: context,
1809
- updatedAt: new Date(),
1810
- })
1811
- .where(eq(heartbeatRuns.id, run.id))
1812
- .returning()
1813
- .then((rows) => rows[0] ?? null);
1814
- if (runningWithSession)
1815
- run = runningWithSession;
1816
- const runningAgent = await db
1817
- .update(agents)
1818
- .set({ status: "running", updatedAt: new Date() })
1819
- .where(eq(agents.id, agent.id))
1820
- .returning()
1821
- .then((rows) => rows[0] ?? null);
1822
- if (runningAgent) {
1823
- publishLiveEvent({
1824
- companyId: runningAgent.companyId,
1825
- type: "agent.status",
1826
- payload: {
1827
- agentId: runningAgent.id,
1828
- status: runningAgent.status,
1829
- outcome: "running",
1830
- },
1831
- });
1832
- }
1833
- const currentRun = run;
1834
- await appendRunEvent(currentRun, seq++, {
1835
- eventType: "lifecycle",
1836
- stream: "system",
1837
- level: "info",
1838
- message: "run started",
1839
- });
1840
- handle = await runLogStore.begin({
1841
- companyId: run.companyId,
1842
- agentId: run.agentId,
1843
- runId,
1844
- });
1845
- await db
1846
- .update(heartbeatRuns)
1847
- .set({
1848
- logStore: handle.store,
1849
- logRef: handle.logRef,
1850
- updatedAt: new Date(),
1851
- })
1852
- .where(eq(heartbeatRuns.id, runId));
1853
- const onLog = async (stream, chunk) => {
1854
- const sanitizedChunk = redactCurrentUserText(chunk);
1855
- if (stream === "stdout")
1856
- stdoutExcerpt = appendExcerpt(stdoutExcerpt, sanitizedChunk);
1857
- if (stream === "stderr")
1858
- stderrExcerpt = appendExcerpt(stderrExcerpt, sanitizedChunk);
1859
- const ts = new Date().toISOString();
1860
- if (handle) {
1861
- await runLogStore.append(handle, {
1862
- stream,
1863
- chunk: sanitizedChunk,
1864
- ts,
1865
- });
1866
- }
1867
- const payloadChunk = sanitizedChunk.length > MAX_LIVE_LOG_CHUNK_BYTES
1868
- ? sanitizedChunk.slice(sanitizedChunk.length - MAX_LIVE_LOG_CHUNK_BYTES)
1869
- : sanitizedChunk;
1870
- publishLiveEvent({
1871
- companyId: run.companyId,
1872
- type: "heartbeat.run.log",
1873
- payload: {
1874
- runId: run.id,
1875
- agentId: run.agentId,
1876
- ts,
1877
- stream,
1878
- chunk: payloadChunk,
1879
- truncated: payloadChunk.length !== sanitizedChunk.length,
1880
- },
1881
- });
1882
- };
1883
- for (const warning of runtimeWorkspaceWarnings) {
1884
- const logEntry = formatRuntimeWorkspaceWarningLog(warning);
1885
- await onLog(logEntry.stream, logEntry.chunk);
1886
- }
1887
- const adapterEnv = Object.fromEntries(Object.entries(parseObject(resolvedConfig.env)).filter((entry) => typeof entry[0] === "string" && typeof entry[1] === "string"));
1888
- const runtimeServices = await ensureRuntimeServicesForRun({
1889
- db,
1890
- runId: run.id,
1891
- agent: {
1892
- id: agent.id,
1893
- name: agent.name,
1894
- companyId: agent.companyId,
1895
- },
1896
- issue: issueRef,
1897
- workspace: executionWorkspace,
1898
- executionWorkspaceId: persistedExecutionWorkspace?.id ?? issueRef?.executionWorkspaceId ?? null,
1899
- config: resolvedConfig,
1900
- adapterEnv,
1901
- onLog,
1902
- });
1903
- if (runtimeServices.length > 0) {
1904
- context.paperclipRuntimeServices = runtimeServices;
1905
- context.paperclipRuntimePrimaryUrl =
1906
- runtimeServices.find((service) => readNonEmptyString(service.url))?.url ?? null;
1907
- await db
1908
- .update(heartbeatRuns)
1909
- .set({
1910
- contextSnapshot: context,
1911
- updatedAt: new Date(),
1912
- })
1913
- .where(eq(heartbeatRuns.id, run.id));
1914
- }
1915
- if (issueId && (executionWorkspace.created || runtimeServices.some((service) => !service.reused))) {
1916
- try {
1917
- await issuesSvc.addComment(issueId, buildWorkspaceReadyComment({
1918
- workspace: executionWorkspace,
1919
- runtimeServices,
1920
- }), { agentId: agent.id });
1921
- }
1922
- catch (err) {
1923
- await onLog("stderr", `[paperclip] Failed to post workspace-ready comment: ${err instanceof Error ? err.message : String(err)}\n`);
1924
- }
1925
- }
1926
- const onAdapterMeta = async (meta) => {
1927
- if (meta.env && secretKeys.size > 0) {
1928
- for (const key of secretKeys) {
1929
- if (key in meta.env)
1930
- meta.env[key] = "***REDACTED***";
1931
- }
1932
- }
1933
- await appendRunEvent(currentRun, seq++, {
1934
- eventType: "adapter.invoke",
1935
- stream: "system",
1936
- level: "info",
1937
- message: "adapter invocation",
1938
- payload: meta,
1939
- });
1940
- };
1941
- const adapter = getServerAdapter(agent.adapterType);
1942
- const authToken = adapter.supportsLocalAgentJwt
1943
- ? createLocalAgentJwt(agent.id, agent.companyId, agent.adapterType, run.id)
1944
- : null;
1945
- if (adapter.supportsLocalAgentJwt && !authToken) {
1946
- logger.warn({
1947
- companyId: agent.companyId,
1948
- agentId: agent.id,
1949
- runId: run.id,
1950
- adapterType: agent.adapterType,
1951
- }, "local agent jwt secret missing or invalid; running without injected PAPERCLIP_API_KEY");
1952
- }
1953
- const adapterResult = await adapter.execute({
1954
- runId: run.id,
1955
- agent,
1956
- runtime: runtimeForAdapter,
1957
- config: resolvedConfig,
1958
- context,
1959
- onLog,
1960
- onMeta: onAdapterMeta,
1961
- onSpawn: async (meta) => {
1962
- await persistRunProcessMetadata(run.id, meta);
1963
- },
1964
- authToken: authToken ?? undefined,
1965
- });
1966
- const adapterManagedRuntimeServices = adapterResult.runtimeServices
1967
- ? await persistAdapterManagedRuntimeServices({
1968
- db,
1969
- adapterType: agent.adapterType,
1970
- runId: run.id,
1971
- agent: {
1972
- id: agent.id,
1973
- name: agent.name,
1974
- companyId: agent.companyId,
1975
- },
1976
- issue: issueRef,
1977
- workspace: executionWorkspace,
1978
- reports: adapterResult.runtimeServices,
1979
- })
1980
- : [];
1981
- if (adapterManagedRuntimeServices.length > 0) {
1982
- const combinedRuntimeServices = [
1983
- ...runtimeServices,
1984
- ...adapterManagedRuntimeServices,
1985
- ];
1986
- context.paperclipRuntimeServices = combinedRuntimeServices;
1987
- context.paperclipRuntimePrimaryUrl =
1988
- combinedRuntimeServices.find((service) => readNonEmptyString(service.url))?.url ?? null;
1989
- await db
1990
- .update(heartbeatRuns)
1991
- .set({
1992
- contextSnapshot: context,
1993
- updatedAt: new Date(),
1994
- })
1995
- .where(eq(heartbeatRuns.id, run.id));
1996
- if (issueId) {
1997
- try {
1998
- await issuesSvc.addComment(issueId, buildWorkspaceReadyComment({
1999
- workspace: executionWorkspace,
2000
- runtimeServices: adapterManagedRuntimeServices,
2001
- }), { agentId: agent.id });
2002
- }
2003
- catch (err) {
2004
- await onLog("stderr", `[paperclip] Failed to post adapter-managed runtime comment: ${err instanceof Error ? err.message : String(err)}\n`);
2005
- }
2006
- }
2007
- }
2008
- const nextSessionState = resolveNextSessionState({
2009
- codec: sessionCodec,
2010
- adapterResult,
2011
- previousParams: previousSessionParams,
2012
- previousDisplayId: runtimeForAdapter.sessionDisplayId,
2013
- previousLegacySessionId: runtimeForAdapter.sessionId,
2014
- });
2015
- const rawUsage = normalizeUsageTotals(adapterResult.usage);
2016
- const sessionUsageResolution = await resolveNormalizedUsageForSession({
2017
- agentId: agent.id,
2018
- runId: run.id,
2019
- sessionId: nextSessionState.displayId ?? nextSessionState.legacySessionId,
2020
- rawUsage,
2021
- });
2022
- const normalizedUsage = sessionUsageResolution.normalizedUsage;
2023
- let outcome;
2024
- const latestRun = await getRun(run.id);
2025
- if (latestRun?.status === "cancelled") {
2026
- outcome = "cancelled";
2027
- }
2028
- else if (adapterResult.timedOut) {
2029
- outcome = "timed_out";
2030
- }
2031
- else if ((adapterResult.exitCode ?? 0) === 0 && !adapterResult.errorMessage) {
2032
- outcome = "succeeded";
2033
- }
2034
- else {
2035
- outcome = "failed";
2036
- }
2037
- let logSummary = null;
2038
- if (handle) {
2039
- logSummary = await runLogStore.finalize(handle);
2040
- }
2041
- const status = outcome === "succeeded"
2042
- ? "succeeded"
2043
- : outcome === "cancelled"
2044
- ? "cancelled"
2045
- : outcome === "timed_out"
2046
- ? "timed_out"
2047
- : "failed";
2048
- const usageJson = normalizedUsage || adapterResult.costUsd != null
2049
- ? {
2050
- ...(normalizedUsage ?? {}),
2051
- ...(rawUsage ? {
2052
- rawInputTokens: rawUsage.inputTokens,
2053
- rawCachedInputTokens: rawUsage.cachedInputTokens,
2054
- rawOutputTokens: rawUsage.outputTokens,
2055
- } : {}),
2056
- ...(sessionUsageResolution.derivedFromSessionTotals ? { usageSource: "session_delta" } : {}),
2057
- ...((nextSessionState.displayId ?? nextSessionState.legacySessionId)
2058
- ? { persistedSessionId: nextSessionState.displayId ?? nextSessionState.legacySessionId }
2059
- : {}),
2060
- sessionReused: runtimeForAdapter.sessionId != null || runtimeForAdapter.sessionDisplayId != null,
2061
- taskSessionReused: taskSessionForRun != null,
2062
- freshSession: runtimeForAdapter.sessionId == null && runtimeForAdapter.sessionDisplayId == null,
2063
- sessionRotated: sessionCompaction.rotate,
2064
- sessionRotationReason: sessionCompaction.reason,
2065
- provider: readNonEmptyString(adapterResult.provider) ?? "unknown",
2066
- biller: resolveLedgerBiller(adapterResult),
2067
- model: readNonEmptyString(adapterResult.model) ?? "unknown",
2068
- ...(adapterResult.costUsd != null ? { costUsd: adapterResult.costUsd } : {}),
2069
- billingType: normalizeLedgerBillingType(adapterResult.billingType),
2070
- }
2071
- : null;
2072
- await setRunStatus(run.id, status, {
2073
- finishedAt: new Date(),
2074
- error: outcome === "succeeded"
2075
- ? null
2076
- : redactCurrentUserText(adapterResult.errorMessage ?? (outcome === "timed_out" ? "Timed out" : "Adapter failed")),
2077
- errorCode: outcome === "timed_out"
2078
- ? "timeout"
2079
- : outcome === "cancelled"
2080
- ? "cancelled"
2081
- : outcome === "failed"
2082
- ? (adapterResult.errorCode ?? "adapter_failed")
2083
- : null,
2084
- exitCode: adapterResult.exitCode,
2085
- signal: adapterResult.signal,
2086
- usageJson,
2087
- resultJson: adapterResult.resultJson ?? null,
2088
- sessionIdAfter: nextSessionState.displayId ?? nextSessionState.legacySessionId,
2089
- stdoutExcerpt,
2090
- stderrExcerpt,
2091
- logBytes: logSummary?.bytes,
2092
- logSha256: logSummary?.sha256,
2093
- logCompressed: logSummary?.compressed ?? false,
2094
- });
2095
- await setWakeupStatus(run.wakeupRequestId, outcome === "succeeded" ? "completed" : status, {
2096
- finishedAt: new Date(),
2097
- error: adapterResult.errorMessage ?? null,
2098
- });
2099
- const finalizedRun = await getRun(run.id);
2100
- if (finalizedRun) {
2101
- await appendRunEvent(finalizedRun, seq++, {
2102
- eventType: "lifecycle",
2103
- stream: "system",
2104
- level: outcome === "succeeded" ? "info" : "error",
2105
- message: `run ${outcome}`,
2106
- payload: {
2107
- status,
2108
- exitCode: adapterResult.exitCode,
2109
- },
2110
- });
2111
- await releaseIssueExecutionAndPromote(finalizedRun);
2112
- }
2113
- if (finalizedRun) {
2114
- await updateRuntimeState(agent, finalizedRun, adapterResult, {
2115
- legacySessionId: nextSessionState.legacySessionId,
2116
- }, normalizedUsage);
2117
- if (taskKey) {
2118
- if (adapterResult.clearSession || (!nextSessionState.params && !nextSessionState.displayId)) {
2119
- await clearTaskSessions(agent.companyId, agent.id, {
2120
- taskKey,
2121
- adapterType: agent.adapterType,
2122
- });
2123
- }
2124
- else {
2125
- await upsertTaskSession({
2126
- companyId: agent.companyId,
2127
- agentId: agent.id,
2128
- adapterType: agent.adapterType,
2129
- taskKey,
2130
- sessionParamsJson: nextSessionState.params,
2131
- sessionDisplayId: nextSessionState.displayId,
2132
- lastRunId: finalizedRun.id,
2133
- lastError: outcome === "succeeded" ? null : (adapterResult.errorMessage ?? "run_failed"),
2134
- });
2135
- }
2136
- }
2137
- }
2138
- await finalizeAgentStatus(agent.id, outcome);
2139
- }
2140
- catch (err) {
2141
- const message = redactCurrentUserText(err instanceof Error ? err.message : "Unknown adapter failure");
2142
- logger.error({ err, runId }, "heartbeat execution failed");
2143
- let logSummary = null;
2144
- if (handle) {
2145
- try {
2146
- logSummary = await runLogStore.finalize(handle);
2147
- }
2148
- catch (finalizeErr) {
2149
- logger.warn({ err: finalizeErr, runId }, "failed to finalize run log after error");
2150
- }
2151
- }
2152
- const failedRun = await setRunStatus(run.id, "failed", {
2153
- error: message,
2154
- errorCode: "adapter_failed",
2155
- finishedAt: new Date(),
2156
- stdoutExcerpt,
2157
- stderrExcerpt,
2158
- logBytes: logSummary?.bytes,
2159
- logSha256: logSummary?.sha256,
2160
- logCompressed: logSummary?.compressed ?? false,
2161
- });
2162
- await setWakeupStatus(run.wakeupRequestId, "failed", {
2163
- finishedAt: new Date(),
2164
- error: message,
2165
- });
2166
- if (failedRun) {
2167
- await appendRunEvent(failedRun, seq++, {
2168
- eventType: "error",
2169
- stream: "system",
2170
- level: "error",
2171
- message,
2172
- });
2173
- await releaseIssueExecutionAndPromote(failedRun);
2174
- await updateRuntimeState(agent, failedRun, {
2175
- exitCode: null,
2176
- signal: null,
2177
- timedOut: false,
2178
- errorMessage: message,
2179
- }, {
2180
- legacySessionId: runtimeForAdapter.sessionId,
2181
- });
2182
- if (taskKey && (previousSessionParams || previousSessionDisplayId || taskSession)) {
2183
- await upsertTaskSession({
2184
- companyId: agent.companyId,
2185
- agentId: agent.id,
2186
- adapterType: agent.adapterType,
2187
- taskKey,
2188
- sessionParamsJson: previousSessionParams,
2189
- sessionDisplayId: previousSessionDisplayId,
2190
- lastRunId: failedRun.id,
2191
- lastError: message,
2192
- });
2193
- }
2194
- }
2195
- await finalizeAgentStatus(agent.id, "failed");
2196
- }
2197
- }
2198
- catch (outerErr) {
2199
- // Setup code before adapter.execute threw (e.g. ensureRuntimeState, resolveWorkspaceForRun).
2200
- // The inner catch did not fire, so we must record the failure here.
2201
- const message = outerErr instanceof Error ? outerErr.message : "Unknown setup failure";
2202
- logger.error({ err: outerErr, runId }, "heartbeat execution setup failed");
2203
- await setRunStatus(runId, "failed", {
2204
- error: message,
2205
- errorCode: "adapter_failed",
2206
- finishedAt: new Date(),
2207
- }).catch(() => undefined);
2208
- await setWakeupStatus(run.wakeupRequestId, "failed", {
2209
- finishedAt: new Date(),
2210
- error: message,
2211
- }).catch(() => undefined);
2212
- const failedRun = await getRun(runId).catch(() => null);
2213
- if (failedRun) {
2214
- // Emit a run-log event so the failure is visible in the run timeline,
2215
- // consistent with what the inner catch block does for adapter failures.
2216
- await appendRunEvent(failedRun, 1, {
2217
- eventType: "error",
2218
- stream: "system",
2219
- level: "error",
2220
- message,
2221
- }).catch(() => undefined);
2222
- await releaseIssueExecutionAndPromote(failedRun).catch(() => undefined);
2223
- }
2224
- // Ensure the agent is not left stuck in "running" if the inner catch handler's
2225
- // DB calls threw (e.g. a transient DB error in finalizeAgentStatus).
2226
- await finalizeAgentStatus(run.agentId, "failed").catch(() => undefined);
2227
- }
2228
- finally {
2229
- await releaseRuntimeServicesForRun(run.id).catch(() => undefined);
2230
- activeRunExecutions.delete(run.id);
2231
- await startNextQueuedRunForAgent(run.agentId);
2232
- }
2233
- }
2234
- async function releaseIssueExecutionAndPromote(run) {
2235
- const promotedRun = await db.transaction(async (tx) => {
2236
- await tx.execute(sql `select id from issues where company_id = ${run.companyId} and execution_run_id = ${run.id} for update`);
2237
- const issue = await tx
2238
- .select({
2239
- id: issues.id,
2240
- companyId: issues.companyId,
2241
- })
2242
- .from(issues)
2243
- .where(and(eq(issues.companyId, run.companyId), eq(issues.executionRunId, run.id)))
2244
- .then((rows) => rows[0] ?? null);
2245
- if (!issue)
2246
- return;
2247
- await tx
2248
- .update(issues)
2249
- .set({
2250
- executionRunId: null,
2251
- executionAgentNameKey: null,
2252
- executionLockedAt: null,
2253
- updatedAt: new Date(),
2254
- })
2255
- .where(eq(issues.id, issue.id));
2256
- while (true) {
2257
- const deferred = await tx
2258
- .select()
2259
- .from(agentWakeupRequests)
2260
- .where(and(eq(agentWakeupRequests.companyId, issue.companyId), eq(agentWakeupRequests.status, "deferred_issue_execution"), sql `${agentWakeupRequests.payload} ->> 'issueId' = ${issue.id}`))
2261
- .orderBy(asc(agentWakeupRequests.requestedAt))
2262
- .limit(1)
2263
- .then((rows) => rows[0] ?? null);
2264
- if (!deferred)
2265
- return null;
2266
- const deferredAgent = await tx
2267
- .select()
2268
- .from(agents)
2269
- .where(eq(agents.id, deferred.agentId))
2270
- .then((rows) => rows[0] ?? null);
2271
- if (!deferredAgent ||
2272
- deferredAgent.companyId !== issue.companyId ||
2273
- deferredAgent.status === "paused" ||
2274
- deferredAgent.status === "terminated" ||
2275
- deferredAgent.status === "pending_approval") {
2276
- await tx
2277
- .update(agentWakeupRequests)
2278
- .set({
2279
- status: "failed",
2280
- finishedAt: new Date(),
2281
- error: "Deferred wake could not be promoted: agent is not invokable",
2282
- updatedAt: new Date(),
2283
- })
2284
- .where(eq(agentWakeupRequests.id, deferred.id));
2285
- continue;
2286
- }
2287
- const deferredPayload = parseObject(deferred.payload);
2288
- const deferredContextSeed = parseObject(deferredPayload[DEFERRED_WAKE_CONTEXT_KEY]);
2289
- const promotedContextSeed = { ...deferredContextSeed };
2290
- const promotedReason = readNonEmptyString(deferred.reason) ?? "issue_execution_promoted";
2291
- const promotedSource = readNonEmptyString(deferred.source) ?? "automation";
2292
- const promotedTriggerDetail = readNonEmptyString(deferred.triggerDetail) ?? null;
2293
- const promotedPayload = deferredPayload;
2294
- delete promotedPayload[DEFERRED_WAKE_CONTEXT_KEY];
2295
- const { contextSnapshot: promotedContextSnapshot, taskKey: promotedTaskKey, } = enrichWakeContextSnapshot({
2296
- contextSnapshot: promotedContextSeed,
2297
- reason: promotedReason,
2298
- source: promotedSource,
2299
- triggerDetail: promotedTriggerDetail,
2300
- payload: promotedPayload,
2301
- });
2302
- const sessionBefore = await resolveSessionBeforeForWakeup(deferredAgent, promotedTaskKey);
2303
- const now = new Date();
2304
- const newRun = await tx
2305
- .insert(heartbeatRuns)
2306
- .values({
2307
- companyId: deferredAgent.companyId,
2308
- agentId: deferredAgent.id,
2309
- invocationSource: promotedSource,
2310
- triggerDetail: promotedTriggerDetail,
2311
- status: "queued",
2312
- wakeupRequestId: deferred.id,
2313
- contextSnapshot: promotedContextSnapshot,
2314
- sessionIdBefore: sessionBefore,
2315
- })
2316
- .returning()
2317
- .then((rows) => rows[0]);
2318
- await tx
2319
- .update(agentWakeupRequests)
2320
- .set({
2321
- status: "queued",
2322
- reason: "issue_execution_promoted",
2323
- runId: newRun.id,
2324
- claimedAt: null,
2325
- finishedAt: null,
2326
- error: null,
2327
- updatedAt: now,
2328
- })
2329
- .where(eq(agentWakeupRequests.id, deferred.id));
2330
- await tx
2331
- .update(issues)
2332
- .set({
2333
- executionRunId: newRun.id,
2334
- executionAgentNameKey: normalizeAgentNameKey(deferredAgent.name),
2335
- executionLockedAt: now,
2336
- updatedAt: now,
2337
- })
2338
- .where(eq(issues.id, issue.id));
2339
- return newRun;
2340
- }
2341
- });
2342
- if (!promotedRun)
2343
- return;
2344
- publishLiveEvent({
2345
- companyId: promotedRun.companyId,
2346
- type: "heartbeat.run.queued",
2347
- payload: {
2348
- runId: promotedRun.id,
2349
- agentId: promotedRun.agentId,
2350
- invocationSource: promotedRun.invocationSource,
2351
- triggerDetail: promotedRun.triggerDetail,
2352
- wakeupRequestId: promotedRun.wakeupRequestId,
2353
- },
2354
- });
2355
- await startNextQueuedRunForAgent(promotedRun.agentId);
2356
- }
2357
- async function enqueueWakeup(agentId, opts = {}) {
2358
- const source = opts.source ?? "on_demand";
2359
- const triggerDetail = opts.triggerDetail ?? null;
2360
- const contextSnapshot = { ...(opts.contextSnapshot ?? {}) };
2361
- const reason = opts.reason ?? null;
2362
- const payload = opts.payload ?? null;
2363
- const { contextSnapshot: enrichedContextSnapshot, issueIdFromPayload, taskKey, wakeCommentId, } = enrichWakeContextSnapshot({
2364
- contextSnapshot,
2365
- reason,
2366
- source,
2367
- triggerDetail,
2368
- payload,
2369
- });
2370
- const issueId = readNonEmptyString(enrichedContextSnapshot.issueId) ?? issueIdFromPayload;
2371
- const agent = await getAgent(agentId);
2372
- if (!agent)
2373
- throw notFound("Agent not found");
2374
- const writeSkippedRequest = async (skipReason) => {
2375
- await db.insert(agentWakeupRequests).values({
2376
- companyId: agent.companyId,
2377
- agentId,
2378
- source,
2379
- triggerDetail,
2380
- reason: skipReason,
2381
- payload,
2382
- status: "skipped",
2383
- requestedByActorType: opts.requestedByActorType ?? null,
2384
- requestedByActorId: opts.requestedByActorId ?? null,
2385
- idempotencyKey: opts.idempotencyKey ?? null,
2386
- finishedAt: new Date(),
2387
- });
2388
- };
2389
- let projectId = readNonEmptyString(enrichedContextSnapshot.projectId);
2390
- if (!projectId && issueId) {
2391
- projectId = await db
2392
- .select({ projectId: issues.projectId })
2393
- .from(issues)
2394
- .where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
2395
- .then((rows) => rows[0]?.projectId ?? null);
2396
- }
2397
- const budgetBlock = await budgets.getInvocationBlock(agent.companyId, agentId, {
2398
- issueId,
2399
- projectId,
2400
- });
2401
- if (budgetBlock) {
2402
- await writeSkippedRequest("budget.blocked");
2403
- throw conflict(budgetBlock.reason, {
2404
- scopeType: budgetBlock.scopeType,
2405
- scopeId: budgetBlock.scopeId,
2406
- });
2407
- }
2408
- if (agent.status === "paused" ||
2409
- agent.status === "terminated" ||
2410
- agent.status === "pending_approval") {
2411
- throw conflict("Agent is not invokable in its current state", { status: agent.status });
2412
- }
2413
- const policy = parseHeartbeatPolicy(agent);
2414
- if (source === "timer" && !policy.enabled) {
2415
- await writeSkippedRequest("heartbeat.disabled");
2416
- return null;
2417
- }
2418
- if (source === "assignment" && !policy.wakeOnAssignment) {
2419
- await writeSkippedRequest("heartbeat.wakeOnAssignment.disabled");
2420
- return null;
2421
- }
2422
- if (source === "automation" && !policy.wakeOnAutomation) {
2423
- await writeSkippedRequest("heartbeat.wakeOnAutomation.disabled");
2424
- return null;
2425
- }
2426
- if (source === "on_demand" && !policy.wakeOnDemand) {
2427
- await writeSkippedRequest("heartbeat.wakeOnDemand.disabled");
2428
- return null;
2429
- }
2430
- const bypassIssueExecutionLock = reason === "issue_comment_mentioned" ||
2431
- readNonEmptyString(enrichedContextSnapshot.wakeReason) === "issue_comment_mentioned";
2432
- if (issueId && !bypassIssueExecutionLock) {
2433
- const agentNameKey = normalizeAgentNameKey(agent.name);
2434
- const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
2435
- const outcome = await db.transaction(async (tx) => {
2436
- await tx.execute(sql `select id from issues where id = ${issueId} and company_id = ${agent.companyId} for update`);
2437
- const issue = await tx
2438
- .select({
2439
- id: issues.id,
2440
- companyId: issues.companyId,
2441
- executionRunId: issues.executionRunId,
2442
- executionAgentNameKey: issues.executionAgentNameKey,
2443
- })
2444
- .from(issues)
2445
- .where(and(eq(issues.id, issueId), eq(issues.companyId, agent.companyId)))
2446
- .then((rows) => rows[0] ?? null);
2447
- if (!issue) {
2448
- await tx.insert(agentWakeupRequests).values({
2449
- companyId: agent.companyId,
2450
- agentId,
2451
- source,
2452
- triggerDetail,
2453
- reason: "issue_execution_issue_not_found",
2454
- payload,
2455
- status: "skipped",
2456
- requestedByActorType: opts.requestedByActorType ?? null,
2457
- requestedByActorId: opts.requestedByActorId ?? null,
2458
- idempotencyKey: opts.idempotencyKey ?? null,
2459
- finishedAt: new Date(),
2460
- });
2461
- return { kind: "skipped" };
2462
- }
2463
- let activeExecutionRun = issue.executionRunId
2464
- ? await tx
2465
- .select()
2466
- .from(heartbeatRuns)
2467
- .where(eq(heartbeatRuns.id, issue.executionRunId))
2468
- .then((rows) => rows[0] ?? null)
2469
- : null;
2470
- if (activeExecutionRun && activeExecutionRun.status !== "queued" && activeExecutionRun.status !== "running") {
2471
- activeExecutionRun = null;
2472
- }
2473
- if (!activeExecutionRun && issue.executionRunId) {
2474
- await tx
2475
- .update(issues)
2476
- .set({
2477
- executionRunId: null,
2478
- executionAgentNameKey: null,
2479
- executionLockedAt: null,
2480
- updatedAt: new Date(),
2481
- })
2482
- .where(eq(issues.id, issue.id));
2483
- }
2484
- if (!activeExecutionRun) {
2485
- const legacyRun = await tx
2486
- .select()
2487
- .from(heartbeatRuns)
2488
- .where(and(eq(heartbeatRuns.companyId, issue.companyId), inArray(heartbeatRuns.status, ["queued", "running"]), sql `${heartbeatRuns.contextSnapshot} ->> 'issueId' = ${issue.id}`))
2489
- .orderBy(sql `case when ${heartbeatRuns.status} = 'running' then 0 else 1 end`, asc(heartbeatRuns.createdAt))
2490
- .limit(1)
2491
- .then((rows) => rows[0] ?? null);
2492
- if (legacyRun) {
2493
- activeExecutionRun = legacyRun;
2494
- const legacyAgent = await tx
2495
- .select({ name: agents.name })
2496
- .from(agents)
2497
- .where(eq(agents.id, legacyRun.agentId))
2498
- .then((rows) => rows[0] ?? null);
2499
- await tx
2500
- .update(issues)
2501
- .set({
2502
- executionRunId: legacyRun.id,
2503
- executionAgentNameKey: normalizeAgentNameKey(legacyAgent?.name),
2504
- executionLockedAt: new Date(),
2505
- updatedAt: new Date(),
2506
- })
2507
- .where(eq(issues.id, issue.id));
2508
- }
2509
- }
2510
- if (activeExecutionRun) {
2511
- const executionAgent = await tx
2512
- .select({ name: agents.name })
2513
- .from(agents)
2514
- .where(eq(agents.id, activeExecutionRun.agentId))
2515
- .then((rows) => rows[0] ?? null);
2516
- const executionAgentNameKey = normalizeAgentNameKey(issue.executionAgentNameKey) ??
2517
- normalizeAgentNameKey(executionAgent?.name);
2518
- const isSameExecutionAgent = Boolean(executionAgentNameKey) && executionAgentNameKey === agentNameKey;
2519
- const shouldQueueFollowupForCommentWake = Boolean(wakeCommentId) &&
2520
- activeExecutionRun.status === "running" &&
2521
- isSameExecutionAgent;
2522
- if (isSameExecutionAgent && !shouldQueueFollowupForCommentWake) {
2523
- const mergedContextSnapshot = mergeCoalescedContextSnapshot(activeExecutionRun.contextSnapshot, enrichedContextSnapshot);
2524
- const mergedRun = await tx
2525
- .update(heartbeatRuns)
2526
- .set({
2527
- contextSnapshot: mergedContextSnapshot,
2528
- updatedAt: new Date(),
2529
- })
2530
- .where(eq(heartbeatRuns.id, activeExecutionRun.id))
2531
- .returning()
2532
- .then((rows) => rows[0] ?? activeExecutionRun);
2533
- await tx.insert(agentWakeupRequests).values({
2534
- companyId: agent.companyId,
2535
- agentId,
2536
- source,
2537
- triggerDetail,
2538
- reason: "issue_execution_same_name",
2539
- payload,
2540
- status: "coalesced",
2541
- coalescedCount: 1,
2542
- requestedByActorType: opts.requestedByActorType ?? null,
2543
- requestedByActorId: opts.requestedByActorId ?? null,
2544
- idempotencyKey: opts.idempotencyKey ?? null,
2545
- runId: mergedRun.id,
2546
- finishedAt: new Date(),
2547
- });
2548
- return { kind: "coalesced", run: mergedRun };
2549
- }
2550
- const deferredPayload = {
2551
- ...(payload ?? {}),
2552
- issueId,
2553
- [DEFERRED_WAKE_CONTEXT_KEY]: enrichedContextSnapshot,
2554
- };
2555
- const existingDeferred = await tx
2556
- .select()
2557
- .from(agentWakeupRequests)
2558
- .where(and(eq(agentWakeupRequests.companyId, agent.companyId), eq(agentWakeupRequests.agentId, agentId), eq(agentWakeupRequests.status, "deferred_issue_execution"), sql `${agentWakeupRequests.payload} ->> 'issueId' = ${issue.id}`))
2559
- .orderBy(asc(agentWakeupRequests.requestedAt))
2560
- .limit(1)
2561
- .then((rows) => rows[0] ?? null);
2562
- if (existingDeferred) {
2563
- const existingDeferredPayload = parseObject(existingDeferred.payload);
2564
- const existingDeferredContext = parseObject(existingDeferredPayload[DEFERRED_WAKE_CONTEXT_KEY]);
2565
- const mergedDeferredContext = mergeCoalescedContextSnapshot(existingDeferredContext, enrichedContextSnapshot);
2566
- const mergedDeferredPayload = {
2567
- ...existingDeferredPayload,
2568
- ...(payload ?? {}),
2569
- issueId,
2570
- [DEFERRED_WAKE_CONTEXT_KEY]: mergedDeferredContext,
2571
- };
2572
- await tx
2573
- .update(agentWakeupRequests)
2574
- .set({
2575
- payload: mergedDeferredPayload,
2576
- coalescedCount: (existingDeferred.coalescedCount ?? 0) + 1,
2577
- updatedAt: new Date(),
2578
- })
2579
- .where(eq(agentWakeupRequests.id, existingDeferred.id));
2580
- return { kind: "deferred" };
2581
- }
2582
- await tx.insert(agentWakeupRequests).values({
2583
- companyId: agent.companyId,
2584
- agentId,
2585
- source,
2586
- triggerDetail,
2587
- reason: "issue_execution_deferred",
2588
- payload: deferredPayload,
2589
- status: "deferred_issue_execution",
2590
- requestedByActorType: opts.requestedByActorType ?? null,
2591
- requestedByActorId: opts.requestedByActorId ?? null,
2592
- idempotencyKey: opts.idempotencyKey ?? null,
2593
- });
2594
- return { kind: "deferred" };
2595
- }
2596
- const wakeupRequest = await tx
2597
- .insert(agentWakeupRequests)
2598
- .values({
2599
- companyId: agent.companyId,
2600
- agentId,
2601
- source,
2602
- triggerDetail,
2603
- reason,
2604
- payload,
2605
- status: "queued",
2606
- requestedByActorType: opts.requestedByActorType ?? null,
2607
- requestedByActorId: opts.requestedByActorId ?? null,
2608
- idempotencyKey: opts.idempotencyKey ?? null,
2609
- })
2610
- .returning()
2611
- .then((rows) => rows[0]);
2612
- const newRun = await tx
2613
- .insert(heartbeatRuns)
2614
- .values({
2615
- companyId: agent.companyId,
2616
- agentId,
2617
- invocationSource: source,
2618
- triggerDetail,
2619
- status: "queued",
2620
- wakeupRequestId: wakeupRequest.id,
2621
- contextSnapshot: enrichedContextSnapshot,
2622
- sessionIdBefore: sessionBefore,
2623
- })
2624
- .returning()
2625
- .then((rows) => rows[0]);
2626
- await tx
2627
- .update(agentWakeupRequests)
2628
- .set({
2629
- runId: newRun.id,
2630
- updatedAt: new Date(),
2631
- })
2632
- .where(eq(agentWakeupRequests.id, wakeupRequest.id));
2633
- await tx
2634
- .update(issues)
2635
- .set({
2636
- executionRunId: newRun.id,
2637
- executionAgentNameKey: agentNameKey,
2638
- executionLockedAt: new Date(),
2639
- updatedAt: new Date(),
2640
- })
2641
- .where(eq(issues.id, issue.id));
2642
- return { kind: "queued", run: newRun };
2643
- });
2644
- if (outcome.kind === "deferred" || outcome.kind === "skipped")
2645
- return null;
2646
- if (outcome.kind === "coalesced")
2647
- return outcome.run;
2648
- const newRun = outcome.run;
2649
- publishLiveEvent({
2650
- companyId: newRun.companyId,
2651
- type: "heartbeat.run.queued",
2652
- payload: {
2653
- runId: newRun.id,
2654
- agentId: newRun.agentId,
2655
- invocationSource: newRun.invocationSource,
2656
- triggerDetail: newRun.triggerDetail,
2657
- wakeupRequestId: newRun.wakeupRequestId,
2658
- },
2659
- });
2660
- await startNextQueuedRunForAgent(agent.id);
2661
- return newRun;
2662
- }
2663
- const activeRuns = await db
2664
- .select()
2665
- .from(heartbeatRuns)
2666
- .where(and(eq(heartbeatRuns.agentId, agentId), inArray(heartbeatRuns.status, ["queued", "running"])))
2667
- .orderBy(desc(heartbeatRuns.createdAt));
2668
- const sameScopeQueuedRun = activeRuns.find((candidate) => candidate.status === "queued" && isSameTaskScope(runTaskKey(candidate), taskKey));
2669
- const sameScopeRunningRun = activeRuns.find((candidate) => candidate.status === "running" && isSameTaskScope(runTaskKey(candidate), taskKey));
2670
- const shouldQueueFollowupForCommentWake = Boolean(wakeCommentId) && Boolean(sameScopeRunningRun) && !sameScopeQueuedRun;
2671
- const coalescedTargetRun = sameScopeQueuedRun ??
2672
- (shouldQueueFollowupForCommentWake ? null : sameScopeRunningRun ?? null);
2673
- if (coalescedTargetRun) {
2674
- const mergedContextSnapshot = mergeCoalescedContextSnapshot(coalescedTargetRun.contextSnapshot, contextSnapshot);
2675
- const mergedRun = await db
2676
- .update(heartbeatRuns)
2677
- .set({
2678
- contextSnapshot: mergedContextSnapshot,
2679
- updatedAt: new Date(),
2680
- })
2681
- .where(eq(heartbeatRuns.id, coalescedTargetRun.id))
2682
- .returning()
2683
- .then((rows) => rows[0] ?? coalescedTargetRun);
2684
- await db.insert(agentWakeupRequests).values({
2685
- companyId: agent.companyId,
2686
- agentId,
2687
- source,
2688
- triggerDetail,
2689
- reason,
2690
- payload,
2691
- status: "coalesced",
2692
- coalescedCount: 1,
2693
- requestedByActorType: opts.requestedByActorType ?? null,
2694
- requestedByActorId: opts.requestedByActorId ?? null,
2695
- idempotencyKey: opts.idempotencyKey ?? null,
2696
- runId: mergedRun.id,
2697
- finishedAt: new Date(),
2698
- });
2699
- return mergedRun;
2700
- }
2701
- const wakeupRequest = await db
2702
- .insert(agentWakeupRequests)
2703
- .values({
2704
- companyId: agent.companyId,
2705
- agentId,
2706
- source,
2707
- triggerDetail,
2708
- reason,
2709
- payload,
2710
- status: "queued",
2711
- requestedByActorType: opts.requestedByActorType ?? null,
2712
- requestedByActorId: opts.requestedByActorId ?? null,
2713
- idempotencyKey: opts.idempotencyKey ?? null,
2714
- })
2715
- .returning()
2716
- .then((rows) => rows[0]);
2717
- const sessionBefore = await resolveSessionBeforeForWakeup(agent, taskKey);
2718
- const newRun = await db
2719
- .insert(heartbeatRuns)
2720
- .values({
2721
- companyId: agent.companyId,
2722
- agentId,
2723
- invocationSource: source,
2724
- triggerDetail,
2725
- status: "queued",
2726
- wakeupRequestId: wakeupRequest.id,
2727
- contextSnapshot: enrichedContextSnapshot,
2728
- sessionIdBefore: sessionBefore,
2729
- })
2730
- .returning()
2731
- .then((rows) => rows[0]);
2732
- await db
2733
- .update(agentWakeupRequests)
2734
- .set({
2735
- runId: newRun.id,
2736
- updatedAt: new Date(),
2737
- })
2738
- .where(eq(agentWakeupRequests.id, wakeupRequest.id));
2739
- publishLiveEvent({
2740
- companyId: newRun.companyId,
2741
- type: "heartbeat.run.queued",
2742
- payload: {
2743
- runId: newRun.id,
2744
- agentId: newRun.agentId,
2745
- invocationSource: newRun.invocationSource,
2746
- triggerDetail: newRun.triggerDetail,
2747
- wakeupRequestId: newRun.wakeupRequestId,
2748
- },
2749
- });
2750
- await startNextQueuedRunForAgent(agent.id);
2751
- return newRun;
2752
- }
2753
- async function listProjectScopedRunIds(companyId, projectId) {
2754
- const runIssueId = sql `${heartbeatRuns.contextSnapshot} ->> 'issueId'`;
2755
- const effectiveProjectId = sql `coalesce(${heartbeatRuns.contextSnapshot} ->> 'projectId', ${issues.projectId}::text)`;
2756
- const rows = await db
2757
- .selectDistinctOn([heartbeatRuns.id], { id: heartbeatRuns.id })
2758
- .from(heartbeatRuns)
2759
- .leftJoin(issues, and(eq(issues.companyId, companyId), sql `${issues.id}::text = ${runIssueId}`))
2760
- .where(and(eq(heartbeatRuns.companyId, companyId), inArray(heartbeatRuns.status, ["queued", "running"]), sql `${effectiveProjectId} = ${projectId}`));
2761
- return rows.map((row) => row.id);
2762
- }
2763
- async function listProjectScopedWakeupIds(companyId, projectId) {
2764
- const wakeIssueId = sql `${agentWakeupRequests.payload} ->> 'issueId'`;
2765
- const effectiveProjectId = sql `coalesce(${agentWakeupRequests.payload} ->> 'projectId', ${issues.projectId}::text)`;
2766
- const rows = await db
2767
- .selectDistinctOn([agentWakeupRequests.id], { id: agentWakeupRequests.id })
2768
- .from(agentWakeupRequests)
2769
- .leftJoin(issues, and(eq(issues.companyId, companyId), sql `${issues.id}::text = ${wakeIssueId}`))
2770
- .where(and(eq(agentWakeupRequests.companyId, companyId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`, sql `${effectiveProjectId} = ${projectId}`));
2771
- return rows.map((row) => row.id);
2772
- }
2773
- async function cancelPendingWakeupsForBudgetScope(scope) {
2774
- const now = new Date();
2775
- let wakeupIds = [];
2776
- if (scope.scopeType === "company") {
2777
- wakeupIds = await db
2778
- .select({ id: agentWakeupRequests.id })
2779
- .from(agentWakeupRequests)
2780
- .where(and(eq(agentWakeupRequests.companyId, scope.companyId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`))
2781
- .then((rows) => rows.map((row) => row.id));
2782
- }
2783
- else if (scope.scopeType === "agent") {
2784
- wakeupIds = await db
2785
- .select({ id: agentWakeupRequests.id })
2786
- .from(agentWakeupRequests)
2787
- .where(and(eq(agentWakeupRequests.companyId, scope.companyId), eq(agentWakeupRequests.agentId, scope.scopeId), inArray(agentWakeupRequests.status, ["queued", "deferred_issue_execution"]), sql `${agentWakeupRequests.runId} is null`))
2788
- .then((rows) => rows.map((row) => row.id));
2789
- }
2790
- else {
2791
- wakeupIds = await listProjectScopedWakeupIds(scope.companyId, scope.scopeId);
2792
- }
2793
- if (wakeupIds.length === 0)
2794
- return 0;
2795
- await db
2796
- .update(agentWakeupRequests)
2797
- .set({
2798
- status: "cancelled",
2799
- finishedAt: now,
2800
- error: "Cancelled due to budget pause",
2801
- updatedAt: now,
2802
- })
2803
- .where(inArray(agentWakeupRequests.id, wakeupIds));
2804
- return wakeupIds.length;
2805
- }
2806
- async function cancelRunInternal(runId, reason = "Cancelled by control plane") {
2807
- const run = await getRun(runId);
2808
- if (!run)
2809
- throw notFound("Heartbeat run not found");
2810
- if (run.status !== "running" && run.status !== "queued")
2811
- return run;
2812
- const running = runningProcesses.get(run.id);
2813
- if (running) {
2814
- running.child.kill("SIGTERM");
2815
- const graceMs = Math.max(1, running.graceSec) * 1000;
2816
- setTimeout(() => {
2817
- if (!running.child.killed) {
2818
- running.child.kill("SIGKILL");
2819
- }
2820
- }, graceMs);
2821
- }
2822
- const cancelled = await setRunStatus(run.id, "cancelled", {
2823
- finishedAt: new Date(),
2824
- error: reason,
2825
- errorCode: "cancelled",
2826
- });
2827
- await setWakeupStatus(run.wakeupRequestId, "cancelled", {
2828
- finishedAt: new Date(),
2829
- error: reason,
2830
- });
2831
- if (cancelled) {
2832
- await appendRunEvent(cancelled, 1, {
2833
- eventType: "lifecycle",
2834
- stream: "system",
2835
- level: "warn",
2836
- message: "run cancelled",
2837
- });
2838
- await releaseIssueExecutionAndPromote(cancelled);
2839
- }
2840
- runningProcesses.delete(run.id);
2841
- await finalizeAgentStatus(run.agentId, "cancelled");
2842
- await startNextQueuedRunForAgent(run.agentId);
2843
- return cancelled;
2844
- }
2845
- async function cancelActiveForAgentInternal(agentId, reason = "Cancelled due to agent pause") {
2846
- const runs = await db
2847
- .select()
2848
- .from(heartbeatRuns)
2849
- .where(and(eq(heartbeatRuns.agentId, agentId), inArray(heartbeatRuns.status, ["queued", "running"])));
2850
- for (const run of runs) {
2851
- await setRunStatus(run.id, "cancelled", {
2852
- finishedAt: new Date(),
2853
- error: reason,
2854
- errorCode: "cancelled",
2855
- });
2856
- await setWakeupStatus(run.wakeupRequestId, "cancelled", {
2857
- finishedAt: new Date(),
2858
- error: reason,
2859
- });
2860
- const running = runningProcesses.get(run.id);
2861
- if (running) {
2862
- running.child.kill("SIGTERM");
2863
- runningProcesses.delete(run.id);
2864
- }
2865
- await releaseIssueExecutionAndPromote(run);
2866
- }
2867
- return runs.length;
2868
- }
2869
- async function cancelBudgetScopeWork(scope) {
2870
- if (scope.scopeType === "agent") {
2871
- await cancelActiveForAgentInternal(scope.scopeId, "Cancelled due to budget pause");
2872
- await cancelPendingWakeupsForBudgetScope(scope);
2873
- return;
2874
- }
2875
- const runIds = scope.scopeType === "company"
2876
- ? await db
2877
- .select({ id: heartbeatRuns.id })
2878
- .from(heartbeatRuns)
2879
- .where(and(eq(heartbeatRuns.companyId, scope.companyId), inArray(heartbeatRuns.status, ["queued", "running"])))
2880
- .then((rows) => rows.map((row) => row.id))
2881
- : await listProjectScopedRunIds(scope.companyId, scope.scopeId);
2882
- for (const runId of runIds) {
2883
- await cancelRunInternal(runId, "Cancelled due to budget pause");
2884
- }
2885
- await cancelPendingWakeupsForBudgetScope(scope);
2886
- }
2887
- return {
2888
- list: async (companyId, agentId, limit) => {
2889
- const query = db
2890
- .select(heartbeatRunListColumns)
2891
- .from(heartbeatRuns)
2892
- .where(agentId
2893
- ? and(eq(heartbeatRuns.companyId, companyId), eq(heartbeatRuns.agentId, agentId))
2894
- : eq(heartbeatRuns.companyId, companyId))
2895
- .orderBy(desc(heartbeatRuns.createdAt));
2896
- const rows = limit ? await query.limit(limit) : await query;
2897
- return rows.map((row) => ({
2898
- ...row,
2899
- resultJson: summarizeHeartbeatRunResultJson(row.resultJson),
2900
- }));
2901
- },
2902
- getRun,
2903
- getRuntimeState: async (agentId) => {
2904
- const state = await getRuntimeState(agentId);
2905
- const agent = await getAgent(agentId);
2906
- if (!agent)
2907
- return null;
2908
- const ensured = state ?? (await ensureRuntimeState(agent));
2909
- const latestTaskSession = await db
2910
- .select()
2911
- .from(agentTaskSessions)
2912
- .where(and(eq(agentTaskSessions.companyId, agent.companyId), eq(agentTaskSessions.agentId, agent.id)))
2913
- .orderBy(desc(agentTaskSessions.updatedAt))
2914
- .limit(1)
2915
- .then((rows) => rows[0] ?? null);
2916
- return {
2917
- ...ensured,
2918
- sessionDisplayId: latestTaskSession?.sessionDisplayId ?? ensured.sessionId,
2919
- sessionParamsJson: latestTaskSession?.sessionParamsJson ?? null,
2920
- };
2921
- },
2922
- listTaskSessions: async (agentId) => {
2923
- const agent = await getAgent(agentId);
2924
- if (!agent)
2925
- throw notFound("Agent not found");
2926
- return db
2927
- .select()
2928
- .from(agentTaskSessions)
2929
- .where(and(eq(agentTaskSessions.companyId, agent.companyId), eq(agentTaskSessions.agentId, agentId)))
2930
- .orderBy(desc(agentTaskSessions.updatedAt), desc(agentTaskSessions.createdAt));
2931
- },
2932
- resetRuntimeSession: async (agentId, opts) => {
2933
- const agent = await getAgent(agentId);
2934
- if (!agent)
2935
- throw notFound("Agent not found");
2936
- await ensureRuntimeState(agent);
2937
- const taskKey = readNonEmptyString(opts?.taskKey);
2938
- const clearedTaskSessions = await clearTaskSessions(agent.companyId, agent.id, taskKey ? { taskKey, adapterType: agent.adapterType } : undefined);
2939
- const runtimePatch = {
2940
- sessionId: null,
2941
- lastError: null,
2942
- updatedAt: new Date(),
2943
- };
2944
- if (!taskKey) {
2945
- runtimePatch.stateJson = {};
2946
- }
2947
- const updated = await db
2948
- .update(agentRuntimeState)
2949
- .set(runtimePatch)
2950
- .where(eq(agentRuntimeState.agentId, agentId))
2951
- .returning()
2952
- .then((rows) => rows[0] ?? null);
2953
- if (!updated)
2954
- return null;
2955
- return {
2956
- ...updated,
2957
- sessionDisplayId: null,
2958
- sessionParamsJson: null,
2959
- clearedTaskSessions,
2960
- };
2961
- },
2962
- listEvents: (runId, afterSeq = 0, limit = 200) => db
2963
- .select()
2964
- .from(heartbeatRunEvents)
2965
- .where(and(eq(heartbeatRunEvents.runId, runId), gt(heartbeatRunEvents.seq, afterSeq)))
2966
- .orderBy(asc(heartbeatRunEvents.seq))
2967
- .limit(Math.max(1, Math.min(limit, 1000))),
2968
- readLog: async (runId, opts) => {
2969
- const run = await getRun(runId);
2970
- if (!run)
2971
- throw notFound("Heartbeat run not found");
2972
- if (!run.logStore || !run.logRef)
2973
- throw notFound("Run log not found");
2974
- const result = await runLogStore.read({
2975
- store: run.logStore,
2976
- logRef: run.logRef,
2977
- }, opts);
2978
- return {
2979
- runId,
2980
- store: run.logStore,
2981
- logRef: run.logRef,
2982
- ...result,
2983
- content: redactCurrentUserText(result.content),
2984
- };
2985
- },
2986
- invoke: async (agentId, source = "on_demand", contextSnapshot = {}, triggerDetail = "manual", actor) => enqueueWakeup(agentId, {
2987
- source,
2988
- triggerDetail,
2989
- contextSnapshot,
2990
- requestedByActorType: actor?.actorType,
2991
- requestedByActorId: actor?.actorId ?? null,
2992
- }),
2993
- wakeup: enqueueWakeup,
2994
- reportRunActivity: clearDetachedRunWarning,
2995
- reapOrphanedRuns,
2996
- resumeQueuedRuns,
2997
- tickTimers: async (now = new Date()) => {
2998
- const allAgents = await db.select().from(agents);
2999
- let checked = 0;
3000
- let enqueued = 0;
3001
- let skipped = 0;
3002
- for (const agent of allAgents) {
3003
- if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval")
3004
- continue;
3005
- const policy = parseHeartbeatPolicy(agent);
3006
- if (!policy.enabled || policy.intervalSec <= 0)
3007
- continue;
3008
- checked += 1;
3009
- const baseline = new Date(agent.lastHeartbeatAt ?? agent.createdAt).getTime();
3010
- const elapsedMs = now.getTime() - baseline;
3011
- if (elapsedMs < policy.intervalSec * 1000)
3012
- continue;
3013
- const run = await enqueueWakeup(agent.id, {
3014
- source: "timer",
3015
- triggerDetail: "system",
3016
- reason: "heartbeat_timer",
3017
- requestedByActorType: "system",
3018
- requestedByActorId: "heartbeat_scheduler",
3019
- contextSnapshot: {
3020
- source: "scheduler",
3021
- reason: "interval_elapsed",
3022
- now: now.toISOString(),
3023
- },
3024
- });
3025
- if (run)
3026
- enqueued += 1;
3027
- else
3028
- skipped += 1;
3029
- }
3030
- return { checked, enqueued, skipped };
3031
- },
3032
- cancelRun: (runId) => cancelRunInternal(runId),
3033
- cancelActiveForAgent: (agentId) => cancelActiveForAgentInternal(agentId),
3034
- cancelBudgetScopeWork,
3035
- getActiveRunForAgent: async (agentId) => {
3036
- const [run] = await db
3037
- .select()
3038
- .from(heartbeatRuns)
3039
- .where(and(eq(heartbeatRuns.agentId, agentId), eq(heartbeatRuns.status, "running")))
3040
- .orderBy(desc(heartbeatRuns.startedAt))
3041
- .limit(1);
3042
- return run ?? null;
3043
- },
3044
- };
3045
- }
3046
- //# sourceMappingURL=heartbeat.js.map