rookery-agent 0.1.0 → 0.2.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 (669) hide show
  1. package/README.md +467 -367
  2. package/docs/migration.md +88 -88
  3. package/docs/updates.md +112 -0
  4. package/package.json +11 -3
  5. package/packages/cli/dist/commands/config.js +2 -2
  6. package/packages/cli/dist/commands/doctor.d.ts.map +1 -1
  7. package/packages/cli/dist/commands/doctor.js +13 -9
  8. package/packages/cli/dist/commands/doctor.js.map +1 -1
  9. package/packages/cli/dist/commands/memory.js +1 -1
  10. package/packages/cli/dist/commands/org.d.ts +2 -2
  11. package/packages/cli/dist/commands/org.d.ts.map +1 -1
  12. package/packages/cli/dist/commands/org.js +19 -17
  13. package/packages/cli/dist/commands/org.js.map +1 -1
  14. package/packages/cli/dist/commands/serve.js +1 -1
  15. package/packages/cli/dist/commands/serve.js.map +1 -1
  16. package/packages/cli/dist/commands/shared.d.ts.map +1 -1
  17. package/packages/cli/dist/commands/shared.js +2 -1
  18. package/packages/cli/dist/commands/shared.js.map +1 -1
  19. package/packages/cli/dist/commands/tasks.d.ts.map +1 -1
  20. package/packages/cli/dist/commands/tasks.js +25 -11
  21. package/packages/cli/dist/commands/tasks.js.map +1 -1
  22. package/packages/cli/dist/commands/tools.js +1 -1
  23. package/packages/cli/dist/commands/tools.js.map +1 -1
  24. package/packages/cli/dist/index.js +13 -13
  25. package/packages/cli/dist/index.js.map +1 -1
  26. package/packages/cli/dist/repl.d.ts +12 -0
  27. package/packages/cli/dist/repl.d.ts.map +1 -1
  28. package/packages/cli/dist/repl.js +170 -16
  29. package/packages/cli/dist/repl.js.map +1 -1
  30. package/packages/cli/dist/tui/App.d.ts +7 -3
  31. package/packages/cli/dist/tui/App.d.ts.map +1 -1
  32. package/packages/cli/dist/tui/App.js +182 -16
  33. package/packages/cli/dist/tui/App.js.map +1 -1
  34. package/packages/cli/dist/tui/commands.d.ts +7 -0
  35. package/packages/cli/dist/tui/commands.d.ts.map +1 -1
  36. package/packages/cli/dist/tui/commands.js +70 -8
  37. package/packages/cli/dist/tui/commands.js.map +1 -1
  38. package/packages/cli/dist/tui/components/AssignmentsView.js +4 -4
  39. package/packages/cli/dist/tui/components/AssignmentsView.js.map +1 -1
  40. package/packages/cli/dist/tui/components/Banner.d.ts +11 -2
  41. package/packages/cli/dist/tui/components/Banner.d.ts.map +1 -1
  42. package/packages/cli/dist/tui/components/Banner.js +7 -10
  43. package/packages/cli/dist/tui/components/Banner.js.map +1 -1
  44. package/packages/cli/dist/tui/components/CodeBlock.js +2 -2
  45. package/packages/cli/dist/tui/components/CodeBlock.js.map +1 -1
  46. package/packages/cli/dist/tui/components/InputBox.d.ts.map +1 -1
  47. package/packages/cli/dist/tui/components/InputBox.js +4 -4
  48. package/packages/cli/dist/tui/components/InputBox.js.map +1 -1
  49. package/packages/cli/dist/tui/components/Logo.d.ts +56 -0
  50. package/packages/cli/dist/tui/components/Logo.d.ts.map +1 -0
  51. package/packages/cli/dist/tui/components/Logo.js +50 -0
  52. package/packages/cli/dist/tui/components/Logo.js.map +1 -0
  53. package/packages/cli/dist/tui/components/Markdown.js +8 -8
  54. package/packages/cli/dist/tui/components/Markdown.js.map +1 -1
  55. package/packages/cli/dist/tui/components/Message.d.ts +1 -1
  56. package/packages/cli/dist/tui/components/Message.d.ts.map +1 -1
  57. package/packages/cli/dist/tui/components/Message.js +5 -4
  58. package/packages/cli/dist/tui/components/Message.js.map +1 -1
  59. package/packages/cli/dist/tui/components/QuestionView.d.ts +29 -0
  60. package/packages/cli/dist/tui/components/QuestionView.d.ts.map +1 -0
  61. package/packages/cli/dist/tui/components/QuestionView.js +53 -0
  62. package/packages/cli/dist/tui/components/QuestionView.js.map +1 -0
  63. package/packages/cli/dist/tui/components/SlashPalette.d.ts +5 -2
  64. package/packages/cli/dist/tui/components/SlashPalette.d.ts.map +1 -1
  65. package/packages/cli/dist/tui/components/SlashPalette.js +2 -2
  66. package/packages/cli/dist/tui/components/SlashPalette.js.map +1 -1
  67. package/packages/cli/dist/tui/components/StatusLine.d.ts +0 -2
  68. package/packages/cli/dist/tui/components/StatusLine.d.ts.map +1 -1
  69. package/packages/cli/dist/tui/components/StatusLine.js +8 -5
  70. package/packages/cli/dist/tui/components/StatusLine.js.map +1 -1
  71. package/packages/cli/dist/tui/components/ToolGroup.js +2 -2
  72. package/packages/cli/dist/tui/components/ToolGroup.js.map +1 -1
  73. package/packages/cli/dist/tui/components/WatchView.d.ts +21 -0
  74. package/packages/cli/dist/tui/components/WatchView.d.ts.map +1 -0
  75. package/packages/cli/dist/tui/components/WatchView.js +36 -0
  76. package/packages/cli/dist/tui/components/WatchView.js.map +1 -0
  77. package/packages/cli/dist/tui/history.d.ts +20 -0
  78. package/packages/cli/dist/tui/history.d.ts.map +1 -0
  79. package/packages/cli/dist/tui/history.js +105 -0
  80. package/packages/cli/dist/tui/history.js.map +1 -0
  81. package/packages/cli/dist/tui/hooks/useSlash.d.ts.map +1 -1
  82. package/packages/cli/dist/tui/hooks/useSlash.js +3 -2
  83. package/packages/cli/dist/tui/hooks/useSlash.js.map +1 -1
  84. package/packages/cli/dist/tui/hooks/useTurn.d.ts +58 -1
  85. package/packages/cli/dist/tui/hooks/useTurn.d.ts.map +1 -1
  86. package/packages/cli/dist/tui/hooks/useTurn.js +214 -36
  87. package/packages/cli/dist/tui/hooks/useTurn.js.map +1 -1
  88. package/packages/cli/dist/tui/hooks/useWatch.d.ts +52 -0
  89. package/packages/cli/dist/tui/hooks/useWatch.d.ts.map +1 -0
  90. package/packages/cli/dist/tui/hooks/useWatch.js +145 -0
  91. package/packages/cli/dist/tui/hooks/useWatch.js.map +1 -0
  92. package/packages/cli/dist/tui/inkTheme.d.ts +19 -0
  93. package/packages/cli/dist/tui/inkTheme.d.ts.map +1 -0
  94. package/packages/cli/dist/tui/inkTheme.js +81 -0
  95. package/packages/cli/dist/tui/inkTheme.js.map +1 -0
  96. package/packages/cli/dist/tui/theme.d.ts +39 -29
  97. package/packages/cli/dist/tui/theme.d.ts.map +1 -1
  98. package/packages/cli/dist/tui/theme.js +35 -25
  99. package/packages/cli/dist/tui/theme.js.map +1 -1
  100. package/packages/cli/dist/tui/types.d.ts +56 -3
  101. package/packages/cli/dist/tui/types.d.ts.map +1 -1
  102. package/packages/cli/dist/tui/types.js +85 -0
  103. package/packages/cli/dist/tui/types.js.map +1 -1
  104. package/packages/cli/dist/ui/modelNames.d.ts +51 -0
  105. package/packages/cli/dist/ui/modelNames.d.ts.map +1 -0
  106. package/packages/cli/dist/ui/modelNames.js +134 -0
  107. package/packages/cli/dist/ui/modelNames.js.map +1 -0
  108. package/packages/cli/dist/ui/render.d.ts.map +1 -1
  109. package/packages/cli/dist/ui/render.js +17 -8
  110. package/packages/cli/dist/ui/render.js.map +1 -1
  111. package/packages/cli/dist/ui/speech.js +5 -0
  112. package/packages/cli/dist/ui/speech.js.map +1 -1
  113. package/packages/cli/dist/ui/theme.d.ts +33 -9
  114. package/packages/cli/dist/ui/theme.d.ts.map +1 -1
  115. package/packages/cli/dist/ui/theme.js +33 -9
  116. package/packages/cli/dist/ui/theme.js.map +1 -1
  117. package/packages/cli/package.json +1 -1
  118. package/packages/core/dist/agents/persona.d.ts.map +1 -1
  119. package/packages/core/dist/agents/persona.js +4 -1
  120. package/packages/core/dist/agents/persona.js.map +1 -1
  121. package/packages/core/dist/computer/accessibility.d.ts +78 -0
  122. package/packages/core/dist/computer/accessibility.d.ts.map +1 -0
  123. package/packages/core/dist/computer/accessibility.js +270 -0
  124. package/packages/core/dist/computer/accessibility.js.map +1 -0
  125. package/packages/core/dist/computer/assemblies.d.ts +17 -0
  126. package/packages/core/dist/computer/assemblies.d.ts.map +1 -0
  127. package/packages/core/dist/computer/assemblies.js +55 -0
  128. package/packages/core/dist/computer/assemblies.js.map +1 -0
  129. package/packages/core/dist/computer/browser-init.d.ts +9 -0
  130. package/packages/core/dist/computer/browser-init.d.ts.map +1 -0
  131. package/packages/core/dist/computer/browser-init.js +133 -0
  132. package/packages/core/dist/computer/browser-init.js.map +1 -0
  133. package/packages/core/dist/computer/cursor.d.ts +30 -0
  134. package/packages/core/dist/computer/cursor.d.ts.map +1 -0
  135. package/packages/core/dist/computer/cursor.js +30 -0
  136. package/packages/core/dist/computer/cursor.js.map +1 -0
  137. package/packages/core/dist/computer/mcp-server.js +524 -82
  138. package/packages/core/dist/computer/mcp-server.js.map +1 -1
  139. package/packages/core/dist/computer/powershell.d.ts +4 -0
  140. package/packages/core/dist/computer/powershell.d.ts.map +1 -1
  141. package/packages/core/dist/computer/powershell.js +471 -81
  142. package/packages/core/dist/computer/powershell.js.map +1 -1
  143. package/packages/core/dist/computer/screen-text.d.ts +82 -0
  144. package/packages/core/dist/computer/screen-text.d.ts.map +1 -0
  145. package/packages/core/dist/computer/screen-text.js +243 -0
  146. package/packages/core/dist/computer/screen-text.js.map +1 -0
  147. package/packages/core/dist/computer/sketch.d.ts +66 -0
  148. package/packages/core/dist/computer/sketch.d.ts.map +1 -0
  149. package/packages/core/dist/computer/sketch.js +540 -0
  150. package/packages/core/dist/computer/sketch.js.map +1 -0
  151. package/packages/core/dist/computer/tools.d.ts +8 -8
  152. package/packages/core/dist/computer/tools.d.ts.map +1 -1
  153. package/packages/core/dist/computer/tools.js +186 -31
  154. package/packages/core/dist/computer/tools.js.map +1 -1
  155. package/packages/core/dist/computer/validation.d.ts +555 -0
  156. package/packages/core/dist/computer/validation.d.ts.map +1 -0
  157. package/packages/core/dist/computer/validation.js +111 -0
  158. package/packages/core/dist/computer/validation.js.map +1 -0
  159. package/packages/core/dist/computer/windows-cursor.d.ts +14 -0
  160. package/packages/core/dist/computer/windows-cursor.d.ts.map +1 -0
  161. package/packages/core/dist/computer/windows-cursor.js +713 -0
  162. package/packages/core/dist/computer/windows-cursor.js.map +1 -0
  163. package/packages/core/dist/config.d.ts.map +1 -1
  164. package/packages/core/dist/config.js +284 -10
  165. package/packages/core/dist/config.js.map +1 -1
  166. package/packages/core/dist/cron/scheduler.d.ts +49 -3
  167. package/packages/core/dist/cron/scheduler.d.ts.map +1 -1
  168. package/packages/core/dist/cron/scheduler.js +268 -25
  169. package/packages/core/dist/cron/scheduler.js.map +1 -1
  170. package/packages/core/dist/cron/store.d.ts +19 -1
  171. package/packages/core/dist/cron/store.d.ts.map +1 -1
  172. package/packages/core/dist/cron/store.js +36 -8
  173. package/packages/core/dist/cron/store.js.map +1 -1
  174. package/packages/core/dist/external/claude-code.d.ts +4 -0
  175. package/packages/core/dist/external/claude-code.d.ts.map +1 -0
  176. package/packages/core/dist/external/claude-code.js +111 -0
  177. package/packages/core/dist/external/claude-code.js.map +1 -0
  178. package/packages/core/dist/external/discovery.d.ts +33 -0
  179. package/packages/core/dist/external/discovery.d.ts.map +1 -0
  180. package/packages/core/dist/external/discovery.js +144 -0
  181. package/packages/core/dist/external/discovery.js.map +1 -0
  182. package/packages/core/dist/external/homes.d.ts +26 -0
  183. package/packages/core/dist/external/homes.d.ts.map +1 -0
  184. package/packages/core/dist/external/homes.js +49 -0
  185. package/packages/core/dist/external/homes.js.map +1 -0
  186. package/packages/core/dist/external/shared.d.ts +201 -0
  187. package/packages/core/dist/external/shared.d.ts.map +1 -0
  188. package/packages/core/dist/external/shared.js +308 -0
  189. package/packages/core/dist/external/shared.js.map +1 -0
  190. package/packages/core/dist/gateway/policy.d.ts +100 -2
  191. package/packages/core/dist/gateway/policy.d.ts.map +1 -1
  192. package/packages/core/dist/gateway/policy.js +270 -6
  193. package/packages/core/dist/gateway/policy.js.map +1 -1
  194. package/packages/core/dist/index.d.ts +36 -10
  195. package/packages/core/dist/index.d.ts.map +1 -1
  196. package/packages/core/dist/index.js +64 -10
  197. package/packages/core/dist/index.js.map +1 -1
  198. package/packages/core/dist/memory/db.d.ts +1 -1
  199. package/packages/core/dist/memory/db.d.ts.map +1 -1
  200. package/packages/core/dist/memory/db.js +741 -1
  201. package/packages/core/dist/memory/db.js.map +1 -1
  202. package/packages/core/dist/memory/dream/admission.d.ts +124 -0
  203. package/packages/core/dist/memory/dream/admission.d.ts.map +1 -0
  204. package/packages/core/dist/memory/dream/admission.js +116 -0
  205. package/packages/core/dist/memory/dream/admission.js.map +1 -0
  206. package/packages/core/dist/memory/dream/candidate.d.ts +152 -0
  207. package/packages/core/dist/memory/dream/candidate.d.ts.map +1 -0
  208. package/packages/core/dist/memory/dream/candidate.js +547 -0
  209. package/packages/core/dist/memory/dream/candidate.js.map +1 -0
  210. package/packages/core/dist/memory/dream/evaluate.d.ts +394 -0
  211. package/packages/core/dist/memory/dream/evaluate.d.ts.map +1 -0
  212. package/packages/core/dist/memory/dream/evaluate.js +1032 -0
  213. package/packages/core/dist/memory/dream/evaluate.js.map +1 -0
  214. package/packages/core/dist/memory/dream/frame.d.ts +61 -0
  215. package/packages/core/dist/memory/dream/frame.d.ts.map +1 -0
  216. package/packages/core/dist/memory/dream/frame.js +292 -0
  217. package/packages/core/dist/memory/dream/frame.js.map +1 -0
  218. package/packages/core/dist/memory/dream/label.d.ts +370 -0
  219. package/packages/core/dist/memory/dream/label.d.ts.map +1 -0
  220. package/packages/core/dist/memory/dream/label.js +439 -0
  221. package/packages/core/dist/memory/dream/label.js.map +1 -0
  222. package/packages/core/dist/memory/dream/measure.d.ts +114 -0
  223. package/packages/core/dist/memory/dream/measure.d.ts.map +1 -0
  224. package/packages/core/dist/memory/dream/measure.js +205 -0
  225. package/packages/core/dist/memory/dream/measure.js.map +1 -0
  226. package/packages/core/dist/memory/dream/policy.d.ts +21 -0
  227. package/packages/core/dist/memory/dream/policy.d.ts.map +1 -0
  228. package/packages/core/dist/memory/dream/policy.js +157 -0
  229. package/packages/core/dist/memory/dream/policy.js.map +1 -0
  230. package/packages/core/dist/memory/dream/probe.d.ts +202 -0
  231. package/packages/core/dist/memory/dream/probe.d.ts.map +1 -0
  232. package/packages/core/dist/memory/dream/probe.js +671 -0
  233. package/packages/core/dist/memory/dream/probe.js.map +1 -0
  234. package/packages/core/dist/memory/dream/promote.d.ts +312 -0
  235. package/packages/core/dist/memory/dream/promote.d.ts.map +1 -0
  236. package/packages/core/dist/memory/dream/promote.js +528 -0
  237. package/packages/core/dist/memory/dream/promote.js.map +1 -0
  238. package/packages/core/dist/memory/dream/score.d.ts +103 -0
  239. package/packages/core/dist/memory/dream/score.d.ts.map +1 -0
  240. package/packages/core/dist/memory/dream/score.js +334 -0
  241. package/packages/core/dist/memory/dream/score.js.map +1 -0
  242. package/packages/core/dist/memory/dream/slots.d.ts +193 -0
  243. package/packages/core/dist/memory/dream/slots.d.ts.map +1 -0
  244. package/packages/core/dist/memory/dream/slots.js +0 -0
  245. package/packages/core/dist/memory/dream/slots.js.map +1 -0
  246. package/packages/core/dist/memory/dream/trajectory.d.ts +262 -0
  247. package/packages/core/dist/memory/dream/trajectory.d.ts.map +1 -0
  248. package/packages/core/dist/memory/dream/trajectory.js +366 -0
  249. package/packages/core/dist/memory/dream/trajectory.js.map +1 -0
  250. package/packages/core/dist/memory/extractor.d.ts +7 -0
  251. package/packages/core/dist/memory/extractor.d.ts.map +1 -1
  252. package/packages/core/dist/memory/extractor.js +35 -12
  253. package/packages/core/dist/memory/extractor.js.map +1 -1
  254. package/packages/core/dist/memory/gate.d.ts +43 -7
  255. package/packages/core/dist/memory/gate.d.ts.map +1 -1
  256. package/packages/core/dist/memory/gate.js +91 -4
  257. package/packages/core/dist/memory/gate.js.map +1 -1
  258. package/packages/core/dist/memory/recall.d.ts +57 -0
  259. package/packages/core/dist/memory/recall.d.ts.map +1 -1
  260. package/packages/core/dist/memory/recall.js +60 -123
  261. package/packages/core/dist/memory/recall.js.map +1 -1
  262. package/packages/core/dist/memory/sleep.d.ts +131 -4
  263. package/packages/core/dist/memory/sleep.d.ts.map +1 -1
  264. package/packages/core/dist/memory/sleep.js +2384 -65
  265. package/packages/core/dist/memory/sleep.js.map +1 -1
  266. package/packages/core/dist/memory/store.d.ts +564 -10
  267. package/packages/core/dist/memory/store.d.ts.map +1 -1
  268. package/packages/core/dist/memory/store.js +1673 -102
  269. package/packages/core/dist/memory/store.js.map +1 -1
  270. package/packages/core/dist/org/controller.d.ts +282 -3
  271. package/packages/core/dist/org/controller.d.ts.map +1 -1
  272. package/packages/core/dist/org/controller.js +2334 -237
  273. package/packages/core/dist/org/controller.js.map +1 -1
  274. package/packages/core/dist/org/ponytail.d.ts +1 -1
  275. package/packages/core/dist/org/ponytail.js +1 -1
  276. package/packages/core/dist/org/project-mcp.d.ts +3 -3
  277. package/packages/core/dist/org/prompts.d.ts +41 -28
  278. package/packages/core/dist/org/prompts.d.ts.map +1 -1
  279. package/packages/core/dist/org/prompts.js +281 -94
  280. package/packages/core/dist/org/prompts.js.map +1 -1
  281. package/packages/core/dist/org/questions.d.ts +104 -0
  282. package/packages/core/dist/org/questions.d.ts.map +1 -0
  283. package/packages/core/dist/org/questions.js +136 -0
  284. package/packages/core/dist/org/questions.js.map +1 -0
  285. package/packages/core/dist/org/review.d.ts +100 -0
  286. package/packages/core/dist/org/review.d.ts.map +1 -0
  287. package/packages/core/dist/org/review.js +256 -0
  288. package/packages/core/dist/org/review.js.map +1 -0
  289. package/packages/core/dist/org/store.d.ts +249 -2
  290. package/packages/core/dist/org/store.d.ts.map +1 -1
  291. package/packages/core/dist/org/store.js +787 -13
  292. package/packages/core/dist/org/store.js.map +1 -1
  293. package/packages/core/dist/org/tools.d.ts +26 -2
  294. package/packages/core/dist/org/tools.d.ts.map +1 -1
  295. package/packages/core/dist/org/tools.js +352 -63
  296. package/packages/core/dist/org/tools.js.map +1 -1
  297. package/packages/core/dist/providers/catalogue.d.ts +1 -1
  298. package/packages/core/dist/providers/catalogue.d.ts.map +1 -1
  299. package/packages/core/dist/providers/catalogue.js +2 -2
  300. package/packages/core/dist/providers/catalogue.js.map +1 -1
  301. package/packages/core/dist/providers/claude-code.d.ts +18 -3
  302. package/packages/core/dist/providers/claude-code.d.ts.map +1 -1
  303. package/packages/core/dist/providers/claude-code.js +490 -40
  304. package/packages/core/dist/providers/claude-code.js.map +1 -1
  305. package/packages/core/dist/providers/claude-tui.d.ts +175 -0
  306. package/packages/core/dist/providers/claude-tui.d.ts.map +1 -0
  307. package/packages/core/dist/providers/claude-tui.js +683 -0
  308. package/packages/core/dist/providers/claude-tui.js.map +1 -0
  309. package/packages/core/dist/providers/codex-auth.d.ts +15 -0
  310. package/packages/core/dist/providers/codex-auth.d.ts.map +1 -0
  311. package/packages/core/dist/providers/codex-auth.js +127 -0
  312. package/packages/core/dist/providers/codex-auth.js.map +1 -0
  313. package/packages/core/dist/providers/codex-bridge.d.ts +58 -0
  314. package/packages/core/dist/providers/codex-bridge.d.ts.map +1 -0
  315. package/packages/core/dist/providers/codex-bridge.js +375 -0
  316. package/packages/core/dist/providers/codex-bridge.js.map +1 -0
  317. package/packages/core/dist/providers/codex-translate.d.ts +75 -0
  318. package/packages/core/dist/providers/codex-translate.d.ts.map +1 -0
  319. package/packages/core/dist/providers/codex-translate.js +383 -0
  320. package/packages/core/dist/providers/codex-translate.js.map +1 -0
  321. package/packages/core/dist/providers/model-gateway.d.ts +56 -0
  322. package/packages/core/dist/providers/model-gateway.d.ts.map +1 -0
  323. package/packages/core/dist/providers/model-gateway.js +119 -0
  324. package/packages/core/dist/providers/model-gateway.js.map +1 -0
  325. package/packages/core/dist/providers/process.d.ts +3 -1
  326. package/packages/core/dist/providers/process.d.ts.map +1 -1
  327. package/packages/core/dist/providers/process.js +3 -3
  328. package/packages/core/dist/providers/process.js.map +1 -1
  329. package/packages/core/dist/providers/profiles.d.ts +11 -0
  330. package/packages/core/dist/providers/profiles.d.ts.map +1 -0
  331. package/packages/core/dist/providers/profiles.js +28 -0
  332. package/packages/core/dist/providers/profiles.js.map +1 -0
  333. package/packages/core/dist/providers/provider-catalog.d.ts +72 -0
  334. package/packages/core/dist/providers/provider-catalog.d.ts.map +1 -0
  335. package/packages/core/dist/providers/provider-catalog.js +144 -0
  336. package/packages/core/dist/providers/provider-catalog.js.map +1 -0
  337. package/packages/core/dist/providers/quota.d.ts +40 -1
  338. package/packages/core/dist/providers/quota.d.ts.map +1 -1
  339. package/packages/core/dist/providers/quota.js +288 -25
  340. package/packages/core/dist/providers/quota.js.map +1 -1
  341. package/packages/core/dist/providers/registry.d.ts +46 -3
  342. package/packages/core/dist/providers/registry.d.ts.map +1 -1
  343. package/packages/core/dist/providers/registry.js +148 -13
  344. package/packages/core/dist/providers/registry.js.map +1 -1
  345. package/packages/core/dist/providers/router.d.ts +28 -0
  346. package/packages/core/dist/providers/router.d.ts.map +1 -0
  347. package/packages/core/dist/providers/router.js +88 -0
  348. package/packages/core/dist/providers/router.js.map +1 -0
  349. package/packages/core/dist/providers/user-settings-guard.d.ts +12 -0
  350. package/packages/core/dist/providers/user-settings-guard.d.ts.map +1 -0
  351. package/packages/core/dist/providers/user-settings-guard.js +130 -0
  352. package/packages/core/dist/providers/user-settings-guard.js.map +1 -0
  353. package/packages/core/dist/runtime.d.ts +140 -6
  354. package/packages/core/dist/runtime.d.ts.map +1 -1
  355. package/packages/core/dist/runtime.js +1312 -225
  356. package/packages/core/dist/runtime.js.map +1 -1
  357. package/packages/core/dist/skills/builtin.d.ts +34 -0
  358. package/packages/core/dist/skills/builtin.d.ts.map +1 -0
  359. package/packages/core/dist/skills/builtin.js +305 -0
  360. package/packages/core/dist/skills/builtin.js.map +1 -0
  361. package/packages/core/dist/skills/shelf.d.ts +30 -0
  362. package/packages/core/dist/skills/shelf.d.ts.map +1 -0
  363. package/packages/core/dist/skills/shelf.js +159 -0
  364. package/packages/core/dist/skills/shelf.js.map +1 -0
  365. package/packages/core/dist/skills/store.d.ts +66 -4
  366. package/packages/core/dist/skills/store.d.ts.map +1 -1
  367. package/packages/core/dist/skills/store.js +105 -18
  368. package/packages/core/dist/skills/store.js.map +1 -1
  369. package/packages/core/dist/skills/suggest.d.ts +21 -0
  370. package/packages/core/dist/skills/suggest.d.ts.map +1 -0
  371. package/packages/core/dist/skills/suggest.js +150 -0
  372. package/packages/core/dist/skills/suggest.js.map +1 -0
  373. package/packages/core/dist/tools/catalog.d.ts +1 -3
  374. package/packages/core/dist/tools/catalog.d.ts.map +1 -1
  375. package/packages/core/dist/tools/catalog.js +38 -26
  376. package/packages/core/dist/tools/catalog.js.map +1 -1
  377. package/packages/core/dist/tools/hub.d.ts +136 -10
  378. package/packages/core/dist/tools/hub.d.ts.map +1 -1
  379. package/packages/core/dist/tools/hub.js +418 -24
  380. package/packages/core/dist/tools/hub.js.map +1 -1
  381. package/packages/core/dist/turns/journal.d.ts +78 -0
  382. package/packages/core/dist/turns/journal.d.ts.map +1 -0
  383. package/packages/core/dist/turns/journal.js +104 -0
  384. package/packages/core/dist/turns/journal.js.map +1 -0
  385. package/packages/core/dist/types.d.ts +1598 -12
  386. package/packages/core/dist/types.d.ts.map +1 -1
  387. package/packages/core/dist/types.js.map +1 -1
  388. package/packages/core/dist/util/blocks.d.ts +41 -0
  389. package/packages/core/dist/util/blocks.d.ts.map +1 -0
  390. package/packages/core/dist/util/blocks.js +175 -0
  391. package/packages/core/dist/util/blocks.js.map +1 -0
  392. package/packages/core/dist/util/queue.d.ts +12 -0
  393. package/packages/core/dist/util/queue.d.ts.map +1 -1
  394. package/packages/core/dist/util/queue.js +16 -0
  395. package/packages/core/dist/util/queue.js.map +1 -1
  396. package/packages/core/dist/util/time.d.ts +39 -0
  397. package/packages/core/dist/util/time.d.ts.map +1 -0
  398. package/packages/core/dist/util/time.js +71 -0
  399. package/packages/core/dist/util/time.js.map +1 -0
  400. package/packages/core/package.json +1 -1
  401. package/packages/server/dist/auth.d.ts +14 -1
  402. package/packages/server/dist/auth.d.ts.map +1 -1
  403. package/packages/server/dist/auth.js +19 -0
  404. package/packages/server/dist/auth.js.map +1 -1
  405. package/packages/server/dist/context.d.ts +35 -1
  406. package/packages/server/dist/context.d.ts.map +1 -1
  407. package/packages/server/dist/context.js +28 -8
  408. package/packages/server/dist/context.js.map +1 -1
  409. package/packages/server/dist/gateways/attachments.d.ts +32 -0
  410. package/packages/server/dist/gateways/attachments.d.ts.map +1 -0
  411. package/packages/server/dist/gateways/attachments.js +167 -0
  412. package/packages/server/dist/gateways/attachments.js.map +1 -0
  413. package/packages/server/dist/gateways/markdown.d.ts +9 -0
  414. package/packages/server/dist/gateways/markdown.d.ts.map +1 -0
  415. package/packages/server/dist/gateways/markdown.js +170 -0
  416. package/packages/server/dist/gateways/markdown.js.map +1 -0
  417. package/packages/server/dist/gateways/push.d.ts +1 -1
  418. package/packages/server/dist/gateways/push.d.ts.map +1 -1
  419. package/packages/server/dist/gateways/push.js +347 -6
  420. package/packages/server/dist/gateways/push.js.map +1 -1
  421. package/packages/server/dist/gateways/telegram-api.d.ts +70 -1
  422. package/packages/server/dist/gateways/telegram-api.d.ts.map +1 -1
  423. package/packages/server/dist/gateways/telegram-api.js +140 -1
  424. package/packages/server/dist/gateways/telegram-api.js.map +1 -1
  425. package/packages/server/dist/gateways/telegram.d.ts +158 -1
  426. package/packages/server/dist/gateways/telegram.d.ts.map +1 -1
  427. package/packages/server/dist/gateways/telegram.js +1471 -78
  428. package/packages/server/dist/gateways/telegram.js.map +1 -1
  429. package/packages/server/dist/gateways/threads.d.ts +79 -0
  430. package/packages/server/dist/gateways/threads.d.ts.map +1 -0
  431. package/packages/server/dist/gateways/threads.js +279 -0
  432. package/packages/server/dist/gateways/threads.js.map +1 -0
  433. package/packages/server/dist/index.d.ts +2 -1
  434. package/packages/server/dist/index.d.ts.map +1 -1
  435. package/packages/server/dist/index.js +2 -1
  436. package/packages/server/dist/index.js.map +1 -1
  437. package/packages/server/dist/listeners/imap.d.ts +13 -0
  438. package/packages/server/dist/listeners/imap.d.ts.map +1 -0
  439. package/packages/server/dist/listeners/imap.js +0 -0
  440. package/packages/server/dist/listeners/imap.js.map +1 -0
  441. package/packages/server/dist/listeners/registry.d.ts +18 -0
  442. package/packages/server/dist/listeners/registry.d.ts.map +1 -0
  443. package/packages/server/dist/listeners/registry.js +88 -0
  444. package/packages/server/dist/listeners/registry.js.map +1 -0
  445. package/packages/server/dist/listeners/types.d.ts +55 -0
  446. package/packages/server/dist/listeners/types.d.ts.map +1 -0
  447. package/packages/server/dist/listeners/types.js +2 -0
  448. package/packages/server/dist/listeners/types.js.map +1 -0
  449. package/packages/server/dist/main.js +15 -1
  450. package/packages/server/dist/main.js.map +1 -1
  451. package/packages/server/dist/routes/chat.d.ts +7 -3
  452. package/packages/server/dist/routes/chat.d.ts.map +1 -1
  453. package/packages/server/dist/routes/chat.js +8 -17
  454. package/packages/server/dist/routes/chat.js.map +1 -1
  455. package/packages/server/dist/routes/config.d.ts.map +1 -1
  456. package/packages/server/dist/routes/config.js +39 -7
  457. package/packages/server/dist/routes/config.js.map +1 -1
  458. package/packages/server/dist/routes/cron.d.ts.map +1 -1
  459. package/packages/server/dist/routes/cron.js +65 -8
  460. package/packages/server/dist/routes/cron.js.map +1 -1
  461. package/packages/server/dist/routes/dream.d.ts +22 -0
  462. package/packages/server/dist/routes/dream.d.ts.map +1 -0
  463. package/packages/server/dist/routes/dream.js +152 -0
  464. package/packages/server/dist/routes/dream.js.map +1 -0
  465. package/packages/server/dist/routes/hooks.d.ts +18 -0
  466. package/packages/server/dist/routes/hooks.d.ts.map +1 -0
  467. package/packages/server/dist/routes/hooks.js +62 -0
  468. package/packages/server/dist/routes/hooks.js.map +1 -0
  469. package/packages/server/dist/routes/listeners.d.ts +10 -0
  470. package/packages/server/dist/routes/listeners.d.ts.map +1 -0
  471. package/packages/server/dist/routes/listeners.js +12 -0
  472. package/packages/server/dist/routes/listeners.js.map +1 -0
  473. package/packages/server/dist/routes/memories.d.ts.map +1 -1
  474. package/packages/server/dist/routes/memories.js +55 -3
  475. package/packages/server/dist/routes/memories.js.map +1 -1
  476. package/packages/server/dist/routes/org.d.ts.map +1 -1
  477. package/packages/server/dist/routes/org.js +284 -48
  478. package/packages/server/dist/routes/org.js.map +1 -1
  479. package/packages/server/dist/routes/profile.d.ts.map +1 -1
  480. package/packages/server/dist/routes/profile.js +6 -3
  481. package/packages/server/dist/routes/profile.js.map +1 -1
  482. package/packages/server/dist/routes/providers.d.ts.map +1 -1
  483. package/packages/server/dist/routes/providers.js +66 -7
  484. package/packages/server/dist/routes/providers.js.map +1 -1
  485. package/packages/server/dist/routes/questions.d.ts +45 -0
  486. package/packages/server/dist/routes/questions.d.ts.map +1 -0
  487. package/packages/server/dist/routes/questions.js +73 -0
  488. package/packages/server/dist/routes/questions.js.map +1 -0
  489. package/packages/server/dist/routes/sessions.d.ts.map +1 -1
  490. package/packages/server/dist/routes/sessions.js +26 -6
  491. package/packages/server/dist/routes/sessions.js.map +1 -1
  492. package/packages/server/dist/routes/sleep.d.ts.map +1 -1
  493. package/packages/server/dist/routes/sleep.js +71 -2
  494. package/packages/server/dist/routes/sleep.js.map +1 -1
  495. package/packages/server/dist/routes/terminals.d.ts +25 -0
  496. package/packages/server/dist/routes/terminals.d.ts.map +1 -0
  497. package/packages/server/dist/routes/terminals.js +35 -0
  498. package/packages/server/dist/routes/terminals.js.map +1 -0
  499. package/packages/server/dist/routes/tools.d.ts.map +1 -1
  500. package/packages/server/dist/routes/tools.js +140 -6
  501. package/packages/server/dist/routes/tools.js.map +1 -1
  502. package/packages/server/dist/routes/updates.d.ts +10 -0
  503. package/packages/server/dist/routes/updates.d.ts.map +1 -0
  504. package/packages/server/dist/routes/updates.js +22 -0
  505. package/packages/server/dist/routes/updates.js.map +1 -0
  506. package/packages/server/dist/routes/ws.d.ts +11 -5
  507. package/packages/server/dist/routes/ws.d.ts.map +1 -1
  508. package/packages/server/dist/routes/ws.js +162 -28
  509. package/packages/server/dist/routes/ws.js.map +1 -1
  510. package/packages/server/dist/schemas.d.ts +1125 -211
  511. package/packages/server/dist/schemas.d.ts.map +1 -1
  512. package/packages/server/dist/schemas.js +300 -12
  513. package/packages/server/dist/schemas.js.map +1 -1
  514. package/packages/server/dist/server.d.ts +7 -1
  515. package/packages/server/dist/server.d.ts.map +1 -1
  516. package/packages/server/dist/server.js +186 -3
  517. package/packages/server/dist/server.js.map +1 -1
  518. package/packages/server/dist/services/stream.d.ts +89 -5
  519. package/packages/server/dist/services/stream.d.ts.map +1 -1
  520. package/packages/server/dist/services/stream.js +9 -20
  521. package/packages/server/dist/services/stream.js.map +1 -1
  522. package/packages/server/dist/services/stt.d.ts +65 -0
  523. package/packages/server/dist/services/stt.d.ts.map +1 -0
  524. package/packages/server/dist/services/stt.js +306 -0
  525. package/packages/server/dist/services/stt.js.map +1 -0
  526. package/packages/server/dist/services/turns.d.ts +49 -0
  527. package/packages/server/dist/services/turns.d.ts.map +1 -0
  528. package/packages/server/dist/services/turns.js +138 -0
  529. package/packages/server/dist/services/turns.js.map +1 -0
  530. package/packages/server/dist/services/updates.d.ts +99 -0
  531. package/packages/server/dist/services/updates.d.ts.map +1 -0
  532. package/packages/server/dist/services/updates.js +316 -0
  533. package/packages/server/dist/services/updates.js.map +1 -0
  534. package/packages/server/package.json +1 -1
  535. package/packages/web/dist/app-icon.svg +2 -0
  536. package/packages/web/dist/apple-touch-icon.png +0 -0
  537. package/packages/web/dist/assets/abnfDiagram-O67JEVCF-B4qWcqra.js +1 -0
  538. package/packages/web/dist/assets/arc-CQult7TN.js +1 -0
  539. package/packages/web/dist/assets/architectureDiagram-NJMV4G6O-DFTRvl66.js +36 -0
  540. package/packages/web/dist/assets/blockDiagram-BEXU5L5S-TCFoK_k-.js +140 -0
  541. package/packages/web/dist/assets/c4Diagram-YGBWAQC7-i5_GqhJa.js +38 -0
  542. package/packages/web/dist/assets/channel-D_4EmqNR.js +1 -0
  543. package/packages/web/dist/assets/chunk-2Q5K7J3B-BK6I2wfW.js +1 -0
  544. package/packages/web/dist/assets/chunk-3FUC2YCW-Dw-TfKT0.js +2 -0
  545. package/packages/web/dist/assets/chunk-5VM5RSS4-AE_XRNTT.js +15 -0
  546. package/packages/web/dist/assets/chunk-GTNCS2PH-DO18WaaJ.js +88 -0
  547. package/packages/web/dist/assets/chunk-GWA4HPMP-3rdjszP_.js +1 -0
  548. package/packages/web/dist/assets/chunk-JWPE2WC7-C93LH2D0.js +1 -0
  549. package/packages/web/dist/assets/chunk-NETBCI7D-Dj7O3-H-.js +1 -0
  550. package/packages/web/dist/assets/chunk-WEXAMYUT-BRFvQUIn.js +1 -0
  551. package/packages/web/dist/assets/chunk-XXDRQBXY-CXx6HMbz.js +1 -0
  552. package/packages/web/dist/assets/classDiagram-v2-NBCMYWYE-BGXszxjn.js +217 -0
  553. package/packages/web/dist/assets/cose-bilkent-JH36ORCC-BAuXqkne.js +1 -0
  554. package/packages/web/dist/assets/cynefin-OW5HDTMX-plNzhY7J.js +178 -0
  555. package/packages/web/dist/assets/cynefinDiagram-VND7K2PF-DuPlljFS.js +62 -0
  556. package/packages/web/dist/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
  557. package/packages/web/dist/assets/dagre-6A5THRUB-CXzwdR-6.js +4 -0
  558. package/packages/web/dist/assets/diagram-22UHCM2B-B7iv_V2D.js +200 -0
  559. package/packages/web/dist/assets/diagram-3UASUU5V-BMvi7gSi.js +24 -0
  560. package/packages/web/dist/assets/diagram-ATOU4E4O-NJ7EB5Qg.js +3 -0
  561. package/packages/web/dist/assets/diagram-CDSNMT55-DccMMNJ-.js +30 -0
  562. package/packages/web/dist/assets/diagram-MLGK6HIB-BbwGHK4g.js +24 -0
  563. package/packages/web/dist/assets/diagram-MPIPVDR6-BbSSZfM3.js +41 -0
  564. package/packages/web/dist/assets/draco_decoder-C32yEggz.wasm +0 -0
  565. package/packages/web/dist/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
  566. package/packages/web/dist/assets/draco_decoder-fzg4nYZr.js +34 -0
  567. package/packages/web/dist/assets/draco_wasm_wrapper-DxJM36Ib.js +117 -0
  568. package/packages/web/dist/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
  569. package/packages/web/dist/assets/ebnfDiagram-ZINNZB2B-BBfPNM85.js +1 -0
  570. package/packages/web/dist/assets/elk-276RUBZZ-dM3Y1d2a.js +27 -0
  571. package/packages/web/dist/assets/erDiagram-OPXOYQCR-iWrUegxy.js +99 -0
  572. package/packages/web/dist/assets/flowDiagram-KWPJA3E3-B6DYlbkV.js +213 -0
  573. package/packages/web/dist/assets/ganttDiagram-FUAMR5RP-D7dSWZcC.js +292 -0
  574. package/packages/web/dist/assets/gitGraphDiagram-X574FWY7-DguFgcbW.js +106 -0
  575. package/packages/web/dist/assets/graph-Bn3Yngep.js +1 -0
  576. package/packages/web/dist/assets/index-B1QvSHA5.js +660 -0
  577. package/packages/web/dist/assets/index-zwMuaz90.css +32 -0
  578. package/packages/web/dist/assets/infoDiagram-VRGFBTTK-CuiuO3uo.js +2 -0
  579. package/packages/web/dist/assets/ishikawaDiagram-OU5B5YK6-wBS1_40m.js +70 -0
  580. package/packages/web/dist/assets/journeyDiagram-ZHPQQLJL-Bd1YE2gP.js +139 -0
  581. package/packages/web/dist/assets/kanban-definition-PNTS6WVX-BlQzv_X1.js +89 -0
  582. package/packages/web/dist/assets/katex-C5jXJg4s.js +257 -0
  583. package/packages/web/dist/assets/mermaid.core-p3CwmLUb.js +313 -0
  584. package/packages/web/dist/assets/mindmap-definition-NLK3R4M7-BlticnKl.js +96 -0
  585. package/packages/web/dist/assets/pegDiagram-GJSIUBJH-BbXsP47B.js +1 -0
  586. package/packages/web/dist/assets/pieDiagram-5QR66LMP-BooBSBug.js +39 -0
  587. package/packages/web/dist/assets/quadrantDiagram-O4NWA36T-CkXC6VCh.js +7 -0
  588. package/packages/web/dist/assets/railroadDiagram-XR7U4H2S-BphzYiW-.js +1 -0
  589. package/packages/web/dist/assets/requirementDiagram-PLB6GJNP-PWpD4zpQ.js +84 -0
  590. package/packages/web/dist/assets/sankeyDiagram-IPEJSGJF-5Qm39Vfz.js +40 -0
  591. package/packages/web/dist/assets/scene-D4LPicHk.js +4620 -0
  592. package/packages/web/dist/assets/sequenceDiagram-PO4LG4MO-DA673J_w.js +169 -0
  593. package/packages/web/dist/assets/sizeCapture-INFHLROL-1KsNwBhd.js +1 -0
  594. package/packages/web/dist/assets/stateDiagram-v2-GCMORJYK-D7O0UyHr.js +291 -0
  595. package/packages/web/dist/assets/swimlanes-2SLR337P-culFSb1R.js +1 -0
  596. package/packages/web/dist/assets/swimlanesDiagram-TC7HE7FX-kzTmK2BP.js +8 -0
  597. package/packages/web/dist/assets/timeline-definition-EJHVYXUP-6GIO5p-k.js +120 -0
  598. package/packages/web/dist/assets/usecaseDiagram-POWQR4AR-BAGHDBzZ.js +370 -0
  599. package/packages/web/dist/assets/vennDiagram-UO4OBE2U-PbtBvPRE.js +34 -0
  600. package/packages/web/dist/assets/wardleyDiagram-VNRHLVJA-9scbtDvX.js +78 -0
  601. package/packages/web/dist/assets/xychartDiagram-PMCCYNJV-C51PiF4p.js +7 -0
  602. package/packages/web/dist/draco/draco_decoder.js +33 -0
  603. package/packages/web/dist/draco/draco_decoder.wasm +0 -0
  604. package/packages/web/dist/draco/draco_wasm_wrapper.js +116 -0
  605. package/packages/web/dist/favicon-16.png +0 -0
  606. package/packages/web/dist/favicon-32.png +0 -0
  607. package/packages/web/dist/favicon-48.png +0 -0
  608. package/packages/web/dist/favicon.ico +0 -0
  609. package/packages/web/dist/favicon.svg +1 -1
  610. package/packages/web/dist/icon-192.png +0 -0
  611. package/packages/web/dist/icon-512.png +0 -0
  612. package/packages/web/dist/index.html +12 -4
  613. package/packages/web/dist/logo-light.svg +1 -1
  614. package/packages/web/dist/logo-mono.svg +2 -0
  615. package/packages/web/dist/logo-stacked-light.svg +2 -0
  616. package/packages/web/dist/logo-stacked.svg +2 -0
  617. package/packages/web/dist/logo-white.svg +2 -0
  618. package/packages/web/dist/logo.svg +1 -1
  619. package/packages/web/dist/mark-light.svg +1 -1
  620. package/packages/web/dist/mark-mono.svg +2 -0
  621. package/packages/web/dist/mark-small-light.svg +2 -0
  622. package/packages/web/dist/mark-small.svg +2 -0
  623. package/packages/web/dist/mark-white.svg +2 -0
  624. package/packages/web/dist/mark.svg +1 -1
  625. package/packages/web/dist/models/LICENSE.txt +5 -0
  626. package/packages/web/dist/models/brain.glb +0 -0
  627. package/packages/web/dist/site.webmanifest +23 -0
  628. package/packages/web/dist/wordmark-light.svg +2 -0
  629. package/packages/web/dist/wordmark.svg +2 -0
  630. package/packages/web/package.json +1 -1
  631. package/scripts/rookery.mjs +204 -122
  632. package/scripts/updater.mjs +227 -0
  633. package/packages/cli/dist/tui/components/Wordmark.d.ts +0 -35
  634. package/packages/cli/dist/tui/components/Wordmark.d.ts.map +0 -1
  635. package/packages/cli/dist/tui/components/Wordmark.js +0 -81
  636. package/packages/cli/dist/tui/components/Wordmark.js.map +0 -1
  637. package/packages/core/dist/agents/orchestrator.d.ts +0 -24
  638. package/packages/core/dist/agents/orchestrator.d.ts.map +0 -1
  639. package/packages/core/dist/agents/orchestrator.js +0 -88
  640. package/packages/core/dist/agents/orchestrator.js.map +0 -1
  641. package/packages/core/dist/agents/roles.d.ts +0 -21
  642. package/packages/core/dist/agents/roles.d.ts.map +0 -1
  643. package/packages/core/dist/agents/roles.js +0 -81
  644. package/packages/core/dist/agents/roles.js.map +0 -1
  645. package/packages/core/dist/agents/team.d.ts +0 -105
  646. package/packages/core/dist/agents/team.d.ts.map +0 -1
  647. package/packages/core/dist/agents/team.js +0 -623
  648. package/packages/core/dist/agents/team.js.map +0 -1
  649. package/packages/core/dist/providers/codex.d.ts +0 -10
  650. package/packages/core/dist/providers/codex.d.ts.map +0 -1
  651. package/packages/core/dist/providers/codex.js +0 -375
  652. package/packages/core/dist/providers/codex.js.map +0 -1
  653. package/packages/core/dist/tools/browser.d.ts +0 -20
  654. package/packages/core/dist/tools/browser.d.ts.map +0 -1
  655. package/packages/core/dist/tools/browser.js +0 -72
  656. package/packages/core/dist/tools/browser.js.map +0 -1
  657. package/packages/server/dist/routes/agents.d.ts +0 -5
  658. package/packages/server/dist/routes/agents.d.ts.map +0 -1
  659. package/packages/server/dist/routes/agents.js +0 -6
  660. package/packages/server/dist/routes/agents.js.map +0 -1
  661. package/packages/server/dist/routes/team.d.ts +0 -11
  662. package/packages/server/dist/routes/team.d.ts.map +0 -1
  663. package/packages/server/dist/routes/team.js +0 -36
  664. package/packages/server/dist/routes/team.js.map +0 -1
  665. package/packages/web/dist/assets/3d-force-graph-BPZmoydi.js +0 -1163
  666. package/packages/web/dist/assets/index-IBSTzK7-.js +0 -1255
  667. package/packages/web/dist/assets/index-qUXUui7W.css +0 -1
  668. package/packages/web/dist/assets/three-spritetext-B9ZIW7c-.js +0 -4
  669. package/packages/web/dist/assets/three.module-cmFfBtHS.js +0 -4228
