@hold-rein/cli 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/dist/cli.js +3 -0
  2. package/dist/cli.js.map +1 -0
  3. package/dist/index.js +139 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/runtime/api/app.d.ts +7 -0
  6. package/dist/runtime/api/app.d.ts.map +1 -0
  7. package/dist/runtime/api/app.js +41 -0
  8. package/dist/runtime/api/config/const.d.ts +8 -0
  9. package/dist/runtime/api/config/const.d.ts.map +1 -0
  10. package/dist/runtime/api/config/const.js +9 -0
  11. package/dist/runtime/api/config/env.d.ts +10 -0
  12. package/dist/runtime/api/config/env.d.ts.map +1 -0
  13. package/dist/runtime/api/config/env.js +32 -0
  14. package/dist/runtime/api/db/connection.d.ts +11 -0
  15. package/dist/runtime/api/db/connection.d.ts.map +1 -0
  16. package/dist/runtime/api/db/connection.js +21 -0
  17. package/dist/runtime/api/db/index.d.ts +4 -0
  18. package/dist/runtime/api/db/index.d.ts.map +1 -0
  19. package/dist/runtime/api/db/index.js +3 -0
  20. package/dist/runtime/api/db/migrate.d.ts +4 -0
  21. package/dist/runtime/api/db/migrate.d.ts.map +1 -0
  22. package/dist/runtime/api/db/migrate.js +308 -0
  23. package/dist/runtime/api/db/schema.d.ts +1610 -0
  24. package/dist/runtime/api/db/schema.d.ts.map +1 -0
  25. package/dist/runtime/api/db/schema.js +148 -0
  26. package/dist/runtime/api/middleware/error-middleware.d.ts +3 -0
  27. package/dist/runtime/api/middleware/error-middleware.d.ts.map +1 -0
  28. package/dist/runtime/api/middleware/error-middleware.js +5 -0
  29. package/dist/runtime/api/middleware/not-found-middleware.d.ts +3 -0
  30. package/dist/runtime/api/middleware/not-found-middleware.d.ts.map +1 -0
  31. package/dist/runtime/api/middleware/not-found-middleware.js +4 -0
  32. package/dist/runtime/api/modules/agents/active-task-run-registry.d.ts +10 -0
  33. package/dist/runtime/api/modules/agents/active-task-run-registry.d.ts.map +1 -0
  34. package/dist/runtime/api/modules/agents/active-task-run-registry.js +20 -0
  35. package/dist/runtime/api/modules/agents/agent-approval-store.d.ts +7 -0
  36. package/dist/runtime/api/modules/agents/agent-approval-store.d.ts.map +1 -0
  37. package/dist/runtime/api/modules/agents/agent-approval-store.js +23 -0
  38. package/dist/runtime/api/modules/agents/agent-event-bus.d.ts +8 -0
  39. package/dist/runtime/api/modules/agents/agent-event-bus.d.ts.map +1 -0
  40. package/dist/runtime/api/modules/agents/agent-event-bus.js +40 -0
  41. package/dist/runtime/api/modules/agents/agent-message-repository.d.ts +22 -0
  42. package/dist/runtime/api/modules/agents/agent-message-repository.d.ts.map +1 -0
  43. package/dist/runtime/api/modules/agents/agent-message-repository.js +60 -0
  44. package/dist/runtime/api/modules/agents/agent-message-storage.d.ts +4 -0
  45. package/dist/runtime/api/modules/agents/agent-message-storage.d.ts.map +1 -0
  46. package/dist/runtime/api/modules/agents/agent-message-storage.js +11 -0
  47. package/dist/runtime/api/modules/agents/agent-model-resolver.d.ts +4 -0
  48. package/dist/runtime/api/modules/agents/agent-model-resolver.d.ts.map +1 -0
  49. package/dist/runtime/api/modules/agents/agent-model-resolver.js +17 -0
  50. package/dist/runtime/api/modules/agents/agent-runtime-messages.d.ts +12 -0
  51. package/dist/runtime/api/modules/agents/agent-runtime-messages.d.ts.map +1 -0
  52. package/dist/runtime/api/modules/agents/agent-runtime-messages.js +19 -0
  53. package/dist/runtime/api/modules/agents/agent-runtime-support.d.ts +12 -0
  54. package/dist/runtime/api/modules/agents/agent-runtime-support.d.ts.map +1 -0
  55. package/dist/runtime/api/modules/agents/agent-runtime-support.js +38 -0
  56. package/dist/runtime/api/modules/agents/agent-runtime.d.ts +25 -0
  57. package/dist/runtime/api/modules/agents/agent-runtime.d.ts.map +1 -0
  58. package/dist/runtime/api/modules/agents/agent-runtime.js +371 -0
  59. package/dist/runtime/api/modules/agents/agent-subagents.d.ts +32 -0
  60. package/dist/runtime/api/modules/agents/agent-subagents.d.ts.map +1 -0
  61. package/dist/runtime/api/modules/agents/agent-subagents.js +65 -0
  62. package/dist/runtime/api/modules/agents/agent-task-actions.d.ts +9 -0
  63. package/dist/runtime/api/modules/agents/agent-task-actions.d.ts.map +1 -0
  64. package/dist/runtime/api/modules/agents/agent-task-actions.js +33 -0
  65. package/dist/runtime/api/modules/agents/agent-task-title-generator.d.ts +15 -0
  66. package/dist/runtime/api/modules/agents/agent-task-title-generator.d.ts.map +1 -0
  67. package/dist/runtime/api/modules/agents/agent-task-title-generator.js +61 -0
  68. package/dist/runtime/api/modules/agents/agent-tool-approval.d.ts +12 -0
  69. package/dist/runtime/api/modules/agents/agent-tool-approval.d.ts.map +1 -0
  70. package/dist/runtime/api/modules/agents/agent-tool-approval.js +40 -0
  71. package/dist/runtime/api/modules/agents/agent-types.d.ts +198 -0
  72. package/dist/runtime/api/modules/agents/agent-types.d.ts.map +1 -0
  73. package/dist/runtime/api/modules/agents/agent-types.js +1 -0
  74. package/dist/runtime/api/modules/agents/agents-router.d.ts +7 -0
  75. package/dist/runtime/api/modules/agents/agents-router.d.ts.map +1 -0
  76. package/dist/runtime/api/modules/agents/agents-router.js +210 -0
  77. package/dist/runtime/api/modules/agents/agents-service.d.ts +52 -0
  78. package/dist/runtime/api/modules/agents/agents-service.d.ts.map +1 -0
  79. package/dist/runtime/api/modules/agents/agents-service.js +282 -0
  80. package/dist/runtime/api/modules/agents/approval/store.d.ts +7 -0
  81. package/dist/runtime/api/modules/agents/approval/store.d.ts.map +1 -0
  82. package/dist/runtime/api/modules/agents/approval/store.js +23 -0
  83. package/dist/runtime/api/modules/agents/approval/tool-approval.d.ts +14 -0
  84. package/dist/runtime/api/modules/agents/approval/tool-approval.d.ts.map +1 -0
  85. package/dist/runtime/api/modules/agents/approval/tool-approval.js +43 -0
  86. package/dist/runtime/api/modules/agents/custom-agent-model.d.ts +16 -0
  87. package/dist/runtime/api/modules/agents/custom-agent-model.d.ts.map +1 -0
  88. package/dist/runtime/api/modules/agents/custom-agent-model.js +21 -0
  89. package/dist/runtime/api/modules/agents/default-agents-service.d.ts +3 -0
  90. package/dist/runtime/api/modules/agents/default-agents-service.d.ts.map +1 -0
  91. package/dist/runtime/api/modules/agents/default-agents-service.js +52 -0
  92. package/dist/runtime/api/modules/agents/event/event-bus.d.ts +8 -0
  93. package/dist/runtime/api/modules/agents/event/event-bus.d.ts.map +1 -0
  94. package/dist/runtime/api/modules/agents/event/event-bus.js +40 -0
  95. package/dist/runtime/api/modules/agents/index.d.ts +11 -0
  96. package/dist/runtime/api/modules/agents/index.d.ts.map +1 -0
  97. package/dist/runtime/api/modules/agents/index.js +9 -0
  98. package/dist/runtime/api/modules/agents/message/storage.d.ts +4 -0
  99. package/dist/runtime/api/modules/agents/message/storage.d.ts.map +1 -0
  100. package/dist/runtime/api/modules/agents/message/storage.js +11 -0
  101. package/dist/runtime/api/modules/agents/model/custom-model.d.ts +16 -0
  102. package/dist/runtime/api/modules/agents/model/custom-model.d.ts.map +1 -0
  103. package/dist/runtime/api/modules/agents/model/custom-model.js +21 -0
  104. package/dist/runtime/api/modules/agents/model/resolver.d.ts +4 -0
  105. package/dist/runtime/api/modules/agents/model/resolver.d.ts.map +1 -0
  106. package/dist/runtime/api/modules/agents/model/resolver.js +17 -0
  107. package/dist/runtime/api/modules/agents/router/browser-tool-result.d.ts +8 -0
  108. package/dist/runtime/api/modules/agents/router/browser-tool-result.d.ts.map +1 -0
  109. package/dist/runtime/api/modules/agents/router/browser-tool-result.js +35 -0
  110. package/dist/runtime/api/modules/agents/router/index.d.ts +10 -0
  111. package/dist/runtime/api/modules/agents/router/index.d.ts.map +1 -0
  112. package/dist/runtime/api/modules/agents/router/index.js +210 -0
  113. package/dist/runtime/api/modules/agents/router/request-parsing.d.ts +24 -0
  114. package/dist/runtime/api/modules/agents/router/request-parsing.d.ts.map +1 -0
  115. package/dist/runtime/api/modules/agents/router/request-parsing.js +78 -0
  116. package/dist/runtime/api/modules/agents/runtime/browser-runtime-contributions.d.ts +5 -0
  117. package/dist/runtime/api/modules/agents/runtime/browser-runtime-contributions.d.ts.map +1 -0
  118. package/dist/runtime/api/modules/agents/runtime/browser-runtime-contributions.js +115 -0
  119. package/dist/runtime/api/modules/agents/runtime/browser-runtime-tools.d.ts +13 -0
  120. package/dist/runtime/api/modules/agents/runtime/browser-runtime-tools.d.ts.map +1 -0
  121. package/dist/runtime/api/modules/agents/runtime/browser-runtime-tools.js +31 -0
  122. package/dist/runtime/api/modules/agents/runtime/browser-tool-call-store.d.ts +21 -0
  123. package/dist/runtime/api/modules/agents/runtime/browser-tool-call-store.d.ts.map +1 -0
  124. package/dist/runtime/api/modules/agents/runtime/browser-tool-call-store.js +69 -0
  125. package/dist/runtime/api/modules/agents/runtime/continuation-subagent.d.ts +26 -0
  126. package/dist/runtime/api/modules/agents/runtime/continuation-subagent.d.ts.map +1 -0
  127. package/dist/runtime/api/modules/agents/runtime/continuation-subagent.js +67 -0
  128. package/dist/runtime/api/modules/agents/runtime/index.d.ts +3 -0
  129. package/dist/runtime/api/modules/agents/runtime/index.d.ts.map +1 -0
  130. package/dist/runtime/api/modules/agents/runtime/index.js +432 -0
  131. package/dist/runtime/api/modules/agents/runtime/messages.d.ts +12 -0
  132. package/dist/runtime/api/modules/agents/runtime/messages.d.ts.map +1 -0
  133. package/dist/runtime/api/modules/agents/runtime/messages.js +19 -0
  134. package/dist/runtime/api/modules/agents/runtime/subagent-results.d.ts +22 -0
  135. package/dist/runtime/api/modules/agents/runtime/subagent-results.d.ts.map +1 -0
  136. package/dist/runtime/api/modules/agents/runtime/subagent-results.js +39 -0
  137. package/dist/runtime/api/modules/agents/runtime/subagent-tools.d.ts +49 -0
  138. package/dist/runtime/api/modules/agents/runtime/subagent-tools.d.ts.map +1 -0
  139. package/dist/runtime/api/modules/agents/runtime/subagent-tools.js +195 -0
  140. package/dist/runtime/api/modules/agents/runtime/support.d.ts +19 -0
  141. package/dist/runtime/api/modules/agents/runtime/support.d.ts.map +1 -0
  142. package/dist/runtime/api/modules/agents/runtime/support.js +106 -0
  143. package/dist/runtime/api/modules/agents/runtime/token-collection.d.ts +28 -0
  144. package/dist/runtime/api/modules/agents/runtime/token-collection.d.ts.map +1 -0
  145. package/dist/runtime/api/modules/agents/runtime/token-collection.js +131 -0
  146. package/dist/runtime/api/modules/agents/runtime/token-usage-sync.d.ts +15 -0
  147. package/dist/runtime/api/modules/agents/runtime/token-usage-sync.d.ts.map +1 -0
  148. package/dist/runtime/api/modules/agents/runtime/token-usage-sync.js +46 -0
  149. package/dist/runtime/api/modules/agents/runtime/type.d.ts +62 -0
  150. package/dist/runtime/api/modules/agents/runtime/type.d.ts.map +1 -0
  151. package/dist/runtime/api/modules/agents/runtime/type.js +1 -0
  152. package/dist/runtime/api/modules/agents/runtime/workspace-agent-instructions.d.ts +3 -0
  153. package/dist/runtime/api/modules/agents/runtime/workspace-agent-instructions.d.ts.map +1 -0
  154. package/dist/runtime/api/modules/agents/runtime/workspace-agent-instructions.js +31 -0
  155. package/dist/runtime/api/modules/agents/service/default.d.ts +3 -0
  156. package/dist/runtime/api/modules/agents/service/default.d.ts.map +1 -0
  157. package/dist/runtime/api/modules/agents/service/default.js +65 -0
  158. package/dist/runtime/api/modules/agents/service/index.d.ts +56 -0
  159. package/dist/runtime/api/modules/agents/service/index.d.ts.map +1 -0
  160. package/dist/runtime/api/modules/agents/service/index.js +296 -0
  161. package/dist/runtime/api/modules/agents/service/interrupt-task.d.ts +14 -0
  162. package/dist/runtime/api/modules/agents/service/interrupt-task.d.ts.map +1 -0
  163. package/dist/runtime/api/modules/agents/service/interrupt-task.js +34 -0
  164. package/dist/runtime/api/modules/agents/service/startup-recovery.d.ts +14 -0
  165. package/dist/runtime/api/modules/agents/service/startup-recovery.d.ts.map +1 -0
  166. package/dist/runtime/api/modules/agents/service/startup-recovery.js +15 -0
  167. package/dist/runtime/api/modules/agents/shell-command-risk.d.ts +3 -0
  168. package/dist/runtime/api/modules/agents/shell-command-risk.d.ts.map +1 -0
  169. package/dist/runtime/api/modules/agents/shell-command-risk.js +24 -0
  170. package/dist/runtime/api/modules/agents/shell-exec-tool.d.ts +4 -0
  171. package/dist/runtime/api/modules/agents/shell-exec-tool.d.ts.map +1 -0
  172. package/dist/runtime/api/modules/agents/shell-exec-tool.js +71 -0
  173. package/dist/runtime/api/modules/agents/subagent/index.d.ts +45 -0
  174. package/dist/runtime/api/modules/agents/subagent/index.d.ts.map +1 -0
  175. package/dist/runtime/api/modules/agents/subagent/index.js +143 -0
  176. package/dist/runtime/api/modules/agents/subagent/lifecycle.d.ts +13 -0
  177. package/dist/runtime/api/modules/agents/subagent/lifecycle.d.ts.map +1 -0
  178. package/dist/runtime/api/modules/agents/subagent/lifecycle.js +36 -0
  179. package/dist/runtime/api/modules/agents/subagent/repository.d.ts +12 -0
  180. package/dist/runtime/api/modules/agents/subagent/repository.d.ts.map +1 -0
  181. package/dist/runtime/api/modules/agents/subagent/repository.js +93 -0
  182. package/dist/runtime/api/modules/agents/subagent-repository.d.ts +11 -0
  183. package/dist/runtime/api/modules/agents/subagent-repository.d.ts.map +1 -0
  184. package/dist/runtime/api/modules/agents/subagent-repository.js +65 -0
  185. package/dist/runtime/api/modules/agents/task/actions.d.ts +10 -0
  186. package/dist/runtime/api/modules/agents/task/actions.d.ts.map +1 -0
  187. package/dist/runtime/api/modules/agents/task/actions.js +37 -0
  188. package/dist/runtime/api/modules/agents/task/active-run-registry.d.ts +10 -0
  189. package/dist/runtime/api/modules/agents/task/active-run-registry.d.ts.map +1 -0
  190. package/dist/runtime/api/modules/agents/task/active-run-registry.js +20 -0
  191. package/dist/runtime/api/modules/agents/task/run-monitor.d.ts +14 -0
  192. package/dist/runtime/api/modules/agents/task/run-monitor.d.ts.map +1 -0
  193. package/dist/runtime/api/modules/agents/task/run-monitor.js +42 -0
  194. package/dist/runtime/api/modules/agents/task/title-generator.d.ts +15 -0
  195. package/dist/runtime/api/modules/agents/task/title-generator.d.ts.map +1 -0
  196. package/dist/runtime/api/modules/agents/task/title-generator.js +61 -0
  197. package/dist/runtime/api/modules/agents/task-run-monitor.d.ts +14 -0
  198. package/dist/runtime/api/modules/agents/task-run-monitor.d.ts.map +1 -0
  199. package/dist/runtime/api/modules/agents/task-run-monitor.js +42 -0
  200. package/dist/runtime/api/modules/file-system/file-system-router.d.ts +6 -0
  201. package/dist/runtime/api/modules/file-system/file-system-router.d.ts.map +1 -0
  202. package/dist/runtime/api/modules/file-system/file-system-router.js +119 -0
  203. package/dist/runtime/api/modules/file-system/file-system-service.d.ts +30 -0
  204. package/dist/runtime/api/modules/file-system/file-system-service.d.ts.map +1 -0
  205. package/dist/runtime/api/modules/file-system/file-system-service.js +209 -0
  206. package/dist/runtime/api/modules/file-system/index.d.ts +4 -0
  207. package/dist/runtime/api/modules/file-system/index.d.ts.map +1 -0
  208. package/dist/runtime/api/modules/file-system/index.js +1 -0
  209. package/dist/runtime/api/modules/health/health-router.d.ts +3 -0
  210. package/dist/runtime/api/modules/health/health-router.d.ts.map +1 -0
  211. package/dist/runtime/api/modules/health/health-router.js +10 -0
  212. package/dist/runtime/api/modules/health/index.d.ts +2 -0
  213. package/dist/runtime/api/modules/health/index.d.ts.map +1 -0
  214. package/dist/runtime/api/modules/health/index.js +1 -0
  215. package/dist/runtime/api/modules/model-providers/default-model-provider-service.d.ts +3 -0
  216. package/dist/runtime/api/modules/model-providers/default-model-provider-service.d.ts.map +1 -0
  217. package/dist/runtime/api/modules/model-providers/default-model-provider-service.js +21 -0
  218. package/dist/runtime/api/modules/model-providers/index.d.ts +5 -0
  219. package/dist/runtime/api/modules/model-providers/index.d.ts.map +1 -0
  220. package/dist/runtime/api/modules/model-providers/index.js +4 -0
  221. package/dist/runtime/api/modules/model-providers/model-provider-api-key-crypto.d.ts +8 -0
  222. package/dist/runtime/api/modules/model-providers/model-provider-api-key-crypto.d.ts.map +1 -0
  223. package/dist/runtime/api/modules/model-providers/model-provider-api-key-crypto.js +35 -0
  224. package/dist/runtime/api/modules/model-providers/model-provider-repository.d.ts +51 -0
  225. package/dist/runtime/api/modules/model-providers/model-provider-repository.d.ts.map +1 -0
  226. package/dist/runtime/api/modules/model-providers/model-provider-repository.js +314 -0
  227. package/dist/runtime/api/modules/model-providers/model-providers-router.d.ts +9 -0
  228. package/dist/runtime/api/modules/model-providers/model-providers-router.d.ts.map +1 -0
  229. package/dist/runtime/api/modules/model-providers/model-providers-router.js +188 -0
  230. package/dist/runtime/api/modules/model-providers/model-providers-service.d.ts +52 -0
  231. package/dist/runtime/api/modules/model-providers/model-providers-service.d.ts.map +1 -0
  232. package/dist/runtime/api/modules/model-providers/model-providers-service.js +239 -0
  233. package/dist/runtime/api/modules/model-proxies/default-model-proxies-service.d.ts +3 -0
  234. package/dist/runtime/api/modules/model-proxies/default-model-proxies-service.d.ts.map +1 -0
  235. package/dist/runtime/api/modules/model-proxies/default-model-proxies-service.js +22 -0
  236. package/dist/runtime/api/modules/model-proxies/index.d.ts +5 -0
  237. package/dist/runtime/api/modules/model-proxies/index.d.ts.map +1 -0
  238. package/dist/runtime/api/modules/model-proxies/index.js +4 -0
  239. package/dist/runtime/api/modules/model-proxies/model-proxies-router.d.ts +7 -0
  240. package/dist/runtime/api/modules/model-proxies/model-proxies-router.d.ts.map +1 -0
  241. package/dist/runtime/api/modules/model-proxies/model-proxies-router.js +55 -0
  242. package/dist/runtime/api/modules/model-proxies/model-proxies-service.d.ts +26 -0
  243. package/dist/runtime/api/modules/model-proxies/model-proxies-service.d.ts.map +1 -0
  244. package/dist/runtime/api/modules/model-proxies/model-proxies-service.js +107 -0
  245. package/dist/runtime/api/modules/model-proxies/model-proxy-repository.d.ts +39 -0
  246. package/dist/runtime/api/modules/model-proxies/model-proxy-repository.d.ts.map +1 -0
  247. package/dist/runtime/api/modules/model-proxies/model-proxy-repository.js +146 -0
  248. package/dist/runtime/api/modules/model-proxies/model-proxy-runtime.d.ts +20 -0
  249. package/dist/runtime/api/modules/model-proxies/model-proxy-runtime.d.ts.map +1 -0
  250. package/dist/runtime/api/modules/model-proxies/model-proxy-runtime.js +45 -0
  251. package/dist/runtime/api/modules/plugins/plugins-router.d.ts +7 -0
  252. package/dist/runtime/api/modules/plugins/plugins-router.d.ts.map +1 -0
  253. package/dist/runtime/api/modules/plugins/plugins-router.js +11 -0
  254. package/dist/runtime/api/modules/skills/default-skills-service.d.ts +3 -0
  255. package/dist/runtime/api/modules/skills/default-skills-service.d.ts.map +1 -0
  256. package/dist/runtime/api/modules/skills/default-skills-service.js +9 -0
  257. package/dist/runtime/api/modules/skills/index.d.ts +5 -0
  258. package/dist/runtime/api/modules/skills/index.d.ts.map +1 -0
  259. package/dist/runtime/api/modules/skills/index.js +3 -0
  260. package/dist/runtime/api/modules/skills/skills-router.d.ts +7 -0
  261. package/dist/runtime/api/modules/skills/skills-router.d.ts.map +1 -0
  262. package/dist/runtime/api/modules/skills/skills-router.js +56 -0
  263. package/dist/runtime/api/modules/skills/skills-service.d.ts +7 -0
  264. package/dist/runtime/api/modules/skills/skills-service.d.ts.map +1 -0
  265. package/dist/runtime/api/modules/skills/skills-service.js +264 -0
  266. package/dist/runtime/api/modules/skills/skills-types.d.ts +22 -0
  267. package/dist/runtime/api/modules/skills/skills-types.d.ts.map +1 -0
  268. package/dist/runtime/api/modules/skills/skills-types.js +1 -0
  269. package/dist/runtime/api/modules/usage-stats/default-usage-stats-service.d.ts +3 -0
  270. package/dist/runtime/api/modules/usage-stats/default-usage-stats-service.d.ts.map +1 -0
  271. package/dist/runtime/api/modules/usage-stats/default-usage-stats-service.js +17 -0
  272. package/dist/runtime/api/modules/usage-stats/index.d.ts +4 -0
  273. package/dist/runtime/api/modules/usage-stats/index.d.ts.map +1 -0
  274. package/dist/runtime/api/modules/usage-stats/index.js +2 -0
  275. package/dist/runtime/api/modules/usage-stats/usage-stats-router.d.ts +7 -0
  276. package/dist/runtime/api/modules/usage-stats/usage-stats-router.d.ts.map +1 -0
  277. package/dist/runtime/api/modules/usage-stats/usage-stats-router.js +42 -0
  278. package/dist/runtime/api/modules/usage-stats/usage-stats-service.d.ts +40 -0
  279. package/dist/runtime/api/modules/usage-stats/usage-stats-service.d.ts.map +1 -0
  280. package/dist/runtime/api/modules/usage-stats/usage-stats-service.js +144 -0
  281. package/dist/runtime/api/modules/usage-stats/usage-stats-types.d.ts +39 -0
  282. package/dist/runtime/api/modules/usage-stats/usage-stats-types.d.ts.map +1 -0
  283. package/dist/runtime/api/modules/usage-stats/usage-stats-types.js +1 -0
  284. package/dist/runtime/api/modules/workspaces/default-workspaces-service.d.ts +3 -0
  285. package/dist/runtime/api/modules/workspaces/default-workspaces-service.d.ts.map +1 -0
  286. package/dist/runtime/api/modules/workspaces/default-workspaces-service.js +20 -0
  287. package/dist/runtime/api/modules/workspaces/index.d.ts +6 -0
  288. package/dist/runtime/api/modules/workspaces/index.d.ts.map +1 -0
  289. package/dist/runtime/api/modules/workspaces/index.js +5 -0
  290. package/dist/runtime/api/modules/workspaces/workspace-repository.d.ts +41 -0
  291. package/dist/runtime/api/modules/workspaces/workspace-repository.d.ts.map +1 -0
  292. package/dist/runtime/api/modules/workspaces/workspace-repository.js +326 -0
  293. package/dist/runtime/api/modules/workspaces/workspace-types.d.ts +33 -0
  294. package/dist/runtime/api/modules/workspaces/workspace-types.d.ts.map +1 -0
  295. package/dist/runtime/api/modules/workspaces/workspace-types.js +1 -0
  296. package/dist/runtime/api/modules/workspaces/workspaces-router.d.ts +7 -0
  297. package/dist/runtime/api/modules/workspaces/workspaces-router.d.ts.map +1 -0
  298. package/dist/runtime/api/modules/workspaces/workspaces-router.js +71 -0
  299. package/dist/runtime/api/modules/workspaces/workspaces-service.d.ts +24 -0
  300. package/dist/runtime/api/modules/workspaces/workspaces-service.d.ts.map +1 -0
  301. package/dist/runtime/api/modules/workspaces/workspaces-service.js +109 -0
  302. package/dist/runtime/api/plugin.d.ts +5 -0
  303. package/dist/runtime/api/plugin.d.ts.map +1 -0
  304. package/dist/runtime/api/plugin.js +48 -0
  305. package/dist/runtime/api/response/api-response.d.ts +11 -0
  306. package/dist/runtime/api/response/api-response.d.ts.map +1 -0
  307. package/dist/runtime/api/response/api-response.js +18 -0
  308. package/dist/runtime/api/response/index.d.ts +3 -0
  309. package/dist/runtime/api/response/index.d.ts.map +1 -0
  310. package/dist/runtime/api/response/index.js +2 -0
  311. package/dist/runtime/api/response/response-codes.d.ts +52 -0
  312. package/dist/runtime/api/response/response-codes.d.ts.map +1 -0
  313. package/dist/runtime/api/response/response-codes.js +44 -0
  314. package/dist/runtime/api/router/v1/index.d.ts +12 -0
  315. package/dist/runtime/api/router/v1/index.d.ts.map +1 -0
  316. package/dist/runtime/api/router/v1/index.js +26 -0
  317. package/dist/runtime/api/runtime.d.ts +15 -0
  318. package/dist/runtime/api/runtime.d.ts.map +1 -0
  319. package/dist/runtime/api/runtime.js +30 -0
  320. package/dist/runtime/api/server.d.ts +2 -0
  321. package/dist/runtime/api/server.d.ts.map +1 -0
  322. package/dist/runtime/api/server.js +14 -0
  323. package/dist/runtime/api/service/health-service.d.ts +7 -0
  324. package/dist/runtime/api/service/health-service.d.ts.map +1 -0
  325. package/dist/runtime/api/service/health-service.js +7 -0
  326. package/dist/runtime/web/assets/abap-DLDM7-KI.js +1 -0
  327. package/dist/runtime/web/assets/apex-DNDY2TF8.js +1 -0
  328. package/dist/runtime/web/assets/azcli-Y6nb8tq_.js +1 -0
  329. package/dist/runtime/web/assets/bat-BwHxbl9M.js +1 -0
  330. package/dist/runtime/web/assets/bicep-CFznDFnq.js +2 -0
  331. package/dist/runtime/web/assets/cameligo-Bf6VGUru.js +1 -0
  332. package/dist/runtime/web/assets/clojure-Dnu-v4kV.js +1 -0
  333. package/dist/runtime/web/assets/codicon-ngg6Pgfi.ttf +0 -0
  334. package/dist/runtime/web/assets/coffee-Bd8akH9Z.js +1 -0
  335. package/dist/runtime/web/assets/cpp-BbWJElDN.js +1 -0
  336. package/dist/runtime/web/assets/csharp-Co3qMtFm.js +1 -0
  337. package/dist/runtime/web/assets/csp-D-4FJmMZ.js +1 -0
  338. package/dist/runtime/web/assets/css-DdJfP1eB.js +3 -0
  339. package/dist/runtime/web/assets/css.worker-B4z49cGk.js +93 -0
  340. package/dist/runtime/web/assets/cssMode-w2xbbUEW.js +1 -0
  341. package/dist/runtime/web/assets/cypher-cTPe9QuQ.js +1 -0
  342. package/dist/runtime/web/assets/dart-BOtBlQCF.js +1 -0
  343. package/dist/runtime/web/assets/dockerfile-BG73LgW2.js +1 -0
  344. package/dist/runtime/web/assets/ecl-BEgZUVRK.js +1 -0
  345. package/dist/runtime/web/assets/elixir-BkW5O-1t.js +1 -0
  346. package/dist/runtime/web/assets/flow9-BeJ5waoc.js +1 -0
  347. package/dist/runtime/web/assets/freemarker2-mywz2bob.js +3 -0
  348. package/dist/runtime/web/assets/fsharp-PahG7c26.js +1 -0
  349. package/dist/runtime/web/assets/go-acbASCJo.js +1 -0
  350. package/dist/runtime/web/assets/graphql-BxJiqAUM.js +1 -0
  351. package/dist/runtime/web/assets/handlebars-Cy-2QN_R.js +1 -0
  352. package/dist/runtime/web/assets/hcl-DtV1sZF8.js +1 -0
  353. package/dist/runtime/web/assets/html-2WQMGvns.js +1 -0
  354. package/dist/runtime/web/assets/html.worker-DtiGdgqp.js +470 -0
  355. package/dist/runtime/web/assets/htmlMode-BznIdxOy.js +1 -0
  356. package/dist/runtime/web/assets/index-CQ_mZUpS.css +1 -0
  357. package/dist/runtime/web/assets/index-CtZcItCu.js +1512 -0
  358. package/dist/runtime/web/assets/ini-Kd9XrMLS.js +1 -0
  359. package/dist/runtime/web/assets/java-CXBNlu9o.js +1 -0
  360. package/dist/runtime/web/assets/javascript-BK6G_5BV.js +1 -0
  361. package/dist/runtime/web/assets/json.worker-leyajbqV.js +58 -0
  362. package/dist/runtime/web/assets/jsonMode-DI8_Cj0K.js +7 -0
  363. package/dist/runtime/web/assets/julia-cl7-CwDS.js +1 -0
  364. package/dist/runtime/web/assets/kotlin-s7OhZKlX.js +1 -0
  365. package/dist/runtime/web/assets/less-9HpZscsL.js +2 -0
  366. package/dist/runtime/web/assets/lexon-OrD6JF1K.js +1 -0
  367. package/dist/runtime/web/assets/liquid-CE7Qnc0w.js +1 -0
  368. package/dist/runtime/web/assets/lspLanguageFeatures-DKvGiYOU.js +4 -0
  369. package/dist/runtime/web/assets/lua-Cyyb5UIc.js +1 -0
  370. package/dist/runtime/web/assets/m3-B8OfTtLu.js +1 -0
  371. package/dist/runtime/web/assets/markdown-BFxVWTOG.js +1 -0
  372. package/dist/runtime/web/assets/mdx-Fk0ZjYeT.js +1 -0
  373. package/dist/runtime/web/assets/mips-CiqrrVzr.js +1 -0
  374. package/dist/runtime/web/assets/msdax-DmeGPVcC.js +1 -0
  375. package/dist/runtime/web/assets/mysql-C_tMU-Nz.js +1 -0
  376. package/dist/runtime/web/assets/objective-c-BDtDVThU.js +1 -0
  377. package/dist/runtime/web/assets/pascal-vHIfCaH5.js +1 -0
  378. package/dist/runtime/web/assets/pascaligo-DtZ0uQbO.js +1 -0
  379. package/dist/runtime/web/assets/perl-Ub6l9XKa.js +1 -0
  380. package/dist/runtime/web/assets/pgsql-BlNEE0v7.js +1 -0
  381. package/dist/runtime/web/assets/php-BBUBE1dy.js +1 -0
  382. package/dist/runtime/web/assets/pla-DSh2-awV.js +1 -0
  383. package/dist/runtime/web/assets/postiats-CocnycG-.js +1 -0
  384. package/dist/runtime/web/assets/powerquery-tScXyioY.js +1 -0
  385. package/dist/runtime/web/assets/powershell-COWaemsV.js +1 -0
  386. package/dist/runtime/web/assets/protobuf-Brw8urJB.js +2 -0
  387. package/dist/runtime/web/assets/pug-8SOpv6rk.js +1 -0
  388. package/dist/runtime/web/assets/python-xn7eKnQc.js +1 -0
  389. package/dist/runtime/web/assets/qsharp-Bw9ernYp.js +1 -0
  390. package/dist/runtime/web/assets/r-j7ic8hl3.js +1 -0
  391. package/dist/runtime/web/assets/razor-BjC5fot0.js +1 -0
  392. package/dist/runtime/web/assets/redis-Bu5POkcn.js +1 -0
  393. package/dist/runtime/web/assets/redshift-Bs9aos_-.js +1 -0
  394. package/dist/runtime/web/assets/restructuredtext-CqXO7rUv.js +1 -0
  395. package/dist/runtime/web/assets/ruby-zBfavPgS.js +1 -0
  396. package/dist/runtime/web/assets/rust-BzKRNQWT.js +1 -0
  397. package/dist/runtime/web/assets/sb-BBc9UKZt.js +1 -0
  398. package/dist/runtime/web/assets/scala-D9hQfWCl.js +1 -0
  399. package/dist/runtime/web/assets/scheme-BPhDTwHR.js +1 -0
  400. package/dist/runtime/web/assets/scss-CBJaRo0y.js +3 -0
  401. package/dist/runtime/web/assets/shell-DiJ1NA_G.js +1 -0
  402. package/dist/runtime/web/assets/solidity-Db0IVjzk.js +1 -0
  403. package/dist/runtime/web/assets/sophia-CnS9iZB_.js +1 -0
  404. package/dist/runtime/web/assets/sparql-CJmd_6j2.js +1 -0
  405. package/dist/runtime/web/assets/sql-ClhHkBeG.js +1 -0
  406. package/dist/runtime/web/assets/st-CHwy0fLd.js +1 -0
  407. package/dist/runtime/web/assets/swift-Bqt4WxQ4.js +3 -0
  408. package/dist/runtime/web/assets/systemverilog-Bs9z6M-B.js +1 -0
  409. package/dist/runtime/web/assets/tcl-Dm6ycUr_.js +1 -0
  410. package/dist/runtime/web/assets/ts.worker-59MjiAqk.js +67731 -0
  411. package/dist/runtime/web/assets/tsMode-8t6AIduV.js +11 -0
  412. package/dist/runtime/web/assets/twig-Csy3S7wG.js +1 -0
  413. package/dist/runtime/web/assets/typescript-DvPPogGC.js +1 -0
  414. package/dist/runtime/web/assets/typespec-Btyra-wh.js +1 -0
  415. package/dist/runtime/web/assets/vb-Db0cS2oM.js +1 -0
  416. package/dist/runtime/web/assets/wgsl-BTesnYfV.js +298 -0
  417. package/dist/runtime/web/assets/xml-CB8xdh8u.js +1 -0
  418. package/dist/runtime/web/assets/yaml-B4sXC4FA.js +1 -0
  419. package/dist/runtime/web/index.html +13 -0
  420. package/package.json +42 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,148 @@