@@ -1,11 +1,12 @@
1
- import type { Agent, AgentMessage, Assignment, CronJob, Message, Organization, Project, RookeryConfig, ScoredMemory, Task, Team } from '../types.js';
1
+ import type { Agent, AgentMessage, Assignment, CronJob, Mail, Organization, Project, RookeryConfig, ScoredMemory, Task, Team } from '../types.js';
2
2
  import type { OrgStore } from './store.js';
3
+ import type { Store } from '../memory/store.js';
3
4
  /**
4
5
  * Prompt text for the organisation.
5
6
  *
6
7
  * Two kinds of prompt come out of here. The assistant's turn gets a block
7
8
  * describing the company it runs and how to use its tools; it is appended to
8
- * the ordinary identity prompt. An agent's assignment gets a complete system
9
+ * the ordinary identity prompt. An agent's run gets a complete system
9
10
  * prompt of its own, pointedly not built on the assistant's identity: an
10
11
  * agent is a member of staff, and its notes must never read like the
11
12
  * assistant speaking to the user.
@@ -16,18 +17,27 @@ export interface OrgSnapshot {
16
17
  teams: Team[];
17
18
  agents: Agent[];
18
19
  projects: Project[];
19
- /** Assignments currently pending or running. */
20
+ /** Runs currently pending or running. */
20
21
  active: Assignment[];