1
+ import { index, integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
2
+ export const customModelProviders = sqliteTable("custom_model_providers", {
3
+ baseUrl: text("base_url").notNull(),
4
+ createdAt: text("created_at").notNull(),
5
+ id: text("id").primaryKey(),
6
+ provider: text("provider").notNull(),
7
+ updatedAt: text("updated_at").notNull()
8
+ }, (table) => ({
9
+ providerUniqueIndex: uniqueIndex("custom_model_providers_provider_idx").on(table.provider)
10
+ }));
11
+ export const providerApiKeys = sqliteTable("provider_api_keys", {
12
+ apiKeyCiphertext: text("api_key_ciphertext").notNull(),
13
+ apiKeyIv: text("api_key_iv").notNull(),
14
+ apiKeyTag: text("api_key_tag").notNull(),
15
+ createdAt: text("created_at").notNull(),
16
+ id: text("id").primaryKey(),
17
+ provider: text("provider").notNull(),
18
+ updatedAt: text("updated_at").notNull()
19
+ }, (table) => ({
20
+ providerUniqueIndex: uniqueIndex("provider_api_keys_provider_idx").on(table.provider)
21
+ }));
22
+ export const customProviderModels = sqliteTable("custom_provider_models", {
23
+ api: text("api").notNull(),
24
+ contextWindow: integer("context_window").notNull(),
25
+ createdAt: text("created_at").notNull(),
26
+ id: text("id").primaryKey(),
27
+ input: text("input").notNull(),
28
+ maxTokens: integer("max_tokens").notNull(),
29
+ modelId: text("model_id").notNull(),
30
+ name: text("name").notNull(),
31
+ providerId: text("provider_id")
32
+ .notNull()
33
+ .references(() => customModelProviders.id),
34
+ reasoning: integer("reasoning", { mode: "boolean" }).notNull(),
35
+ updatedAt: text("updated_at").notNull()
36
+ }, (table) => ({
37
+ providerModelUniqueIndex: uniqueIndex("custom_provider_models_provider_model_idx").on(table.providerId, table.modelId)
38
+ }));
39
+ export const modelProxies = sqliteTable("model_proxies", {
40
+ createdAt: text("created_at").notNull(),
41
+ id: text("id").primaryKey(),
42
+ modelId: text("model_id").notNull(),
43
+ name: text("name").notNull(),
44
+ updatedAt: text("updated_at").notNull()
45
+ }, (table) => ({
46
+ modelIdUniqueIndex: uniqueIndex("model_proxies_model_id_idx").on(table.modelId)
47
+ }));
48
+ export const modelProxyCandidates = sqliteTable("model_proxy_candidates", {
49
+ createdAt: text("created_at").notNull(),
50
+ id: text("id").primaryKey(),
51
+ modelId: text("model_id").notNull(),
52
+ priority: integer("priority").notNull(),
53
+ provider: text("provider").notNull(),
54
+ proxyId: text("proxy_id")
55
+ .notNull()
56
+ .references(() => modelProxies.id, { onDelete: "cascade" }),
57
+ updatedAt: text("updated_at").notNull()
58
+ }, (table) => ({
59
+ proxyPriorityIndex: index("model_proxy_candidates_proxy_priority_idx").on(table.proxyId, table.priority)
60
+ }));
61
+ export const modelProxyCandidateLimits = sqliteTable("model_proxy_candidate_limits", {
62
+ candidateId: text("candidate_id")
63
+ .notNull()
64
+ .references(() => modelProxyCandidates.id, { onDelete: "cascade" }),
65
+ createdAt: text("created_at").notNull(),
66
+ id: text("id").primaryKey(),
67
+ maxTokens: integer("max_tokens").notNull(),
68
+ updatedAt: text("updated_at").notNull(),
69
+ windowHours: integer("window_hours"),
70
+ windowType: text("window_type", { enum: ["hours", "day", "week"] }).notNull()
71
+ }, (table) => ({
72
+ candidateIndex: index("model_proxy_candidate_limits_candidate_idx").on(table.candidateId)
73
+ }));
74
+ export const workspaces = sqliteTable("workspaces", {
75
+ createdAt: text("created_at").notNull(),
76
+ id: text("id").primaryKey(),
77
+ name: text("name").notNull(),
78
+ path: text("path").notNull(),
79
+ updatedAt: text("updated_at").notNull()
80
+ }, (table) => ({
81
+ pathUniqueIndex: uniqueIndex("workspaces_path_idx").on(table.path)
82
+ }));
83
+ export const tasks = sqliteTable("tasks", {
84
+ createdAt: text("created_at").notNull(),
85
+ id: text("id").primaryKey(),
86
+ initialUserMessage: text("initial_user_message").notNull(),
87
+ inputToken: integer("input_token").notNull().default(0),
88
+ approvalPolicy: text("approval_policy", {
89
+ enum: ["approval", "run_all"]
90
+ })
91
+ .notNull()
92
+ .default("approval"),
93
+ lastContinuedAt: text("last_continued_at"),
94
+ lastModelId: text("last_model_id"),
95
+ lastModelName: text("last_model_name").notNull(),
96
+ lastModelProvider: text("last_model_provider").notNull(),
97
+ lastModelProviderSource: text("last_model_provider_source", {
98
+ enum: ["built_in", "custom"]
99
+ }).notNull(),
100
+ outputToken: integer("output_token").notNull().default(0),
101
+ sessionCreatedAt: text("session_created_at"),
102
+ sessionId: text("session_id"),
103
+ sessionPath: text("session_path"),
104
+ status: text("status", {
105
+ enum: ["running", "completed", "error"]
106
+ })
107
+ .notNull()
108
+ .default("completed"),
109
+ thinkingLevel: text("thinking_level", {
110
+ enum: ["off", "minimal", "low", "medium", "high", "xhigh"]
111
+ })
112
+ .notNull()
113
+ .default("medium"),
114
+ title: text("title").notNull(),
115
+ updatedAt: text("updated_at").notNull(),
116
+ workspaceId: text("workspace_id")
117
+ .notNull()
118
+ .references(() => workspaces.id)
119
+ }, (table) => ({
120
+ workspaceIdIndex: index("tasks_workspace_id_idx").on(table.workspaceId)
121
+ }));
122
+ export const subagents = sqliteTable("subagents", {
123
+ agentId: text("agent_id").primaryKey(),
124
+ agentName: text("agent_name").notNull().default("subagent"),
125
+ createdAt: text("created_at").notNull(),
126
+ parentAgentId: text("parent_agent_id").notNull(),
127
+ sessionCreatedAt: text("session_created_at"),
128
+ sessionId: text("session_id"),
129
+ sessionPath: text("session_path"),
130
+ status: text("status", {
131
+ enum: ["running", "completed", "interrupted"]
132
+ }).notNull(),
133
+ taskId: text("task_id")
134
+ .notNull()
135
+ .references(() => tasks.id, { onDelete: "cascade" }),
136
+ updatedAt: text("updated_at").notNull()
137
+ }, (table) => ({
138
+ taskIdIndex: index("subagents_task_id_idx").on(table.taskId)
139
+ }));
140
+ export const modelTokenUsageHourly = sqliteTable("model_token_usage_hourly", {
141
+ hour: text("hour").notNull(),
142
+ inputToken: integer("input_token").notNull().default(0),
143
+ modelName: text("model_name").notNull(),
144
+ outputToken: integer("output_token").notNull().default(0),
145
+ provider: text("provider").notNull()
146
+ }, (table) => ({
147
+ modelHourUniqueIndex: uniqueIndex("model_token_usage_hourly_model_hour_idx").on(table.provider, table.modelName, table.hour)
148
+ }));
@@ -0,0 +1,3 @@
1
+ import type { NextFunction, Request, Response } from "express";
2
+ export declare function errorMiddleware(error: Error, _request: Request, response: Response, _next: NextFunction): void;
3
+ //# sourceMappingURL=error-middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/error-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI/D,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,YAAY,GAClB,IAAI,CAQN"}
@@ -0,0 +1,5 @@
1
+ import { RESPONSE_CODE_DEFINITIONS, sendError } from "../response/index.js";
2
+ export function errorMiddleware(error, _request, response, _next) {
3
+ void _next;
4
+ sendError(response, RESPONSE_CODE_DEFINITIONS.internalError, error.message || RESPONSE_CODE_DEFINITIONS.internalError.defaultMessage);
5
+ }
@@ -0,0 +1,3 @@
1
+ import type { Request, Response } from "express";
2
+ export declare function notFoundMiddleware(_request: Request, response: Response): void;
3
+ //# sourceMappingURL=not-found-middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-found-middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/not-found-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIjD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAE9E"}
@@ -0,0 +1,4 @@
1
+ import { RESPONSE_CODE_DEFINITIONS, sendError } from "../response/index.js";
2
+ export function notFoundMiddleware(_request, response) {
3
+ sendError(response, RESPONSE_CODE_DEFINITIONS.notFound);
4
+ }
@@ -0,0 +1,10 @@
1
+ export interface ActiveTaskRunRegistry {
2
+ getAgentId: (taskId: string) => string | undefined;
3
+ hasTask: (taskId: string) => boolean;
4
+ markStarting: (taskId: string) => void;
5
+ register: (taskId: string, agentId: string) => void;
6
+ remove: (taskId: string) => void;
7
+ }
8
+ export declare function createActiveTaskRunRegistry(): ActiveTaskRunRegistry;
9
+ export declare function getDefaultActiveTaskRunRegistry(): ActiveTaskRunRegistry;
10
+ //# sourceMappingURL=active-task-run-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-task-run-registry.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/active-task-run-registry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACnD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,2BAA2B,IAAI,qBAAqB,CAgBnE;AAID,wBAAgB,+BAA+B,IAAI,qBAAqB,CAEvE"}
@@ -0,0 +1,20 @@
1
+ export function createActiveTaskRunRegistry() {
2
+ const agentIdsByTaskId = new Map();
3
+ return {
4
+ getAgentId: (taskId) => agentIdsByTaskId.get(taskId),
5
+ hasTask: (taskId) => agentIdsByTaskId.has(taskId),
6
+ markStarting: (taskId) => {
7
+ agentIdsByTaskId.set(taskId, undefined);
8
+ },
9
+ register: (taskId, agentId) => {
10
+ agentIdsByTaskId.set(taskId, agentId);
11
+ },
12
+ remove: (taskId) => {
13
+ agentIdsByTaskId.delete(taskId);
14
+ }
15
+ };
16
+ }
17
+ const defaultActiveTaskRunRegistry = createActiveTaskRunRegistry();
18
+ export function getDefaultActiveTaskRunRegistry() {
19
+ return defaultActiveTaskRunRegistry;
20
+ }
@@ -0,0 +1,7 @@
1
+ import type { ApprovalDecision, ApprovalDecisionInput, ToolApprovalRequest } from "./agent-types";
2
+ export interface AgentApprovalStore {
3
+ decide: (input: ApprovalDecisionInput) => boolean;
4
+ request: (request: ToolApprovalRequest) => Promise<ApprovalDecision>;
5
+ }
6
+ export declare function createAgentApprovalStore(): AgentApprovalStore;
7
+ //# sourceMappingURL=agent-approval-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-approval-store.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-approval-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,OAAO,CAAC;IAClD,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtE;AAOD,wBAAgB,wBAAwB,IAAI,kBAAkB,CA2B7D"}
@@ -0,0 +1,23 @@
1
+ export function createAgentApprovalStore() {
2
+ const pendingApprovals = new Map();
3
+ return {
4
+ decide: (input) => {
5
+ const pending = pendingApprovals.get(input.approvalId);
6
+ if (!pending || pending.agentId !== input.agentId) {
7
+ return false;
8
+ }
9
+ pendingApprovals.delete(input.approvalId);
10
+ pending.resolve({
11
+ approved: input.approved,
12
+ ...(input.reason === undefined ? {} : { reason: input.reason })
13
+ });
14
+ return true;
15
+ },
16
+ request: (request) => new Promise((resolve) => {
17
+ pendingApprovals.set(request.approvalId, {
18
+ agentId: request.agentId,
19
+ resolve
20
+ });
21
+ })
22
+ };
23
+ }
@@ -0,0 +1,8 @@
1
+ import type { AgentEventEnvelope, AgentEventSubscription, SubscribeAgentEventsInput } from "./agent-types";
2
+ export type AgentEventListener = (event: AgentEventEnvelope) => void;
3
+ export interface AgentEventBus {
4
+ emit: (event: Omit<AgentEventEnvelope, "sequence" | "timestamp">) => void;
5
+ subscribe: (input: SubscribeAgentEventsInput, listener: AgentEventListener) => AgentEventSubscription;
6
+ }
7
+ export declare function createAgentEventBus(): AgentEventBus;
8
+ //# sourceMappingURL=agent-event-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-event-bus.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-event-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1E,SAAS,EAAE,CACT,KAAK,EAAE,yBAAyB,EAChC,QAAQ,EAAE,kBAAkB,KACzB,sBAAsB,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CA6CnD"}
@@ -0,0 +1,40 @@
1
+ export function createAgentEventBus() {
2
+ const listeners = new Map();
3
+ const events = new Map();
4
+ const sequences = new Map();
5
+ return {
6
+ emit: (event) => {
7
+ const sequence = (sequences.get(event.agentId) ?? 0) + 1;
8
+ sequences.set(event.agentId, sequence);
9
+ const envelope = {
10
+ ...event,
11
+ sequence,
12
+ timestamp: new Date().toISOString()
13
+ };
14
+ const agentEvents = events.get(event.agentId) ?? [];
15
+ agentEvents.push(envelope);
16
+ events.set(event.agentId, agentEvents);
17
+ for (const listener of listeners.get(event.agentId) ?? []) {
18
+ listener(envelope);
19
+ }
20
+ },
21
+ subscribe: (input, listener) => {
22
+ for (const event of events.get(input.agentId) ?? []) {
23
+ if (event.sequence > (input.afterSequence ?? 0)) {
24
+ listener(event);
25
+ }
26
+ }
27
+ const agentListeners = listeners.get(input.agentId) ?? new Set();
28
+ agentListeners.add(listener);
29
+ listeners.set(input.agentId, agentListeners);
30
+ return {
31
+ unsubscribe: () => {
32
+ agentListeners.delete(listener);
33
+ if (agentListeners.size === 0) {
34
+ listeners.delete(input.agentId);
35
+ }
36
+ }
37
+ };
38
+ }
39
+ };
40
+ }
@@ -0,0 +1,22 @@
1
+ import type { AppDatabase } from "../../db";
2
+ import type { StoredAgentMessage } from "./agent-types";
3
+ export interface AppendTaskMessageInput {
4
+ agentId: string;
5
+ createdAt: string;
6
+ message: StoredAgentMessage;
7
+ taskId: string;
8
+ }
9
+ export interface StoredTaskMessage {
10
+ agentId: string;
11
+ createdAt: string;
12
+ message: StoredAgentMessage;
13
+ sequence: number;
14
+ taskId: string;
15
+ }
16
+ export interface AgentMessageRepository {
17
+ append: (input: AppendTaskMessageInput) => StoredTaskMessage;
18
+ listByTaskId: (taskId: string) => StoredTaskMessage[];
19
+ }
20
+ export declare function createInMemoryAgentMessageRepository(): AgentMessageRepository;
21
+ export declare function createSqliteAgentMessageRepository(database: AppDatabase): AgentMessageRepository;
22
+ //# sourceMappingURL=agent-message-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-message-repository.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-message-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,iBAAiB,CAAC;IAC7D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,iBAAiB,EAAE,CAAC;CACvD;AAED,wBAAgB,oCAAoC,IAAI,sBAAsB,CAuB7E;AAED,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,WAAW,GACpB,sBAAsB,CAyCxB"}
@@ -0,0 +1,60 @@
1
+ import { asc, desc, eq } from "drizzle-orm";
2
+ import { taskMessages } from "../../db/index.js";
3
+ export function createInMemoryAgentMessageRepository() {
4
+ const rows = [];
5
+ return {
6
+ append: (input) => {
7
+ const row = {
8
+ ...input,
9
+ sequence: Math.max(0, ...rows
10
+ .filter((candidate) => candidate.taskId === input.taskId)
11
+ .map((candidate) => candidate.sequence)) + 1
12
+ };
13
+ rows.push(row);
14
+ return row;
15
+ },
16
+ listByTaskId: (taskId) => rows
17
+ .filter((row) => row.taskId === taskId)
18
+ .sort((left, right) => left.sequence - right.sequence)
19
+ };
20
+ }
21
+ export function createSqliteAgentMessageRepository(database) {
22
+ return {
23
+ append: (input) => {
24
+ const latest = database.db
25
+ .select({ sequence: taskMessages.sequence })
26
+ .from(taskMessages)
27
+ .where(eq(taskMessages.taskId, input.taskId))
28
+ .orderBy(desc(taskMessages.sequence))
29
+ .get();
30
+ const sequence = (latest?.sequence ?? 0) + 1;
31
+ database.db
32
+ .insert(taskMessages)
33
+ .values({
34
+ agentId: input.agentId,
35
+ createdAt: input.createdAt,
36
+ id: input.message.id,
37
+ payload: JSON.stringify(input.message),
38
+ role: input.message.role,
39
+ sequence,
40
+ taskId: input.taskId,
41
+ updatedAt: input.createdAt
42
+ })
43
+ .run();
44
+ return { ...input, sequence };
45
+ },
46
+ listByTaskId: (taskId) => database.db
47
+ .select()
48
+ .from(taskMessages)
49
+ .where(eq(taskMessages.taskId, taskId))
50
+ .orderBy(asc(taskMessages.sequence))
51
+ .all()
52
+ .map((row) => ({
53
+ agentId: row.agentId,
54
+ createdAt: row.createdAt,
55
+ message: JSON.parse(row.payload),
56
+ sequence: row.sequence,
57
+ taskId: row.taskId
58
+ }))
59
+ };
60
+ }
@@ -0,0 +1,4 @@
1
+ import type { StoredAgentMessage } from "./agent-types";
2
+ import type { AgentMessage } from "@earendil-works/pi-agent-core";
3
+ export declare function toStoredAgentMessage(id: string, message: AgentMessage): StoredAgentMessage;
4
+ //# sourceMappingURL=agent-message-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-message-storage.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-message-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,YAAY,GACpB,kBAAkB,CAYpB"}
@@ -0,0 +1,11 @@
1
+ export function toStoredAgentMessage(id, message) {
2
+ const stored = { ...message, id };
3
+ if (stored.role !== "custom") {
4
+ delete stored.details;
5
+ }
6
+ delete stored.diagnostics;
7
+ delete stored.responseId;
8
+ delete stored.responseModel;
9
+ delete stored.usage;
10
+ return stored;
11
+ }
@@ -0,0 +1,4 @@
1
+ import { type Api, type Model } from "@earendil-works/pi-ai";
2
+ export type AgentModelLookup = (provider: string, modelId: string) => Model<Api> | null | Promise<Model<Api> | null>;
3
+ export declare function resolveAgentModel(provider: string, modelId: string, getCustomModel?: AgentModelLookup): Promise<Model<Api> | null>;
4
+ //# sourceMappingURL=agent-model-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-model-resolver.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-model-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAER,KAAK,KAAK,EACX,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GAAG,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,KACZ,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AAEpD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,gBAAgB,GAChC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAQ5B"}
@@ -0,0 +1,17 @@
1
+ import { getModels } from "@earendil-works/pi-ai";
2
+ export async function resolveAgentModel(provider, modelId, getCustomModel) {
3
+ const builtInModel = findBuiltInModel(provider, modelId);
4
+ if (builtInModel) {
5
+ return builtInModel;
6
+ }
7
+ return (await getCustomModel?.(provider, modelId)) ?? null;
8
+ }
9
+ function findBuiltInModel(provider, modelId) {
10
+ try {
11
+ return (getModels(provider).find((model) => model.id === modelId) ??
12
+ null);
13
+ }
14
+ catch {
15
+ return null;
16
+ }
17
+ }
@@ -0,0 +1,12 @@
1
+ import type { AgentEventBus } from "./agent-event-bus";
2
+ export declare function appendVisibleCustomMessage(input: {
3
+ agentId: string;
4
+ content: string;
5
+ customType: string;
6
+ details?: unknown;
7
+ eventBus: AgentEventBus;
8
+ session: {
9
+ appendCustomMessageEntry: (customType: string, content: string, display: boolean, details?: unknown) => Promise<unknown>;
10
+ };
11
+ }): Promise<void>;
12
+ //# sourceMappingURL=agent-runtime-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime-messages.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-runtime-messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,wBAAwB,EAAE,CACxB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,OAAO,KACd,OAAO,CAAC,OAAO,CAAC,CAAC;KACvB,CAAC;CACH,iBAsBA"}
@@ -0,0 +1,19 @@
1
+ import { randomUUID } from "node:crypto";
2
+ export async function appendVisibleCustomMessage(input) {
3
+ await input.session.appendCustomMessageEntry(input.customType, input.content, true, input.details);
4
+ input.eventBus.emit({
5
+ agentId: input.agentId,
6
+ payload: {
7
+ message: {
8
+ content: input.content,
9
+ customType: input.customType,
10
+ ...(input.details === undefined ? {} : { details: input.details }),
11
+ display: true,
12
+ id: `message_${randomUUID()}`,
13
+ role: "custom",
14
+ timestamp: Date.now()
15
+ }
16
+ },
17
+ type: "message_start"
18
+ });
19
+ }
@@ -0,0 +1,12 @@
1
+ import { type AgentHarness, type JsonlSessionRepoApi } from "@earendil-works/pi-agent-core/node";
2
+ import type { AgentSessionMetadata } from "./agent-types";
3
+ export declare function interruptHarness(harness: AgentHarness): Promise<void>;
4
+ export declare function createSessionRepo(): JsonlSessionRepoApi;
5
+ export declare function getSkillDirs(workspacePath: string, configuredSkillDirs?: string[]): string[];
6
+ export declare function getEnvApiKey(provider: string): string | undefined;
7
+ export declare function toAgentSessionMetadata(metadata: {
8
+ createdAt: string;
9
+ id: string;
10
+ path: string;
11
+ }): AgentSessionMetadata;
12
+ //# sourceMappingURL=agent-runtime-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime-support.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-runtime-support.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAO1D,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAc3E;AAED,wBAAgB,iBAAiB,IAAI,mBAAmB,CAKvD;AAED,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAC7B,MAAM,EAAE,CAKV;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,oBAAoB,CAMvB"}
@@ -0,0 +1,38 @@
1
+ import { homedir } from "node:os";
2
+ import { join } from "node:path";
3
+ import { JsonlSessionRepo, NodeExecutionEnv } from "@earendil-works/pi-agent-core/node";
4
+ import { SESSIONS_DIR } from "../../config/const.js";
5
+ export async function interruptHarness(harness) {
6
+ const interruptibleHarness = harness;
7
+ if (interruptibleHarness.interrupt) {
8
+ await interruptibleHarness.interrupt();
9
+ return;
10
+ }
11
+ if (interruptibleHarness.abort) {
12
+ await interruptibleHarness.abort();
13
+ return;
14
+ }
15
+ throw new Error("Agent runtime does not support interruption");
16
+ }
17
+ export function createSessionRepo() {
18
+ return new JsonlSessionRepo({
19
+ fs: new NodeExecutionEnv({ cwd: SESSIONS_DIR }),
20
+ sessionsRoot: SESSIONS_DIR
21
+ });
22
+ }
23
+ export function getSkillDirs(workspacePath, configuredSkillDirs) {
24
+ return configuredSkillDirs ?? [
25
+ join(workspacePath, ".hold-rein", "skills"),
26
+ join(homedir(), ".hold-rein", "skills")
27
+ ];
28
+ }
29
+ export function getEnvApiKey(provider) {
30
+ return process.env[`${provider.toUpperCase()}_API_KEY`];
31
+ }
32
+ export function toAgentSessionMetadata(metadata) {
33
+ return {
34
+ createdAt: metadata.createdAt,
35
+ id: metadata.id,
36
+ path: metadata.path
37
+ };
38
+ }
@@ -0,0 +1,25 @@
1
+ import { type JsonlSessionRepoApi } from "@earendil-works/pi-agent-core/node";
2
+ import type { AgentApprovalStore } from "./agent-approval-store";
3
+ import type { AgentEventBus } from "./agent-event-bus";
4
+ import { type AgentModelLookup } from "./agent-model-resolver";
5
+ import { type AgentRunResult, type AgentSessionMetadata, type StoredAgentMessage, type RunAgentInput } from "./agent-types";
6
+ import { type SubagentRepository } from "./subagent-repository";
7
+ export interface AgentRuntime {
8
+ interrupt: (agentId: string) => Promise<boolean>;
9
+ listMessages: (input: {
10
+ session: AgentSessionMetadata;
11
+ workspacePath: string;
12
+ }) => Promise<StoredAgentMessage[]>;
13
+ start: (input: RunAgentInput) => Promise<AgentRunResult>;
14
+ }
15
+ export interface CreateAgentRuntimeOptions {
16
+ approvalStore: AgentApprovalStore;
17
+ eventBus: AgentEventBus;
18
+ getApiKey?: (provider: string, modelId: string) => Promise<string | undefined>;
19
+ getCustomModel?: AgentModelLookup;
20
+ sessionRepo?: JsonlSessionRepoApi;
21
+ skillDirs?: string[];
22
+ subagentRepository?: SubagentRepository;
23
+ }
24
+ export declare function createAgentRuntime(options: CreateAgentRuntimeOptions): AgentRuntime;
25
+ //# sourceMappingURL=agent-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../../../src/modules/agents/agent-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2E,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEvJ,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAK5H,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,YAAY,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjH,KAAK,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/E,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAqBD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAkbd"}