21
22
  }
22
- /** The org chart as plain text, shared by the overview tool and the prompts. */
23
- export declare function renderOrgOverview(snapshot: OrgSnapshot): string;
23
+ /**
24
+ * The org chart as plain text, shared by the overview tool and the prompts.
25
+ *
26
+ * `org` is optional and only buys the run numbers: without it a running piece
27
+ * of work still has its name, which is the part that makes the list readable.
28
+ */
29
+ export declare function renderOrgOverview(snapshot: OrgSnapshot, org?: OrgStore): string;
24
30
  /** Inbox lines for a prompt; empty string when there is nothing unread. */
25
31
  export declare function renderInbox(messages: AgentMessage[], snapshot: OrgSnapshot, heading: string): string;
32
+ /** Who sent one mail, as a prompt says it: an agent's slug, or "user"/"assistant". */
33
+ export declare function mailSender(mail: Mail, snapshot: OrgSnapshot): string;
34
+ /** Mail lines for a prompt or a read_mail reply; empty string when there is none. */
35
+ export declare function renderMail(mail: Mail[], snapshot: OrgSnapshot, heading: string, bodyChars?: number): string;
26
36
  /**
27
37
  * The block appended to the assistant's identity prompt: what it runs, how
28
38
  * to delegate, and what arrived in its inbox since the last turn.
29
39
  */
30
- export declare function assistantOrgBlock(config: RookeryConfig, snapshot: OrgSnapshot, inbox: AgentMessage[], activeProject?: Project, schedules?: CronJob[]): string;
40
+ export declare function assistantOrgBlock(config: RookeryConfig, snapshot: OrgSnapshot, mail: Mail[], activeProject?: Project, schedules?: CronJob[], store?: Store): string;
31
41
  /** The schedules, one line each, as the assistant's prompt and the list tool show them. */
32
42
  export declare function renderSchedules(schedules: CronJob[], snapshot: OrgSnapshot): string;
33
43
  export interface AgentPromptInput {
@@ -36,36 +46,39 @@ export interface AgentPromptInput {
36
46
  snapshot: OrgSnapshot;
37
47
  project?: Project;
38
48
  memories: ScoredMemory[];
39
- inbox: AgentMessage[];
49
+ mail: Mail[];
40
50
  assignmentId: string;
41
- /** Who gave the assignment, for the prompt's sense of the chain of command. */
51
+ /** Who asked for the work, for the prompt's sense of the chain of command. */
42
52
  requestedBy: string;
53
+ /** Set when this run came from mail: its subject, for the reply paragraph below. */
54
+ sourceMailSubject?: string;
55
+ /** That mail's id and thread, so the prompt can point at the history instead of carrying it. */
56
+ sourceMailId?: string;
57
+ sourceMailThreadId?: string;
58
+ /** The rest of that mail's thread, oldest first - listed as an index, not in full. */
59
+ sourceMailThread?: Mail[];
43
60
  /** One paragraph per tool server attached to this run, from the hub. */
44
61
  toolHints?: string[];
45
62
  /** The skills index, when there are skills for agents. */
46
63
  skillsIndex?: string;
64
+ /**
65
+ * Development feedback written since the last reconfig (decision E2): no
66
+ * number, no dimension name and no reference to being reviewed ever
67
+ * reaches this far - only the qualitative note itself. Newest first,
68
+ * at most two shown.
69
+ */
70
+ agentNotes?: {
71
+ note: string;
72
+ createdAt: number;
73
+ }[];
74
+ /** Set only for a successor agent: who it replaced, and the condensed handover (decision E3). */
75
+ handoverFrom?: {
76
+ predecessorName: string;
77
+ text: string;
78
+ };
47
79
  }
48
- /** The complete system prompt for one agent running one assignment. */
80
+ /** The complete system prompt for one agent carrying out one task. */
49
81
  export declare function buildAgentPrompt(input: AgentPromptInput): string;
50
82
  /** The board as the assistant reads it. */
51
83
  export declare function renderBoard(tasks: Task[], snapshot: OrgSnapshot, store: OrgStore): string;
52
- export interface AgentChatPromptInput {
53
- config: RookeryConfig;
54
- agent: Agent;
55
- snapshot: OrgSnapshot;
56
- memories: ScoredMemory[];
57
- inbox: AgentMessage[];
58
- history?: Message[];
59
- resumed: boolean;
60
- project?: Project;
61
- toolHints?: string[];
62
- skillsIndex?: string;
63
- }
64
- /**
65
- * The system prompt for a direct conversation between the user and one
66
- * agent - a direct message in the company chat. The agent speaks as itself,
67
- * knows its place in the company, and may hand work to its reports, but it
68
- * is not the assistant and does not pretend to be.
69
- */
70
- export declare function buildAgentChatPrompt(input: AgentChatPromptInput): string;
71
84
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/org/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,IAAI,EACL,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C;;;;;;;;;GASG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gDAAgD;IAChD,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAKD,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAqD/D;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQpG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,YAAY,EAAE,EACrB,aAAa,CAAC,EAAE,OAAO,EACvB,SAAS,GAAE,OAAO,EAAO,GACxB,MAAM,CAqDR;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,CAKnF;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CA6EhE;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAiBzF;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CA4DxE"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/org/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,OAAO,EAEP,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,IAAI,EACL,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAOhD;;;;;;;;;GASG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAgCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,MAAM,CA4D/E;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQpG;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,CAGpE;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAexG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,IAAI,EAAE,EACZ,aAAa,CAAC,EAAE,OAAO,EACvB,SAAS,GAAE,OAAO,EAAO,EACzB,KAAK,CAAC,EAAE,KAAK,GACZ,MAAM,CAsFR;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,CAKnF;AA4BD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1B,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,iGAAiG;IACjG,YAAY,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CA4LhE;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAyBzF"}
@@ -2,9 +2,43 @@ import { renderMemoryBlock } from '../memory/recall.js';
2
2
  import { PONYTAIL_RULESET } from './ponytail.js';
3
3
  import { describeCronJob } from '../cron/scheduler.js';
4
4
  import { clip, shorten } from '../util/queue.js';
5
+ import { formatAge, formatNow } from '../util/time.js';
6
+ /** How many of a thread's mails a continued run reads without asking (F4). */
7
+ const THREAD_TAIL_MAILS = 2;
8
+ /** And how much of each of them. */
9
+ const THREAD_TAIL_CHARS = 4000;
5
10
  const agentById = (snapshot) => new Map(snapshot.agents.map((agent) => [agent.id, agent]));
6
- /** The org chart as plain text, shared by the overview tool and the prompts. */
7
- export function renderOrgOverview(snapshot) {
11
+ /**
12
+ * Voices of one agent's own team and manager only - never the whole company
13
+ * (decision E13, section 6.4): a company of twenty would otherwise carry
14
+ * nineteen irrelevant voice descriptions into every single run. An agent
15
+ * with no voice set contributes no line here at all; that is the silent,
16
+ * neutral default (F5), not something worth naming as absent.
17
+ */
18
+ function renderColleagueVoices(agent, snapshot) {
19
+ const byId = agentById(snapshot);
20
+ const manager = agent.managerId ? byId.get(agent.managerId) : undefined;
21
+ const teammates = agent.teamId
22
+ ? snapshot.agents.filter((entry) => entry.teamId === agent.teamId && entry.id !== agent.id)
23
+ : [];
24
+ const lines = [];
25
+ if (manager?.voice)
26
+ lines.push('- ' + manager.slug + ' (your manager): ' + manager.voice);
27
+ for (const mate of teammates) {
28
+ if (mate.voice)
29
+ lines.push('- ' + mate.slug + ' (your team): ' + mate.voice);
30
+ }
31
+ if (!lines.length)
32
+ return '';
33
+ return 'How your manager and team write, so mail from or about them reads like them:\n' + lines.join('\n');
34
+ }
35
+ /**
36
+ * The org chart as plain text, shared by the overview tool and the prompts.
37
+ *
38
+ * `org` is optional and only buys the run numbers: without it a running piece
39
+ * of work still has its name, which is the part that makes the list readable.
40
+ */
41
+ export function renderOrgOverview(snapshot, org) {
8
42
  const byId = agentById(snapshot);
9
43
  const teamName = new Map(snapshot.teams.map((team) => [team.id, team.name]));
10
44
  const lines = [];
@@ -41,10 +75,15 @@ export function renderOrgOverview(snapshot) {
41
75
  }
42
76
  if (snapshot.active.length) {
43
77
  lines.push('');
44
- lines.push('Running assignments:');
78
+ lines.push('Running now:');
45
79
  for (const assignment of snapshot.active) {
46
80
  const agent = byId.get(assignment.agentId);
47
- lines.push('- ' + assignment.id.slice(0, 8) + ' ' + (agent?.slug ?? '?') + ': ' + clip(assignment.task, 120));
81
+ // The name, not the first 120 characters of the brief: three errands
82
+ // for the same agent open with the same twenty words, and a list of
83
+ // those tells nobody which is which (concept 7.1).
84
+ const run = org?.taskRunNumber(assignment.id) ?? null;
85
+ lines.push('- ' + assignment.id.slice(0, 8) + ' ' + (agent?.slug ?? '?') + ': ' + shorten(assignment.title, 120) +
86
+ (run && run > 1 ? ' (run ' + run + ')' : ''));
48
87
  }
49
88
  }
50
89
  return lines.join('\n');
@@ -60,35 +99,64 @@ export function renderInbox(messages, snapshot, heading) {
60
99
  });
61
100
  return heading + '\n' + lines.join('\n');
62
101
  }
102
+ /** Who sent one mail, as a prompt says it: an agent's slug, or "user"/"assistant". */
103
+ export function mailSender(mail, snapshot) {
104
+ if (mail.fromKind !== 'agent')
105
+ return mail.fromKind;
106
+ return (mail.fromAgentId ? agentById(snapshot).get(mail.fromAgentId)?.slug : undefined) ?? 'unknown agent';
107
+ }
108
+ /** Mail lines for a prompt or a read_mail reply; empty string when there is none. */
109
+ export function renderMail(mail, snapshot, heading, bodyChars = 600) {
110
+ if (!mail.length)
111
+ return '';
112
+ const byId = agentById(snapshot);
113
+ const who = (kind, id) => kind === 'agent' ? (id ? (byId.get(id)?.slug ?? 'unknown agent') : 'unknown agent') : kind;
114
+ const lines = mail.map((entry) => {
115
+ const from = who(entry.fromKind, entry.fromAgentId);
116
+ const to = entry.recipients.filter((r) => r.box === 'to').map((r) => who(r.recipientKind, r.recipientId)).join(', ');
117
+ const cc = entry.recipients.filter((r) => r.box === 'cc').map((r) => who(r.recipientKind, r.recipientId)).join(', ');
118
+ return ('- [' + entry.id.slice(0, 8) + '] from ' + from + ' to ' + (to || '-') + (cc ? ', cc ' + cc : '') +
119
+ ' - subject: ' + entry.subject + '\n ' + clip(entry.body, bodyChars));
120
+ });
121
+ return heading + '\n' + lines.join('\n');
122
+ }
63
123
  /**
64
124
  * The block appended to the assistant's identity prompt: what it runs, how
65
125
  * to delegate, and what arrived in its inbox since the last turn.
66
126
  */
67
- export function assistantOrgBlock(config, snapshot, inbox, activeProject, schedules = []) {
127
+ export function assistantOrgBlock(config, snapshot, mail, activeProject, schedules = [], store) {
68
128
  const sections = [];
69
129
  sections.push([
70
130
  'As the personal assistant described in your saved profile, you run a small company of AI agents on their behalf.',
71
- 'The agents are permanent staff with roles and their own memory; every assignment you give',
131
+ 'The agents are permanent staff with roles and their own memory; every task you hand',
72
132
  'one runs as a separate process in the background, in the project directory when the project',
73
- 'has one. The rookery tools are yours: `assign` hands a task to one agent and returns the',
74
- 'report (several `assign` calls in one message run in parallel); `create_task`, `plan_task`',
133
+ 'has one. The rookery tools are yours: `assign` hands a task to one agent, puts it on the',
134
+ 'board and returns the report (several `assign` calls in one message run in parallel);',
135
+ '`create_task`, `plan_task`',
75
136
  'and `run_task` put bigger work on the board, decide who does it or how to split it, and',
76
137
  'execute it; `hire_agent`, `update_agent`, `create_team`, `update_team`, `create_project` and',
77
138
  '`update_project` shape the company when the user asks or when a job clearly needs a role',
78
139
  'nobody holds. `list_assignments` is the history of what ran; `cancel_assignment` stops a',
79
- 'stuck or unwanted one, and `update_task` with status "cancelled" stops a running task.',
140
+ 'stuck or unwanted run, and `update_task` with status "cancelled" stops a running task.',
141
+ 'Everything that gets worked on is a task: it has a card on the board and the mail thread it',
142
+ 'is discussed in, and those are two sides of one thing rather than two places to look.',
143
+ 'Name every task you create: three to eight words, no full stop, a noun phrase or an',
144
+ 'imperative, in the language of the brief - never the brief itself pasted into the title.',
145
+ 'A task whose run ended with a question to whoever asked for it is set to "blocked" by itself',
146
+ 'and waits there; the next mail in its thread carries it on, and you may set that status by hand.',
80
147
  '`remember`, `forget` and `search_memory` are your long-term memory of the user;',
81
148
  '`get_settings` and `update_settings` are the defaults and limits you work under.',
82
149
  '`create_schedule`, `list_schedules`, `update_schedule`, `delete_schedule` and `run_schedule`',
83
150
  'are your schedules (cron jobs): standing orders that fire on a timetable without anyone',
84
- 'asking - a turn of your own in a conversation dedicated to the job, or an assignment to an',
85
- 'agent - with the outcome posted to your inbox. Use them whenever the user wants something',
86
- 'regularly ("every morning at 8", "on Fridays") or at a later time ("tomorrow at 15:00", once).',
151
+ 'asking - a turn of your own in a fresh conversation, or a task for an agent - with the',
152
+ 'outcome posted to your inbox. Use them whenever the user wants something regularly ("every',
153
+ 'morning at 8", "on Fridays") or at a later time ("tomorrow at 15:00", once).',
87
154
  'Turn what they say into a cron expression yourself and confirm the time in words.',
155
+ 'A scheduled run of your own always ends with that "completed" note in the inbox, unless the',
156
+ 'run itself already delivered the result to the user - a mail you sent them as the point of the',
157
+ 'job. In that case end the turn with exactly [SILENT] instead of a report, or the user gets the',
158
+ 'same thing twice: the mail the job exists to send, and a second mail just saying it ran.',
88
159
  'Nothing here needs permission from anyone: you own the company and its machinery.',
89
- 'Two words to keep apart when you talk to the user: an assignment is',
90
- 'one agent running one brief, with a result; a task is an item on the',
91
- 'board that gets planned and then executed as one or more assignments.',
92
160
  'Delegate real work - code, research, analysis, long writing - instead of doing it here;',
93
161
  'you have no project files in this conversation.',
94
162
  'Most turns are not work at all. Small talk, questions about the user, their day or their',
@@ -97,17 +165,39 @@ export function assistantOrgBlock(config, snapshot, inbox, activeProject, schedu
97
165
  'When you delegated, report the outcome in your own identity and words; never narrate',
98
166
  'tool mechanics.',
99
167
  ].join(' '));
100
- sections.push(renderOrgOverview(snapshot));
168
+ sections.push([
169
+ 'Company mail is how everyone here talks to everyone else, and how you reach the user when no',
170
+ 'conversation is running. `send_mail` writes to an agent, to "user", or to several at once;',
171
+ '`read_mail` and `read_mail_thread` are your side of it. Mail with an agent on To hands them the',
172
+ 'work and its report comes back to you as a reply; Cc only delivers. Use `assign` when you need',
173
+ 'the result inside this turn, and mail when you do not have to wait for it - the same task',
174
+ 'either way, on the same board.',
175
+ 'Write to the user by mail when you are the one starting it: a finished piece of work, a report',
176
+ 'they asked for, a decision only they can make. Answering a mail that arrived for you works the',
177
+ 'other way round - the answer is what you write in that turn, it goes back as the reply on its',
178
+ 'own, and a send_mail carrying the same thing delivers it twice.',
179
+ 'A mail to the user also reaches their phone',
180
+ 'through whatever channel is connected, so it is a real message and not a note left in a drawer -',
181
+ 'say the thing and stop; never mail them a running commentary on what the company is doing.',
182
+ '`notify` is not a second mailbox: it is the one line that has to arrive now, and everything',
183
+ 'that can be read later is mail.',
184
+ ].join(' '));
185
+ sections.push(renderOrgOverview(snapshot, store?.org));
186
+ if (store) {
187
+ const flags = renderPerformanceFlags(snapshot, store.org);
188
+ if (flags)
189
+ sections.push(flags);
190
+ }
101
191
  if (activeProject) {
102
192
  sections.push('Active project for this conversation: ' + activeProject.name +
103
193
  (activeProject.path ? ' at ' + activeProject.path : ' (no directory)') +
104
- '. Assignments default to it.');
194
+ '. Work you hand out defaults to it.');
105
195
  }
106
196
  if (schedules.length)
107
197
  sections.push(renderSchedules(schedules, snapshot));
108
- const inboxBlock = renderInbox(inbox, snapshot, 'New messages from your staff since last time:');
109
- if (inboxBlock)
110
- sections.push(inboxBlock);
198
+ const mailBlock = renderMail(mail, snapshot, 'Mail waiting for you:');
199
+ if (mailBlock)
200
+ sections.push(mailBlock);
111
201
  return sections.join('\n\n');
112
202
  }
113
203
  /** The schedules, one line each, as the assistant's prompt and the list tool show them. */
@@ -118,7 +208,31 @@ export function renderSchedules(schedules, snapshot) {
118
208
  const lines = schedules.map((job) => describeCronJob(job, job.agentId ? byId.get(job.agentId)?.slug : undefined));
119
209
  return 'Your schedules (cron jobs, local time):\n' + lines.join('\n');
120
210
  }
121
- /** The complete system prompt for one agent running one assignment. */
211
+ /**
212
+ * One line per agent at escalation stage >= 1 (agent-performance-
213
+ * management, section 5): the point is that Jarvis brings this up on its
214
+ * own turn rather than waiting to be asked. Empty string when nobody is
215
+ * flagged, so a healthy company adds nothing to the prompt.
216
+ */
217
+ function renderPerformanceFlags(snapshot, org) {
218
+ const lines = [];
219
+ for (const agent of snapshot.agents) {
220
+ const performance = org.performance(agent.id);
221
+ if (performance.stage === 0)
222
+ continue;
223
+ const detail = performance.stage === 1
224
+ ? 'flagged, a development note is on record'
225
+ : performance.stage === 2
226
+ ? 'reconfigured, on probation'
227
+ : 'reconfigured twice, a replacement has been proposed - awaiting your decision';
228
+ lines.push('- ' + agent.slug + ': stage ' + performance.stage + ' (' + detail + ')' +
229
+ (performance.average !== null ? ', average ' + performance.average.toFixed(1) : ''));
230
+ }
231
+ if (!lines.length)
232
+ return '';
233
+ return 'Staff performance needing your attention (agent_performance for detail):\n' + lines.join('\n');
234
+ }
235
+ /** The complete system prompt for one agent carrying out one task. */
122
236
  export function buildAgentPrompt(input) {
123
237
  const { agent, snapshot, config } = input;
124
238
  const byId = agentById(snapshot);
@@ -126,6 +240,10 @@ export function buildAgentPrompt(input) {
126
240
  const manager = agent.managerId ? byId.get(agent.managerId) : undefined;
127
241
  const reports = snapshot.agents.filter((entry) => entry.managerId === agent.id);
128
242
  const sections = [];
243
+ // A run answers as a letter only when it was born from mail and the
244
+ // company has roleplay switched on (decision E10/E14, F6); a run started
245
+ // by `assign` keeps today's report register unconditionally.
246
+ const letterRegister = Boolean(input.sourceMailSubject) && config.org.roleplay;
129
247
  sections.push([
130
248
  'You are ' + agent.name + ', ' + agent.title + ' at ' + snapshot.organization.name + ',',
131
249
  'a company of AI agents run by the assistant ' + (config.assistantName || 'Rookery') + '.',
@@ -137,11 +255,37 @@ export function buildAgentPrompt(input) {
137
255
  ? 'Your direct reports: ' + reports.map((entry) => entry.slug + ' (' + entry.title + ')').join(', ') +
138
256
  '. You may hand them parts of your work with the assign tool.'
139
257
  : 'You have no reports; do the work yourself.',
140
- 'This assignment (' + input.assignmentId.slice(0, 8) + ') was given to you by ' + input.requestedBy + '.',
258
+ 'This task (' + input.assignmentId.slice(0, 8) + ') was given to you by ' + input.requestedBy + '.',
141
259
  ]
142
260
  .filter(Boolean)
143
261
  .join(' '));
144
262
  sections.push('Your standing instructions:\n' + agent.instructions);
263
+ const colleagueVoices = renderColleagueVoices(agent, snapshot);
264
+ if (colleagueVoices)
265
+ sections.push(colleagueVoices);
266
+ // Mail is the company's only channel between colleagues, so the prompt
267
+ // says who to write to rather than leaving `send_mail` as a tool nobody
268
+ // reaches for. The lead sentence is the reason the user's phone stays
269
+ // quiet: a team speaks to them through one agent, not five.
270
+ sections.push([
271
+ 'Company mail is how people here reach each other. `send_mail` writes to a colleague by slug, to',
272
+ 'your manager, to "assistant" or to "user"; `read_mail` and `read_mail_thread` are your side of',
273
+ 'it. Mail with a colleague on To starts a real run of theirs and their answer comes back as a',
274
+ 'reply, so it is how you ask somebody for something you do not have to sit and wait for; Cc only',
275
+ 'delivers, for keeping somebody in the picture. Use it: a question for whoever knows the system,',
276
+ 'a heads-up that changes their plans, a hand-off of work that is not yours. What it is not for is a',
277
+ 'mail whose entire content is politeness - if there is nothing in it beyond a thank-you, do not send',
278
+ 'it, because every mail you send costs somebody a run. A mail that has something to say may say it',
279
+ 'in whatever tone fits; that cost is about content, not about tone.',
280
+ team && team.leadId === agent.id
281
+ ? 'You lead ' + team.name + ': your team reaches the user through you, so what the team has to ' +
282
+ 'tell them is yours to write - one mail with the whole picture, not one per person.'
283
+ : 'Write to the user only when the work was theirs to begin with or nobody else can answer; ' +
284
+ 'otherwise it goes to your manager, your team lead or the assistant, who decides what ' +
285
+ 'reaches them.',
286
+ ]
287
+ .filter(Boolean)
288
+ .join(' '));
145
289
  // How the work gets done, below the role and above the task: the agent's
146
290
  // own instructions still win, because they were written for this job.
147
291
  if (config.org.lazyCoding)
@@ -159,13 +303,62 @@ export function buildAgentPrompt(input) {
159
303
  const memoryBlock = renderMemoryBlock(input.memories, Math.floor(config.memory.contextBudget * 0.4), 'your work');
160
304
  if (memoryBlock)
161
305
  sections.push(memoryBlock);
162
- const inboxBlock = renderInbox(input.inbox, snapshot, 'Messages waiting for you:');
163
- if (inboxBlock)
164
- sections.push(inboxBlock);
306
+ const mailBlock = renderMail(input.mail, snapshot, 'Mail waiting for you:');
307
+ if (mailBlock)
308
+ sections.push(mailBlock);
165
309
  for (const hint of input.toolHints ?? [])
166
310
  sections.push(hint);
167
311
  if (input.skillsIndex)
168
312
  sections.push(input.skillsIndex);
313
+ if (input.sourceMailSubject) {
314
+ // Most of the thread stays out of the prompt: a long conversation would
315
+ // cost more context than most mails need. What goes in is the index and
316
+ // where to get the rest, so the agent pays for the history only when it
317
+ // reads it - plus the last two mails at length, because a run that
318
+ // continues a thread almost always turns on what was said last, and
319
+ // making it fetch that costs a tool call every time (F4).
320
+ const earlier = input.sourceMailThread ?? [];
321
+ if (earlier.length && input.sourceMailThreadId) {
322
+ // With the id: eight replies in one thread share almost the same
323
+ // subject, and without it there is no way to name one of them.
324
+ const index = earlier
325
+ .map((entry) => '- [' + entry.id.slice(0, 8) + '] ' + mailSender(entry, snapshot) + ': ' + entry.subject)
326
+ .join('\n');
327
+ sections.push('Earlier in this mail thread (' + earlier.length + ' mail(s) you sent or were To/Cc on), subjects only:\n' +
328
+ index + '\nRead the full text with read_mail_thread("' + input.sourceMailThreadId + '") when the answer ' +
329
+ 'depends on it.');
330
+ const recent = earlier.slice(-THREAD_TAIL_MAILS);
331
+ sections.push(renderMail(recent, snapshot, 'The last of those, at length:', THREAD_TAIL_CHARS));
332
+ }
333
+ // Decision E10 (section 6.3): the same text stays `assignment.result` -
334
+ // no second model call, no rewrite, no marker in it for anybody to
335
+ // parse. Only the instruction changes which register that one text is
336
+ // written in. Off, or born from `assign` rather than mail, this is
337
+ // always the plain paragraph below, unchanged from before roleplay
338
+ // existed (F6).
339
+ if (letterRegister) {
340
+ sections.push([
341
+ 'This task arrived as an email from ' + input.requestedBy + ', subject "' + input.sourceMailSubject + '".',
342
+ "It goes back as the reply's body automatically, and everyone who was Cc on their mail stays Cc on",
343
+ 'yours. Do not send_mail the same answer to them on top of it; that tool is for bringing in',
344
+ 'somebody who was not on the thread.',
345
+ 'Write it as a letter to a colleague, not a report: a short salutation, one sentence of context,',
346
+ 'the result, a stance on it, and a sign-off' +
347
+ (agent.voice ? ', in your own voice: ' + agent.voice : ', in a plain, neutral voice') + '.',
348
+ 'The result stands in the first paragraph; politeness frames it and never postpones it - a letter',
349
+ 'where the reader has to hunt for the answer is worse than the report it replaces. No invented',
350
+ 'private life, no weekends, no coffee breaks; no played delay and no "I will look at that shortly"',
351
+ 'without work already done behind it - a run either did the work or it is answering, never',
352
+ 'pretending to be about to. Write in the language the task is written in.',
353
+ ].join(' '));
354
+ }
355
+ else {
356
+ sections.push('This task arrived as an email from ' + input.requestedBy + ', subject "' + input.sourceMailSubject + '". ' +
357
+ "Write your result as the reply's body, not a chat answer or a report - it goes back to them " +
358
+ 'automatically, and everyone who was Cc on their mail stays Cc on yours. Do not send_mail the ' +
359
+ 'same answer to them on top of it; send_mail is for bringing in somebody who was not on the thread.');
360
+ }
361
+ }
169
362
  // The assistant is told not to accept dead ends; an agent that reports
170
363
  // "not possible" after one attempt would hand it one anyway.
171
364
  sections.push([
@@ -173,17 +366,38 @@ export function buildAgentPrompt(input) {
173
366
  'closed door is the first attempt, not the answer: read what the error actually says, change',
174
367
  'the approach rather than the parameter, and try a genuinely different route before you report',
175
368
  'that something cannot be done. When you do report it, say what you tried and what would',
176
- 'unblock it. Stop short of anything irreversible or consequential the assignment did not ask',
369
+ 'unblock it. Stop short of anything irreversible or consequential the task did not ask',
177
370
  'for, and never claim a result you have not seen.',
178
371
  ].join(' '));
179
- sections.push([
180
- 'Work the assignment and nothing else. Your output is a report to whoever assigned it,',
181
- 'not a chat with the user: lead with the result, then what you changed or found, then open',
182
- 'questions. No preamble, no restating the task. Separate what you verified from what you',
183
- 'assume. Use send_message only for something your manager or the assistant must know',
184
- 'outside this report. Write in the language the assignment is written in.',
185
- ].join(' '));
186
- sections.push('Today is ' + new Date().toISOString().slice(0, 10) + '.');
372
+ // Skipped for a letter-register reply: "lead with the result, no preamble"
373
+ // directly contradicts a salutation and a sign-off, and E10 means only one
374
+ // of the two instructions is ever in the prompt for a given run.
375
+ if (!letterRegister) {
376
+ sections.push([
377
+ 'Work the task and nothing else. Your output is a report to whoever asked for it,',
378
+ 'not a chat with the user: lead with the result, then what you changed or found, then open',
379
+ 'questions. No preamble, no restating the brief. Separate what you verified from what you',
380
+ 'assume. Anything that belongs to somebody other than whoever asked for this goes by mail, as',
381
+ 'described above, not into the report. Write in the language the task is written in.',
382
+ ].join(' '));
383
+ }
384
+ // Decision E2: qualitative, never a number - see AgentPromptInput.agentNotes.
385
+ if (input.agentNotes?.length) {
386
+ const notes = input.agentNotes
387
+ .slice(0, 2)
388
+ .map((entry) => '- ' + entry.note)
389
+ .join('\n');
390
+ sections.push('Feedback on your work:\n' + notes);
391
+ }
392
+ // Decision E3: fixed prompt text, never through recall - a successor gets
393
+ // exactly one telling of this, not a memory that might not surface.
394
+ if (input.handoverFrom) {
395
+ sections.push('Handover from ' + input.handoverFrom.predecessorName + ':\n' + input.handoverFrom.text);
396
+ }
397
+ // The clock a model judges every other stamp against, in this machine's own
398
+ // zone. A UTC date here and a local one elsewhere is how a healthy run comes
399
+ // to look hours old.
400
+ sections.push('It is now ' + formatNow() + '.');
187
401
  return sections.join('\n\n');
188
402
  }
189
403
  /** The board as the assistant reads it. */
@@ -191,78 +405,51 @@ export function renderBoard(tasks, snapshot, store) {
191
405
  if (!tasks.length)
192
406
  return 'The board is empty.';
193
407
  const byId = agentById(snapshot);
408
+ // A status filter searches the whole board, subtasks included, so a task
409
+ // that is on the list in its own right must not turn up a second time
410
+ // under its parent.
411
+ const listed = new Set(tasks.map((task) => task.id));
194
412
  const lines = [];
195
413
  for (const task of tasks) {
196
414
  const assignee = task.assigneeId ? (byId.get(task.assigneeId)?.slug ?? '?') : 'unassigned';
197
415
  lines.push('- [' + task.id.slice(0, 8) + '] ' + task.status.toUpperCase() + ' ' + task.priority + ' — ' + task.title +
198
- ' (' + assignee + ')' + (task.planNote ? ' · ' + shorten(task.planNote, 80) : ''));
416
+ ' (' + assignee + ')' + (task.planNote ? ' · ' + shorten(task.planNote, 80) : '') +
417
+ waitingOn(task, store) + attemptsOn(task, store));
199
418
  for (const child of store.listTasks(task.orgId, { parentId: task.id })) {
200
- if (child.status === 'cancelled')
419
+ if (child.status === 'cancelled' || listed.has(child.id))
201
420
  continue;
202
421
  const who = child.assigneeId ? (byId.get(child.assigneeId)?.slug ?? '?') : 'unassigned';
203
- lines.push(' - [' + child.id.slice(0, 8) + '] ' + child.status + ' — ' + child.title + ' (' + who + ')');
422
+ lines.push(' - [' + child.id.slice(0, 8) + '] ' + child.status + ' — ' + child.title + ' (' + who + ')' +
423
+ waitingOn(child, store));
204
424
  }
205
425
  }
206
426
  return lines.join('\n');
207
427
  }
208
428
  /**
209
- * The system prompt for a direct conversation between the user and one
210
- * agent - a direct message in the company chat. The agent speaks as itself,
211
- * knows its place in the company, and may hand work to its reports, but it
212
- * is not the assistant and does not pretend to be.
429
+ * What a waiting task waits for: how long it has stood there and the subject
430
+ * of the last mail in its thread (concept section 9). The board is all the
431
+ * watcher gets to read, and "BLOCKED normal — Fix the gate (mara)" says
432
+ * neither what was asked nor for how long.
213
433
  */
214
- export function buildAgentChatPrompt(input) {
215
- const { agent, snapshot, config } = input;
216
- const byId = agentById(snapshot);
217
- const team = agent.teamId ? snapshot.teams.find((entry) => entry.id === agent.teamId) : undefined;
218
- const manager = agent.managerId ? byId.get(agent.managerId) : undefined;
219
- const reports = snapshot.agents.filter((entry) => entry.managerId === agent.id);
220
- const user = config.userName ? config.userName : 'the owner of the company';
221
- const sections = [];
222
- sections.push([
223
- 'You are ' + agent.name + ', ' + agent.title + ' at ' + snapshot.organization.name + ',',
224
- 'a company of AI agents run by the assistant ' + (config.assistantName || 'Rookery') + ' for ' + user + '.',
225
- 'You are talking directly with ' + user + ' in a private chat, the way a colleague would.',
226
- 'Speak as yourself, in your own voice, in the first person. You are not the assistant.',
227
- team ? 'You are in the team "' + team.name + '"' + (team.purpose ? ' (' + team.purpose + ')' : '') + '.' : '',
228
- manager ? 'Your manager is ' + manager.name + ' (' + manager.slug + ').' : 'You report directly to the assistant.',
229
- reports.length
230
- ? 'Your direct reports: ' + reports.map((entry) => entry.slug + ' (' + entry.title + ')').join(', ') +
231
- '. You may hand them work with the assign tool when the user asks for something done.'
232
- : '',
233
- 'Be helpful and concrete, keep answers short unless asked for detail, and say plainly when',
234
- 'something is outside your role. Match the language the user writes in.',
235
- ]
236
- .filter(Boolean)
237
- .join(' '));
238
- sections.push('Your standing instructions:\n' + agent.instructions);
239
- // How the work gets done, below the role and above the task: the agent's
240
- // own instructions still win, because they were written for this job.
241
- if (config.org.lazyCoding)
242
- sections.push(PONYTAIL_RULESET);
243
- if (input.project) {
244
- sections.push('Project in focus: ' + input.project.name +
245
- (input.project.description ? ' — ' + input.project.description : '') +
246
- (input.project.path ? ' at ' + input.project.path : ''));
247
- }
248
- const memoryBlock = renderMemoryBlock(input.memories, Math.floor(config.memory.contextBudget * 0.4), 'your work and this person');
249
- if (memoryBlock)
250
- sections.push(memoryBlock);
251
- if (!input.resumed && input.history?.length) {
252
- const lines = input.history.slice(-12).map((message) => {
253
- const speaker = message.role === 'user' ? 'User' : 'You';
254
- return speaker + ': ' + shorten(message.content, 400);
255
- });
256
- sections.push('Earlier in this conversation:\n' + lines.join('\n'));
257
- }
258
- const inboxBlock = renderInbox(input.inbox, snapshot, 'Messages waiting for you:');
259
- if (inboxBlock)
260
- sections.push(inboxBlock);
261
- for (const hint of input.toolHints ?? [])
262
- sections.push(hint);
263
- if (input.skillsIndex)
264
- sections.push(input.skillsIndex);
265
- sections.push('Today is ' + new Date().toISOString().slice(0, 10) + '.');
266
- return sections.join('\n\n');
434
+ /**
435
+ * How often a failed task has already been tried. The board watcher reports
436
+ * rather than retries, and "failed" on its own does not say whether this is
437
+ * the first attempt or the fourth - which is the difference between "worth
438
+ * another go" and "something here is broken and no amount of running it
439
+ * again will help". Only shown where it changes the reading.
440
+ */
441
+ function attemptsOn(task, store) {
442
+ if (task.status !== 'failed')
443
+ return '';
444
+ const runs = store.taskRunCount(task.id);
445
+ return runs > 1 ? ' · failed on run ' + runs : '';
446
+ }
447
+ function waitingOn(task, store) {
448
+ if (task.status !== 'blocked')
449
+ return '';
450
+ const thread = store.getMailThreadForTask(task.orgId, task.id);
451
+ const last = thread ? store.thread(task.orgId, thread.threadId, { limit: 1 }).at(-1) : null;
452
+ const span = formatAge(task.updatedAt || task.createdAt, Date.now(), 'minute');
453
+ return ' · waiting ' + span + (last ? ' on "' + shorten(last.subject, 60) + '"' : '');
267
454
  }
268
455
  //# sourceMappingURL=prompts.js.map