openryoko 0.9.4-ryoko.2

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 (514) hide show
  1. package/dist/bin/jimmy.d.ts +3 -0
  2. package/dist/bin/jimmy.d.ts.map +1 -0
  3. package/dist/bin/jimmy.js +149 -0
  4. package/dist/bin/jimmy.js.map +1 -0
  5. package/dist/package.json +54 -0
  6. package/dist/src/cli/__tests__/migrate.test.d.ts +2 -0
  7. package/dist/src/cli/__tests__/migrate.test.d.ts.map +1 -0
  8. package/dist/src/cli/__tests__/migrate.test.js +79 -0
  9. package/dist/src/cli/__tests__/migrate.test.js.map +1 -0
  10. package/dist/src/cli/chrome-allow.d.ts +5 -0
  11. package/dist/src/cli/chrome-allow.d.ts.map +1 -0
  12. package/dist/src/cli/chrome-allow.js +250 -0
  13. package/dist/src/cli/chrome-allow.js.map +1 -0
  14. package/dist/src/cli/create.d.ts +2 -0
  15. package/dist/src/cli/create.d.ts.map +1 -0
  16. package/dist/src/cli/create.js +72 -0
  17. package/dist/src/cli/create.js.map +1 -0
  18. package/dist/src/cli/instances.d.ts +14 -0
  19. package/dist/src/cli/instances.d.ts.map +1 -0
  20. package/dist/src/cli/instances.js +43 -0
  21. package/dist/src/cli/instances.js.map +1 -0
  22. package/dist/src/cli/list.d.ts +2 -0
  23. package/dist/src/cli/list.d.ts.map +1 -0
  24. package/dist/src/cli/list.js +38 -0
  25. package/dist/src/cli/list.js.map +1 -0
  26. package/dist/src/cli/migrate.d.ts +5 -0
  27. package/dist/src/cli/migrate.d.ts.map +1 -0
  28. package/dist/src/cli/migrate.js +222 -0
  29. package/dist/src/cli/migrate.js.map +1 -0
  30. package/dist/src/cli/nuke.d.ts +2 -0
  31. package/dist/src/cli/nuke.d.ts.map +1 -0
  32. package/dist/src/cli/nuke.js +91 -0
  33. package/dist/src/cli/nuke.js.map +1 -0
  34. package/dist/src/cli/remove.d.ts +4 -0
  35. package/dist/src/cli/remove.d.ts.map +1 -0
  36. package/dist/src/cli/remove.js +47 -0
  37. package/dist/src/cli/remove.js.map +1 -0
  38. package/dist/src/cli/setup.d.ts +4 -0
  39. package/dist/src/cli/setup.d.ts.map +1 -0
  40. package/dist/src/cli/setup.js +491 -0
  41. package/dist/src/cli/setup.js.map +1 -0
  42. package/dist/src/cli/skills.d.ts +28 -0
  43. package/dist/src/cli/skills.d.ts.map +1 -0
  44. package/dist/src/cli/skills.js +284 -0
  45. package/dist/src/cli/skills.js.map +1 -0
  46. package/dist/src/cli/start.d.ts +5 -0
  47. package/dist/src/cli/start.d.ts.map +1 -0
  48. package/dist/src/cli/start.js +34 -0
  49. package/dist/src/cli/start.js.map +1 -0
  50. package/dist/src/cli/status.d.ts +2 -0
  51. package/dist/src/cli/status.d.ts.map +1 -0
  52. package/dist/src/cli/status.js +69 -0
  53. package/dist/src/cli/status.js.map +1 -0
  54. package/dist/src/cli/stop.d.ts +2 -0
  55. package/dist/src/cli/stop.d.ts.map +1 -0
  56. package/dist/src/cli/stop.js +11 -0
  57. package/dist/src/cli/stop.js.map +1 -0
  58. package/dist/src/connectors/cron/index.d.ts +21 -0
  59. package/dist/src/connectors/cron/index.d.ts.map +1 -0
  60. package/dist/src/connectors/cron/index.js +75 -0
  61. package/dist/src/connectors/cron/index.js.map +1 -0
  62. package/dist/src/connectors/discord/format.d.ts +3 -0
  63. package/dist/src/connectors/discord/format.d.ts.map +1 -0
  64. package/dist/src/connectors/discord/format.js +33 -0
  65. package/dist/src/connectors/discord/format.js.map +1 -0
  66. package/dist/src/connectors/discord/index.d.ts +47 -0
  67. package/dist/src/connectors/discord/index.d.ts.map +1 -0
  68. package/dist/src/connectors/discord/index.js +308 -0
  69. package/dist/src/connectors/discord/index.js.map +1 -0
  70. package/dist/src/connectors/discord/remote.d.ts +33 -0
  71. package/dist/src/connectors/discord/remote.d.ts.map +1 -0
  72. package/dist/src/connectors/discord/remote.js +89 -0
  73. package/dist/src/connectors/discord/remote.js.map +1 -0
  74. package/dist/src/connectors/discord/threads.d.ts +5 -0
  75. package/dist/src/connectors/discord/threads.d.ts.map +1 -0
  76. package/dist/src/connectors/discord/threads.js +22 -0
  77. package/dist/src/connectors/discord/threads.js.map +1 -0
  78. package/dist/src/connectors/slack/__tests__/active-threads.test.d.ts +2 -0
  79. package/dist/src/connectors/slack/__tests__/active-threads.test.d.ts.map +1 -0
  80. package/dist/src/connectors/slack/__tests__/active-threads.test.js +57 -0
  81. package/dist/src/connectors/slack/__tests__/active-threads.test.js.map +1 -0
  82. package/dist/src/connectors/slack/__tests__/format.test.d.ts +2 -0
  83. package/dist/src/connectors/slack/__tests__/format.test.d.ts.map +1 -0
  84. package/dist/src/connectors/slack/__tests__/format.test.js +115 -0
  85. package/dist/src/connectors/slack/__tests__/format.test.js.map +1 -0
  86. package/dist/src/connectors/slack/__tests__/speaker.test.d.ts +2 -0
  87. package/dist/src/connectors/slack/__tests__/speaker.test.d.ts.map +1 -0
  88. package/dist/src/connectors/slack/__tests__/speaker.test.js +59 -0
  89. package/dist/src/connectors/slack/__tests__/speaker.test.js.map +1 -0
  90. package/dist/src/connectors/slack/__tests__/triage-prompt.test.d.ts +2 -0
  91. package/dist/src/connectors/slack/__tests__/triage-prompt.test.d.ts.map +1 -0
  92. package/dist/src/connectors/slack/__tests__/triage-prompt.test.js +102 -0
  93. package/dist/src/connectors/slack/__tests__/triage-prompt.test.js.map +1 -0
  94. package/dist/src/connectors/slack/__tests__/triage.test.d.ts +2 -0
  95. package/dist/src/connectors/slack/__tests__/triage.test.d.ts.map +1 -0
  96. package/dist/src/connectors/slack/__tests__/triage.test.js +88 -0
  97. package/dist/src/connectors/slack/__tests__/triage.test.js.map +1 -0
  98. package/dist/src/connectors/slack/active-threads.d.ts +39 -0
  99. package/dist/src/connectors/slack/active-threads.d.ts.map +1 -0
  100. package/dist/src/connectors/slack/active-threads.js +71 -0
  101. package/dist/src/connectors/slack/active-threads.js.map +1 -0
  102. package/dist/src/connectors/slack/format.d.ts +17 -0
  103. package/dist/src/connectors/slack/format.d.ts.map +1 -0
  104. package/dist/src/connectors/slack/format.js +85 -0
  105. package/dist/src/connectors/slack/format.js.map +1 -0
  106. package/dist/src/connectors/slack/index.d.ts +51 -0
  107. package/dist/src/connectors/slack/index.d.ts.map +1 -0
  108. package/dist/src/connectors/slack/index.js +562 -0
  109. package/dist/src/connectors/slack/index.js.map +1 -0
  110. package/dist/src/connectors/slack/speaker.d.ts +39 -0
  111. package/dist/src/connectors/slack/speaker.d.ts.map +1 -0
  112. package/dist/src/connectors/slack/speaker.js +30 -0
  113. package/dist/src/connectors/slack/speaker.js.map +1 -0
  114. package/dist/src/connectors/slack/threads.d.ts +12 -0
  115. package/dist/src/connectors/slack/threads.d.ts.map +1 -0
  116. package/dist/src/connectors/slack/threads.js +41 -0
  117. package/dist/src/connectors/slack/threads.js.map +1 -0
  118. package/dist/src/connectors/slack/threads.test.d.ts +2 -0
  119. package/dist/src/connectors/slack/threads.test.d.ts.map +1 -0
  120. package/dist/src/connectors/slack/threads.test.js +79 -0
  121. package/dist/src/connectors/slack/threads.test.js.map +1 -0
  122. package/dist/src/connectors/slack/triage-prompt.d.ts +50 -0
  123. package/dist/src/connectors/slack/triage-prompt.d.ts.map +1 -0
  124. package/dist/src/connectors/slack/triage-prompt.js +127 -0
  125. package/dist/src/connectors/slack/triage-prompt.js.map +1 -0
  126. package/dist/src/connectors/slack/triage.d.ts +41 -0
  127. package/dist/src/connectors/slack/triage.d.ts.map +1 -0
  128. package/dist/src/connectors/slack/triage.js +120 -0
  129. package/dist/src/connectors/slack/triage.js.map +1 -0
  130. package/dist/src/connectors/telegram/__tests__/connector.test.d.ts +2 -0
  131. package/dist/src/connectors/telegram/__tests__/connector.test.d.ts.map +1 -0
  132. package/dist/src/connectors/telegram/__tests__/connector.test.js +257 -0
  133. package/dist/src/connectors/telegram/__tests__/connector.test.js.map +1 -0
  134. package/dist/src/connectors/telegram/__tests__/format.test.d.ts +2 -0
  135. package/dist/src/connectors/telegram/__tests__/format.test.d.ts.map +1 -0
  136. package/dist/src/connectors/telegram/__tests__/format.test.js +79 -0
  137. package/dist/src/connectors/telegram/__tests__/format.test.js.map +1 -0
  138. package/dist/src/connectors/telegram/__tests__/threads.test.d.ts +2 -0
  139. package/dist/src/connectors/telegram/__tests__/threads.test.d.ts.map +1 -0
  140. package/dist/src/connectors/telegram/__tests__/threads.test.js +51 -0
  141. package/dist/src/connectors/telegram/__tests__/threads.test.js.map +1 -0
  142. package/dist/src/connectors/telegram/format.d.ts +12 -0
  143. package/dist/src/connectors/telegram/format.d.ts.map +1 -0
  144. package/dist/src/connectors/telegram/format.js +61 -0
  145. package/dist/src/connectors/telegram/format.js.map +1 -0
  146. package/dist/src/connectors/telegram/index.d.ts +28 -0
  147. package/dist/src/connectors/telegram/index.d.ts.map +1 -0
  148. package/dist/src/connectors/telegram/index.js +213 -0
  149. package/dist/src/connectors/telegram/index.js.map +1 -0
  150. package/dist/src/connectors/telegram/threads.d.ts +29 -0
  151. package/dist/src/connectors/telegram/threads.d.ts.map +1 -0
  152. package/dist/src/connectors/telegram/threads.js +26 -0
  153. package/dist/src/connectors/telegram/threads.js.map +1 -0
  154. package/dist/src/connectors/whatsapp/__tests__/format.test.d.ts +2 -0
  155. package/dist/src/connectors/whatsapp/__tests__/format.test.d.ts.map +1 -0
  156. package/dist/src/connectors/whatsapp/__tests__/format.test.js +70 -0
  157. package/dist/src/connectors/whatsapp/__tests__/format.test.js.map +1 -0
  158. package/dist/src/connectors/whatsapp/format.d.ts +12 -0
  159. package/dist/src/connectors/whatsapp/format.d.ts.map +1 -0
  160. package/dist/src/connectors/whatsapp/format.js +53 -0
  161. package/dist/src/connectors/whatsapp/format.js.map +1 -0
  162. package/dist/src/connectors/whatsapp/index.d.ts +42 -0
  163. package/dist/src/connectors/whatsapp/index.d.ts.map +1 -0
  164. package/dist/src/connectors/whatsapp/index.js +279 -0
  165. package/dist/src/connectors/whatsapp/index.js.map +1 -0
  166. package/dist/src/cron/jobs.d.ts +5 -0
  167. package/dist/src/cron/jobs.d.ts.map +1 -0
  168. package/dist/src/cron/jobs.js +23 -0
  169. package/dist/src/cron/jobs.js.map +1 -0
  170. package/dist/src/cron/runner.d.ts +4 -0
  171. package/dist/src/cron/runner.d.ts.map +1 -0
  172. package/dist/src/cron/runner.js +88 -0
  173. package/dist/src/cron/runner.js.map +1 -0
  174. package/dist/src/cron/scheduler.d.ts +8 -0
  175. package/dist/src/cron/scheduler.d.ts.map +1 -0
  176. package/dist/src/cron/scheduler.js +64 -0
  177. package/dist/src/cron/scheduler.js.map +1 -0
  178. package/dist/src/engines/__tests__/gemini.test.d.ts +2 -0
  179. package/dist/src/engines/__tests__/gemini.test.d.ts.map +1 -0
  180. package/dist/src/engines/__tests__/gemini.test.js +404 -0
  181. package/dist/src/engines/__tests__/gemini.test.js.map +1 -0
  182. package/dist/src/engines/claude.d.ts +20 -0
  183. package/dist/src/engines/claude.d.ts.map +1 -0
  184. package/dist/src/engines/claude.js +520 -0
  185. package/dist/src/engines/claude.js.map +1 -0
  186. package/dist/src/engines/codex.d.ts +15 -0
  187. package/dist/src/engines/codex.d.ts.map +1 -0
  188. package/dist/src/engines/codex.js +351 -0
  189. package/dist/src/engines/codex.js.map +1 -0
  190. package/dist/src/engines/gemini.d.ts +32 -0
  191. package/dist/src/engines/gemini.d.ts.map +1 -0
  192. package/dist/src/engines/gemini.js +328 -0
  193. package/dist/src/engines/gemini.js.map +1 -0
  194. package/dist/src/engines/mock.d.ts +16 -0
  195. package/dist/src/engines/mock.d.ts.map +1 -0
  196. package/dist/src/engines/mock.js +47 -0
  197. package/dist/src/engines/mock.js.map +1 -0
  198. package/dist/src/gateway/__tests__/api-last-n.test.d.ts +2 -0
  199. package/dist/src/gateway/__tests__/api-last-n.test.d.ts.map +1 -0
  200. package/dist/src/gateway/__tests__/api-last-n.test.js +32 -0
  201. package/dist/src/gateway/__tests__/api-last-n.test.js.map +1 -0
  202. package/dist/src/gateway/__tests__/costs.test.d.ts +2 -0
  203. package/dist/src/gateway/__tests__/costs.test.d.ts.map +1 -0
  204. package/dist/src/gateway/__tests__/costs.test.js +32 -0
  205. package/dist/src/gateway/__tests__/costs.test.js.map +1 -0
  206. package/dist/src/gateway/__tests__/org-hierarchy.test.d.ts +2 -0
  207. package/dist/src/gateway/__tests__/org-hierarchy.test.d.ts.map +1 -0
  208. package/dist/src/gateway/__tests__/org-hierarchy.test.js +161 -0
  209. package/dist/src/gateway/__tests__/org-hierarchy.test.js.map +1 -0
  210. package/dist/src/gateway/__tests__/org-update.test.d.ts +2 -0
  211. package/dist/src/gateway/__tests__/org-update.test.d.ts.map +1 -0
  212. package/dist/src/gateway/__tests__/org-update.test.js +99 -0
  213. package/dist/src/gateway/__tests__/org-update.test.js.map +1 -0
  214. package/dist/src/gateway/__tests__/org.test.d.ts +2 -0
  215. package/dist/src/gateway/__tests__/org.test.d.ts.map +1 -0
  216. package/dist/src/gateway/__tests__/org.test.js +77 -0
  217. package/dist/src/gateway/__tests__/org.test.js.map +1 -0
  218. package/dist/src/gateway/__tests__/services.test.d.ts +2 -0
  219. package/dist/src/gateway/__tests__/services.test.d.ts.map +1 -0
  220. package/dist/src/gateway/__tests__/services.test.js +153 -0
  221. package/dist/src/gateway/__tests__/services.test.js.map +1 -0
  222. package/dist/src/gateway/api.d.ts +19 -0
  223. package/dist/src/gateway/api.d.ts.map +1 -0
  224. package/dist/src/gateway/api.js +2261 -0
  225. package/dist/src/gateway/api.js.map +1 -0
  226. package/dist/src/gateway/budgets.d.ts +16 -0
  227. package/dist/src/gateway/budgets.d.ts.map +1 -0
  228. package/dist/src/gateway/budgets.js +39 -0
  229. package/dist/src/gateway/budgets.js.map +1 -0
  230. package/dist/src/gateway/costs.d.ts +19 -0
  231. package/dist/src/gateway/costs.d.ts.map +1 -0
  232. package/dist/src/gateway/costs.js +39 -0
  233. package/dist/src/gateway/costs.js.map +1 -0
  234. package/dist/src/gateway/daemon-entry.d.ts +2 -0
  235. package/dist/src/gateway/daemon-entry.d.ts.map +1 -0
  236. package/dist/src/gateway/daemon-entry.js +12 -0
  237. package/dist/src/gateway/daemon-entry.js.map +1 -0
  238. package/dist/src/gateway/files.d.ts +6 -0
  239. package/dist/src/gateway/files.d.ts.map +1 -0
  240. package/dist/src/gateway/files.js +442 -0
  241. package/dist/src/gateway/files.js.map +1 -0
  242. package/dist/src/gateway/goals.d.ts +11 -0
  243. package/dist/src/gateway/goals.d.ts.map +1 -0
  244. package/dist/src/gateway/goals.js +72 -0
  245. package/dist/src/gateway/goals.js.map +1 -0
  246. package/dist/src/gateway/lifecycle.d.ts +10 -0
  247. package/dist/src/gateway/lifecycle.d.ts.map +1 -0
  248. package/dist/src/gateway/lifecycle.js +152 -0
  249. package/dist/src/gateway/lifecycle.js.map +1 -0
  250. package/dist/src/gateway/org-hierarchy.d.ts +5 -0
  251. package/dist/src/gateway/org-hierarchy.d.ts.map +1 -0
  252. package/dist/src/gateway/org-hierarchy.js +174 -0
  253. package/dist/src/gateway/org-hierarchy.js.map +1 -0
  254. package/dist/src/gateway/org.d.ts +17 -0
  255. package/dist/src/gateway/org.d.ts.map +1 -0
  256. package/dist/src/gateway/org.js +136 -0
  257. package/dist/src/gateway/org.js.map +1 -0
  258. package/dist/src/gateway/server.d.ts +4 -0
  259. package/dist/src/gateway/server.d.ts.map +1 -0
  260. package/dist/src/gateway/server.js +764 -0
  261. package/dist/src/gateway/server.js.map +1 -0
  262. package/dist/src/gateway/services.d.ts +28 -0
  263. package/dist/src/gateway/services.d.ts.map +1 -0
  264. package/dist/src/gateway/services.js +112 -0
  265. package/dist/src/gateway/services.js.map +1 -0
  266. package/dist/src/gateway/watcher.d.ts +14 -0
  267. package/dist/src/gateway/watcher.d.ts.map +1 -0
  268. package/dist/src/gateway/watcher.js +111 -0
  269. package/dist/src/gateway/watcher.js.map +1 -0
  270. package/dist/src/index.d.ts +5 -0
  271. package/dist/src/index.d.ts.map +1 -0
  272. package/dist/src/index.js +4 -0
  273. package/dist/src/index.js.map +1 -0
  274. package/dist/src/mcp/gateway-server.d.ts +13 -0
  275. package/dist/src/mcp/gateway-server.d.ts.map +1 -0
  276. package/dist/src/mcp/gateway-server.js +376 -0
  277. package/dist/src/mcp/gateway-server.js.map +1 -0
  278. package/dist/src/mcp/resolver.d.ts +19 -0
  279. package/dist/src/mcp/resolver.d.ts.map +1 -0
  280. package/dist/src/mcp/resolver.js +159 -0
  281. package/dist/src/mcp/resolver.js.map +1 -0
  282. package/dist/src/sessions/__tests__/callbacks.test.d.ts +2 -0
  283. package/dist/src/sessions/__tests__/callbacks.test.d.ts.map +1 -0
  284. package/dist/src/sessions/__tests__/callbacks.test.js +154 -0
  285. package/dist/src/sessions/__tests__/callbacks.test.js.map +1 -0
  286. package/dist/src/sessions/callbacks.d.ts +31 -0
  287. package/dist/src/sessions/callbacks.d.ts.map +1 -0
  288. package/dist/src/sessions/callbacks.js +112 -0
  289. package/dist/src/sessions/callbacks.js.map +1 -0
  290. package/dist/src/sessions/context.d.ts +36 -0
  291. package/dist/src/sessions/context.d.ts.map +1 -0
  292. package/dist/src/sessions/context.js +741 -0
  293. package/dist/src/sessions/context.js.map +1 -0
  294. package/dist/src/sessions/fork.d.ts +30 -0
  295. package/dist/src/sessions/fork.d.ts.map +1 -0
  296. package/dist/src/sessions/fork.js +178 -0
  297. package/dist/src/sessions/fork.js.map +1 -0
  298. package/dist/src/sessions/manager.d.ts +27 -0
  299. package/dist/src/sessions/manager.d.ts.map +1 -0
  300. package/dist/src/sessions/manager.js +751 -0
  301. package/dist/src/sessions/manager.js.map +1 -0
  302. package/dist/src/sessions/queue.d.ts +36 -0
  303. package/dist/src/sessions/queue.d.ts.map +1 -0
  304. package/dist/src/sessions/queue.js +101 -0
  305. package/dist/src/sessions/queue.js.map +1 -0
  306. package/dist/src/sessions/queue.test.d.ts +2 -0
  307. package/dist/src/sessions/queue.test.d.ts.map +1 -0
  308. package/dist/src/sessions/queue.test.js +28 -0
  309. package/dist/src/sessions/queue.test.js.map +1 -0
  310. package/dist/src/sessions/registry.d.ts +116 -0
  311. package/dist/src/sessions/registry.d.ts.map +1 -0
  312. package/dist/src/sessions/registry.js +480 -0
  313. package/dist/src/sessions/registry.js.map +1 -0
  314. package/dist/src/sessions/registry.test.d.ts +2 -0
  315. package/dist/src/sessions/registry.test.d.ts.map +1 -0
  316. package/dist/src/sessions/registry.test.js +41 -0
  317. package/dist/src/sessions/registry.test.js.map +1 -0
  318. package/dist/src/shared/__tests__/rateLimit.test.d.ts +2 -0
  319. package/dist/src/shared/__tests__/rateLimit.test.d.ts.map +1 -0
  320. package/dist/src/shared/__tests__/rateLimit.test.js +108 -0
  321. package/dist/src/shared/__tests__/rateLimit.test.js.map +1 -0
  322. package/dist/src/shared/__tests__/usageAwareness.test.d.ts +2 -0
  323. package/dist/src/shared/__tests__/usageAwareness.test.d.ts.map +1 -0
  324. package/dist/src/shared/__tests__/usageAwareness.test.js +58 -0
  325. package/dist/src/shared/__tests__/usageAwareness.test.js.map +1 -0
  326. package/dist/src/shared/config.d.ts +3 -0
  327. package/dist/src/shared/config.d.ts.map +1 -0
  328. package/dist/src/shared/config.js +11 -0
  329. package/dist/src/shared/config.js.map +1 -0
  330. package/dist/src/shared/effort.d.ts +17 -0
  331. package/dist/src/shared/effort.d.ts.map +1 -0
  332. package/dist/src/shared/effort.js +44 -0
  333. package/dist/src/shared/effort.js.map +1 -0
  334. package/dist/src/shared/logger.d.ts +12 -0
  335. package/dist/src/shared/logger.d.ts.map +1 -0
  336. package/dist/src/shared/logger.js +35 -0
  337. package/dist/src/shared/logger.js.map +1 -0
  338. package/dist/src/shared/paths.d.ts +31 -0
  339. package/dist/src/shared/paths.d.ts.map +1 -0
  340. package/dist/src/shared/paths.js +92 -0
  341. package/dist/src/shared/paths.js.map +1 -0
  342. package/dist/src/shared/rateLimit.d.ts +20 -0
  343. package/dist/src/shared/rateLimit.d.ts.map +1 -0
  344. package/dist/src/shared/rateLimit.js +61 -0
  345. package/dist/src/shared/rateLimit.js.map +1 -0
  346. package/dist/src/shared/types.d.ts +448 -0
  347. package/dist/src/shared/types.d.ts.map +1 -0
  348. package/dist/src/shared/types.js +4 -0
  349. package/dist/src/shared/types.js.map +1 -0
  350. package/dist/src/shared/usageAwareness.d.ts +10 -0
  351. package/dist/src/shared/usageAwareness.d.ts.map +1 -0
  352. package/dist/src/shared/usageAwareness.js +69 -0
  353. package/dist/src/shared/usageAwareness.js.map +1 -0
  354. package/dist/src/shared/version.d.ts +15 -0
  355. package/dist/src/shared/version.d.ts.map +1 -0
  356. package/dist/src/shared/version.js +56 -0
  357. package/dist/src/shared/version.js.map +1 -0
  358. package/dist/src/stt/stt.d.ts +24 -0
  359. package/dist/src/stt/stt.d.ts.map +1 -0
  360. package/dist/src/stt/stt.js +203 -0
  361. package/dist/src/stt/stt.js.map +1 -0
  362. package/dist/web/404.html +1 -0
  363. package/dist/web/__next.__PAGE__.txt +9 -0
  364. package/dist/web/__next._full.txt +19 -0
  365. package/dist/web/__next._head.txt +6 -0
  366. package/dist/web/__next._index.txt +6 -0
  367. package/dist/web/__next._tree.txt +2 -0
  368. package/dist/web/_next/static/chunks/00yn.jp4tr9l6.js +62 -0
  369. package/dist/web/_next/static/chunks/0398g9fy2i2l..js +5 -0
  370. package/dist/web/_next/static/chunks/03~yq9q893hmn.js +1 -0
  371. package/dist/web/_next/static/chunks/07t-qdutaizlf.js +5 -0
  372. package/dist/web/_next/static/chunks/0_pxvi.u4tzw1.js +5 -0
  373. package/dist/web/_next/static/chunks/0dtbl8648b3u9.js +7 -0
  374. package/dist/web/_next/static/chunks/0e3pdjkorr5zl.js +2 -0
  375. package/dist/web/_next/static/chunks/0ewpxy-mzj3j3.js +1 -0
  376. package/dist/web/_next/static/chunks/0ihbb7~gq42g~.js +5 -0
  377. package/dist/web/_next/static/chunks/0j4uz-g9x1_~s.js +1 -0
  378. package/dist/web/_next/static/chunks/0mlo32yrc7ziu.css +1 -0
  379. package/dist/web/_next/static/chunks/0ru56x83x4rkk.js +1 -0
  380. package/dist/web/_next/static/chunks/0svvev77pb2gu.js +1 -0
  381. package/dist/web/_next/static/chunks/0tf9kpygstdls.js +1 -0
  382. package/dist/web/_next/static/chunks/0wzpea61sn2-k.js +5 -0
  383. package/dist/web/_next/static/chunks/0y3dnnq~kxyz_.js +1 -0
  384. package/dist/web/_next/static/chunks/0y~qqhmf2o7pt.js +1 -0
  385. package/dist/web/_next/static/chunks/0~6m1p5hnsx2f.js +1 -0
  386. package/dist/web/_next/static/chunks/10-liamt-ipcu.js +1 -0
  387. package/dist/web/_next/static/chunks/10l08hq.acixl.js +5 -0
  388. package/dist/web/_next/static/chunks/11rbefjn.e-3-.js +1 -0
  389. package/dist/web/_next/static/chunks/11rodb4s1x4of.js +1 -0
  390. package/dist/web/_next/static/chunks/12_uxtnrqhoo1.js +1 -0
  391. package/dist/web/_next/static/chunks/12h4dws.tz7yb.js +5 -0
  392. package/dist/web/_next/static/chunks/13juizw904g.e.js +1 -0
  393. package/dist/web/_next/static/chunks/14ge_q22f0n.f.js +1 -0
  394. package/dist/web/_next/static/chunks/16b0jvgccyt2i.js +5 -0
  395. package/dist/web/_next/static/chunks/17-u9c_weg12-.js +31 -0
  396. package/dist/web/_next/static/chunks/turbopack-0dt987bw_1nyf.js +1 -0
  397. package/dist/web/_next/static/media/apple-icon.0.wpl4.d-5bkf.jpg +0 -0
  398. package/dist/web/_next/static/media/icon.0.wpl4.d-5bkf.jpg +0 -0
  399. package/dist/web/_next/static/uwjABwQIFELOHhVlstvOe/_buildManifest.js +11 -0
  400. package/dist/web/_next/static/uwjABwQIFELOHhVlstvOe/_clientMiddlewareManifest.js +1 -0
  401. package/dist/web/_next/static/uwjABwQIFELOHhVlstvOe/_ssgManifest.js +1 -0
  402. package/dist/web/_not-found/__next._full.txt +17 -0
  403. package/dist/web/_not-found/__next._head.txt +6 -0
  404. package/dist/web/_not-found/__next._index.txt +6 -0
  405. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +5 -0
  406. package/dist/web/_not-found/__next._not-found.txt +5 -0
  407. package/dist/web/_not-found/__next._tree.txt +2 -0
  408. package/dist/web/_not-found.html +1 -0
  409. package/dist/web/_not-found.txt +17 -0
  410. package/dist/web/apple-icon.jpg +0 -0
  411. package/dist/web/chat/__next._full.txt +21 -0
  412. package/dist/web/chat/__next._head.txt +6 -0
  413. package/dist/web/chat/__next._index.txt +6 -0
  414. package/dist/web/chat/__next._tree.txt +2 -0
  415. package/dist/web/chat/__next.chat.__PAGE__.txt +9 -0
  416. package/dist/web/chat/__next.chat.txt +5 -0
  417. package/dist/web/chat.html +1 -0
  418. package/dist/web/chat.txt +21 -0
  419. package/dist/web/cron/__next._full.txt +21 -0
  420. package/dist/web/cron/__next._head.txt +6 -0
  421. package/dist/web/cron/__next._index.txt +6 -0
  422. package/dist/web/cron/__next._tree.txt +2 -0
  423. package/dist/web/cron/__next.cron.__PAGE__.txt +9 -0
  424. package/dist/web/cron/__next.cron.txt +5 -0
  425. package/dist/web/cron.html +1 -0
  426. package/dist/web/cron.txt +21 -0
  427. package/dist/web/icon.jpg +0 -0
  428. package/dist/web/index.html +1 -0
  429. package/dist/web/index.txt +19 -0
  430. package/dist/web/kanban/__next._full.txt +21 -0
  431. package/dist/web/kanban/__next._head.txt +6 -0
  432. package/dist/web/kanban/__next._index.txt +6 -0
  433. package/dist/web/kanban/__next._tree.txt +2 -0
  434. package/dist/web/kanban/__next.kanban.__PAGE__.txt +9 -0
  435. package/dist/web/kanban/__next.kanban.txt +5 -0
  436. package/dist/web/kanban.html +1 -0
  437. package/dist/web/kanban.txt +21 -0
  438. package/dist/web/logs/__next._full.txt +21 -0
  439. package/dist/web/logs/__next._head.txt +6 -0
  440. package/dist/web/logs/__next._index.txt +6 -0
  441. package/dist/web/logs/__next._tree.txt +2 -0
  442. package/dist/web/logs/__next.logs.__PAGE__.txt +9 -0
  443. package/dist/web/logs/__next.logs.txt +5 -0
  444. package/dist/web/logs.html +7 -0
  445. package/dist/web/logs.txt +21 -0
  446. package/dist/web/org/__next._full.txt +21 -0
  447. package/dist/web/org/__next._head.txt +6 -0
  448. package/dist/web/org/__next._index.txt +6 -0
  449. package/dist/web/org/__next._tree.txt +2 -0
  450. package/dist/web/org/__next.org.__PAGE__.txt +9 -0
  451. package/dist/web/org/__next.org.txt +5 -0
  452. package/dist/web/org.html +1 -0
  453. package/dist/web/org.txt +21 -0
  454. package/dist/web/sessions/__next._full.txt +18 -0
  455. package/dist/web/sessions/__next._head.txt +6 -0
  456. package/dist/web/sessions/__next._index.txt +6 -0
  457. package/dist/web/sessions/__next._tree.txt +2 -0
  458. package/dist/web/sessions/__next.sessions.__PAGE__.txt +6 -0
  459. package/dist/web/sessions/__next.sessions.txt +5 -0
  460. package/dist/web/sessions.html +1 -0
  461. package/dist/web/sessions.txt +18 -0
  462. package/dist/web/settings/__next._full.txt +21 -0
  463. package/dist/web/settings/__next._head.txt +6 -0
  464. package/dist/web/settings/__next._index.txt +6 -0
  465. package/dist/web/settings/__next._tree.txt +2 -0
  466. package/dist/web/settings/__next.settings.__PAGE__.txt +9 -0
  467. package/dist/web/settings/__next.settings.txt +5 -0
  468. package/dist/web/settings.html +1 -0
  469. package/dist/web/settings.txt +21 -0
  470. package/dist/web/skills/__next._full.txt +21 -0
  471. package/dist/web/skills/__next._head.txt +6 -0
  472. package/dist/web/skills/__next._index.txt +6 -0
  473. package/dist/web/skills/__next._tree.txt +2 -0
  474. package/dist/web/skills/__next.skills.__PAGE__.txt +9 -0
  475. package/dist/web/skills/__next.skills.txt +5 -0
  476. package/dist/web/skills.html +1 -0
  477. package/dist/web/skills.txt +21 -0
  478. package/package.json +54 -0
  479. package/template/AGENTS.md +285 -0
  480. package/template/CLAUDE.md +285 -0
  481. package/template/config.default.yaml +71 -0
  482. package/template/docs/architecture.md +74 -0
  483. package/template/docs/connectors.md +72 -0
  484. package/template/docs/cron.md +137 -0
  485. package/template/docs/mcp.md +108 -0
  486. package/template/docs/org.md +105 -0
  487. package/template/docs/overview.md +39 -0
  488. package/template/docs/self-modification.md +65 -0
  489. package/template/docs/skills.md +58 -0
  490. package/template/knowledge/.gitkeep +0 -0
  491. package/template/migrations/.gitkeep +0 -0
  492. package/template/migrations/0.1.0/MIGRATION.md +25 -0
  493. package/template/migrations/0.2.0/MIGRATION.md +41 -0
  494. package/template/migrations/0.2.0/files/config.default.yaml +30 -0
  495. package/template/migrations/0.3.0/MIGRATION.md +57 -0
  496. package/template/migrations/0.3.0/files/config.default.yaml +62 -0
  497. package/template/migrations/0.3.0/files/docs/mcp.md +108 -0
  498. package/template/migrations/0.7.3/MIGRATION.md +63 -0
  499. package/template/migrations/0.7.3/files/AGENTS.md +188 -0
  500. package/template/migrations/0.7.3/files/CLAUDE.md +127 -0
  501. package/template/migrations/0.7.5/MIGRATION.md +78 -0
  502. package/template/migrations/0.8.0/MIGRATION.md +73 -0
  503. package/template/migrations/0.9.0/MIGRATION.md +82 -0
  504. package/template/skills/cron-manager/SKILL.md +127 -0
  505. package/template/skills/find-and-install/SKILL.md +92 -0
  506. package/template/skills/management/SKILL.md +226 -0
  507. package/template/skills/migrate/SKILL.md +154 -0
  508. package/template/skills/new/SKILL.md +19 -0
  509. package/template/skills/onboarding/SKILL.md +106 -0
  510. package/template/skills/self-heal/SKILL.md +114 -0
  511. package/template/skills/skill-creator/SKILL.md +112 -0
  512. package/template/skills/status/SKILL.md +19 -0
  513. package/template/skills/sync/SKILL.md +67 -0
  514. package/template/skills.json +3 -0
@@ -0,0 +1,74 @@
1
+ # Architecture
2
+
3
+ {{portalName}} runs as a single Node.js process acting as a gateway between external connectors and AI engines.
4
+
5
+ ## Components
6
+
7
+ ```
8
+ ┌─────────────────────────────────────────────────┐
9
+ │ {{portalName}} Gateway │
10
+ │ │
11
+ │ ┌───────────┐ ┌────────────┐ ┌────────────┐ │
12
+ │ │ HTTP Server│ │ WebSocket │ │ Cron │ │
13
+ │ │ REST + UI │ │ Server │ │ Scheduler │ │
14
+ │ └─────┬─────┘ └─────┬──────┘ └─────┬──────┘ │
15
+ │ │ │ │ │
16
+ │ ┌─────┴───────────────┴───────────────┴──────┐ │
17
+ │ │ Session Manager │ │
18
+ │ │ Routes messages, manages engine lifecycle │ │
19
+ │ └─────────────────┬──────────────────────────┘ │
20
+ │ │ │
21
+ │ ┌─────────────────┴──────────────────────────┐ │
22
+ │ │ Engine Abstraction │ │
23
+ │ │ ┌──────────────┐ ┌───────────────────┐ │ │
24
+ │ │ │ Claude Engine │ │ Codex Engine │ │ │
25
+ │ │ │ (spawns CLI) │ │ (uses SDK) │ │ │
26
+ │ │ └──────────────┘ └───────────────────┘ │ │
27
+ │ └────────────────────────────────────────────┘ │
28
+ │ │
29
+ │ ┌────────────┐ ┌────────────┐ ┌───────────┐ │
30
+ │ │ Connector │ │ File │ │ SQLite │ │
31
+ │ │ System │ │ Watcher │ │ Registry │ │
32
+ │ └────────────┘ └────────────┘ └───────────┘ │
33
+ └─────────────────────────────────────────────────┘
34
+ ```
35
+
36
+ ### HTTP Server
37
+ REST API for session management, configuration, and health checks. Also serves the static web UI.
38
+
39
+ ### WebSocket Server
40
+ Pushes live events (session updates, engine output, cron results) to connected clients.
41
+
42
+ ### Session Manager
43
+ Central router. Receives messages from connectors, resolves the target employee and engine, creates or reuses sessions, and delivers responses back through the originating connector.
44
+
45
+ ### Engine Abstraction
46
+ Uniform interface over different AI backends:
47
+ - **Claude Engine**: Spawns `claude` CLI as a child process with `--resume` for session continuity
48
+ - **Codex Engine**: Uses the Codex SDK directly in-process
49
+
50
+ ### Connector System
51
+ Modular adapters that implement a standard interface. Each connector translates between its platform's message format and {{portalName}}'s internal message format. See `connectors.md`.
52
+
53
+ ### Cron Scheduler
54
+ Uses `node-cron` to run scheduled AI jobs. Watches `cron/jobs.json` for hot-reload. See `cron.md`.
55
+
56
+ ### File Watcher
57
+ Uses `chokidar` to watch `~/.jinn/` for changes and trigger appropriate reloads:
58
+ - `config.yaml` changes → reload gateway configuration
59
+ - `cron/jobs.json` changes → reschedule cron jobs
60
+ - `org/` changes → rebuild employee registry
61
+
62
+ ### SQLite Session Registry
63
+ Stores session metadata (id, engine, employee, connector source, timestamps) in `jinn.db`.
64
+
65
+ ## Data Flow
66
+
67
+ 1. Connector receives an external message (e.g., Slack message)
68
+ 2. Connector normalizes the message and calls session manager
69
+ 3. Session manager resolves the target employee and engine
70
+ 4. Session manager creates or reuses a session for the source reference
71
+ 5. Engine processes the message (Claude CLI or Codex SDK)
72
+ 6. Engine streams or returns the result
73
+ 7. Session manager delivers the result back through the originating connector
74
+ 8. WebSocket server broadcasts the event to any connected web UI clients
@@ -0,0 +1,72 @@
1
+ # Connectors
2
+
3
+ Connectors are modular adapters that bridge external messaging platforms with {{portalName}}'s session manager.
4
+
5
+ ## Connector Interface
6
+
7
+ ```typescript
8
+ interface Connector {
9
+ name: string;
10
+ start(): Promise<void>;
11
+ stop(): Promise<void>;
12
+ sendMessage(sourceRef: string, text: string): Promise<void>;
13
+ addReaction(sourceRef: string, emoji: string): Promise<void>;
14
+ removeReaction(sourceRef: string, emoji: string): Promise<void>;
15
+ editMessage(sourceRef: string, text: string): Promise<void>;
16
+ onMessage(handler: (msg: IncomingMessage) => void): void;
17
+ }
18
+
19
+ interface IncomingMessage {
20
+ sourceRef: string; // Unique identifier for routing
21
+ text: string; // Message content
22
+ userId: string; // Platform user ID
23
+ userName: string; // Display name
24
+ connector: string; // Connector name
25
+ }
26
+ ```
27
+
28
+ ## Slack Connector
29
+
30
+ Uses `@slack/bolt` with Socket Mode (no public URL required).
31
+
32
+ ### Configuration
33
+
34
+ ```yaml
35
+ connectors:
36
+ slack:
37
+ appToken: xapp-... # Socket Mode app token
38
+ botToken: xoxb-... # Bot user OAuth token
39
+ ```
40
+
41
+ ### Thread Mapping
42
+
43
+ Slack messages are mapped to sessions based on conversation context:
44
+
45
+ | Slack Context | Source Ref Format | Session Behavior |
46
+ |---|---|---|
47
+ | Direct message | `slack:dm:<userId>` | One session per DM user |
48
+ | Channel root message | `slack:<channelId>` | One session per channel |
49
+ | Thread reply | `slack:<channelId>:<threadTs>` | One session per thread |
50
+
51
+ ### Reaction Workflow
52
+
53
+ Reactions provide visual feedback during processing:
54
+
55
+ 1. Message received → add :eyes: reaction (acknowledged)
56
+ 2. Engine processing...
57
+ 3. On success → remove :eyes:, add :white_check_mark:
58
+ 4. On error → remove :eyes:, add :x:
59
+
60
+ ### Employee Routing
61
+
62
+ - Default: messages route to the default employee ({{portalName}})
63
+ - `@mention`: messages mentioning a specific employee name route to that employee
64
+ - Thread continuity: replies in a thread continue with the same employee
65
+
66
+ ## Future Connectors
67
+
68
+ The connector interface is designed for additional platforms:
69
+ - **Discord**: Bot integration via discord.js
70
+ - **iMessage**: macOS-only via AppleScript bridge
71
+ - **Web UI**: Built-in, served by the HTTP server
72
+ - **CLI**: Direct terminal input/output
@@ -0,0 +1,137 @@
1
+ # Cron
2
+
3
+ {{portalName}} supports scheduled AI jobs defined in `~/.jinn/cron/jobs.json`.
4
+
5
+ ## Job Schema
6
+
7
+ ```typescript
8
+ interface CronJob {
9
+ id: string; // Unique identifier
10
+ name: string; // Human-readable name
11
+ enabled: boolean; // Whether the job is active
12
+ schedule: string; // Cron expression (standard 5-field)
13
+ timezone?: string; // IANA timezone (default: system timezone)
14
+ engine: string; // "claude" or "codex"
15
+ model?: string; // Override default model
16
+ employee?: string; // Employee persona to use
17
+ prompt: string; // The prompt to send to the engine
18
+ delivery?: { // Optional output delivery
19
+ connector: string; // Connector name (e.g., "slack")
20
+ channel: string; // Target channel or user
21
+ };
22
+ }
23
+ ```
24
+
25
+ ## Schedule Format
26
+
27
+ Standard 5-field cron expressions:
28
+
29
+ ```
30
+ ┌────────── minute (0-59)
31
+ │ ┌──────── hour (0-23)
32
+ │ │ ┌────── day of month (1-31)
33
+ │ │ │ ┌──── month (1-12)
34
+ │ │ │ │ ┌── day of week (0-7, 0 and 7 = Sunday)
35
+ │ │ │ │ │
36
+ * * * * *
37
+ ```
38
+
39
+ Examples:
40
+ - `0 9 * * 1-5` — 9:00 AM, Monday through Friday
41
+ - `*/30 * * * *` — Every 30 minutes
42
+ - `0 0 1 * *` — Midnight on the 1st of each month
43
+
44
+ ## Hot Reload
45
+
46
+ The gateway watches `cron/jobs.json` with chokidar. When the file changes:
47
+ 1. All existing scheduled jobs are cancelled
48
+ 2. The new file is parsed and validated
49
+ 3. Enabled jobs are rescheduled with the updated definitions
50
+
51
+ No restart required. Engines can edit `jobs.json` directly to create or modify scheduled jobs.
52
+
53
+ ## Run Logs
54
+
55
+ Each job execution is logged to `~/.jinn/cron/runs/<jobId>.jsonl`. Each line is a JSON object:
56
+
57
+ ```json
58
+ {
59
+ "runId": "run_abc123",
60
+ "jobId": "daily-standup",
61
+ "startedAt": "2026-01-15T09:00:00.000Z",
62
+ "completedAt": "2026-01-15T09:00:45.000Z",
63
+ "status": "success",
64
+ "output": "..."
65
+ }
66
+ ```
67
+
68
+ ## Delegation Pattern
69
+
70
+ When a cron job produces analytical, reporting, or decision-informing output, it should **always target {{portalSlug}}** (the COO), not the employee directly. {{portalName}} then delegates to the employee via a child session, reviews the output, filters noise, and delivers the final result.
71
+
72
+ **Correct** — cron → {{portalSlug}} → employee (via child session) → {{portalSlug}} reviews → delivery:
73
+ ```json
74
+ {
75
+ "id": "daily-pulse",
76
+ "name": "Daily Pulse Analytics",
77
+ "enabled": true,
78
+ "schedule": "0 8 * * *",
79
+ "engine": "claude",
80
+ "employee": "{{portalSlug}}",
81
+ "prompt": "Delegate to @pulse: pull analytics for all products. Review the output, filter noise, and deliver a concise summary of what matters.",
82
+ "delivery": {
83
+ "connector": "slack",
84
+ "channel": "#analytics"
85
+ }
86
+ }
87
+ ```
88
+
89
+ **Incorrect** — cron → employee → delivery (bypasses COO review):
90
+ ```json
91
+ {
92
+ "id": "daily-pulse",
93
+ "name": "Daily Pulse Analytics",
94
+ "enabled": true,
95
+ "schedule": "0 8 * * *",
96
+ "engine": "claude",
97
+ "employee": "pulse",
98
+ "prompt": "Pull analytics for all products and summarize.",
99
+ "delivery": {
100
+ "connector": "slack",
101
+ "channel": "#analytics"
102
+ }
103
+ }
104
+ ```
105
+
106
+ Direct employee-to-user delivery is only acceptable for simple, no-review-needed tasks (e.g. a health check ping). The gateway will log a warning if it detects a non-{{portalSlug}} employee with delivery configured.
107
+
108
+ ## Example Configuration
109
+
110
+ ```json
111
+ [
112
+ {
113
+ "id": "daily-standup",
114
+ "name": "Daily Standup Summary",
115
+ "enabled": true,
116
+ "schedule": "0 9 * * 1-5",
117
+ "timezone": "America/New_York",
118
+ "engine": "claude",
119
+ "employee": "{{portalSlug}}",
120
+ "prompt": "Delegate to @project-manager: review yesterday's board activity across all departments. Review the output and write a concise standup summary.",
121
+ "delivery": {
122
+ "connector": "slack",
123
+ "channel": "#engineering"
124
+ }
125
+ },
126
+ {
127
+ "id": "weekly-cleanup",
128
+ "name": "Weekly Skill Review",
129
+ "enabled": true,
130
+ "schedule": "0 18 * * 5",
131
+ "timezone": "America/New_York",
132
+ "engine": "claude",
133
+ "employee": "{{portalSlug}}",
134
+ "prompt": "Review all skills in ~/.jinn/skills/ and suggest improvements or removals for unused skills."
135
+ }
136
+ ]
137
+ ```
@@ -0,0 +1,108 @@
1
+ # MCP (Model Context Protocol) Integration
2
+
3
+ {{portalName}} automatically configures MCP servers for AI engine sessions, giving employees access to browser automation, web search, and gateway tools without manual setup.
4
+
5
+ ## How It Works
6
+
7
+ 1. MCP servers are defined in `config.yaml` under the `mcp:` section
8
+ 2. When a session starts, {{portalName}} resolves which MCP servers the employee needs
9
+ 3. A temporary MCP config JSON file is written to `~/.jinn/tmp/mcp/`
10
+ 4. The file is passed to Claude Code via `--mcp-config <path>`
11
+ 5. The file is cleaned up after the session completes
12
+
13
+ ## Built-in MCP Servers
14
+
15
+ ### Browser (Playwright)
16
+ Full browser automation — navigate, click, type, screenshot, extract content.
17
+
18
+ ```yaml
19
+ mcp:
20
+ browser:
21
+ enabled: true
22
+ provider: playwright # or "puppeteer"
23
+ ```
24
+
25
+ ### Web Search (Brave)
26
+ Search the web and get structured results.
27
+
28
+ ```yaml
29
+ mcp:
30
+ search:
31
+ enabled: true
32
+ provider: brave
33
+ apiKey: ${BRAVE_API_KEY} # reads from environment variable
34
+ ```
35
+
36
+ ### Fetch
37
+ Extract readable content from URLs (HTML → markdown/text).
38
+
39
+ ```yaml
40
+ mcp:
41
+ fetch:
42
+ enabled: true
43
+ ```
44
+
45
+ ### Gateway
46
+ Built-in MCP server that wraps {{portalName}}'s own API. Gives employees tools to:
47
+ - Send messages via connectors (Slack, etc.)
48
+ - List and query sessions
49
+ - Manage cron jobs
50
+ - Query the org structure
51
+ - Update department boards
52
+
53
+ ```yaml
54
+ mcp:
55
+ gateway:
56
+ enabled: true # enabled by default
57
+ ```
58
+
59
+ ## Custom MCP Servers
60
+
61
+ Add any MCP server via the `custom:` section:
62
+
63
+ ```yaml
64
+ mcp:
65
+ custom:
66
+ my-database:
67
+ enabled: true
68
+ command: npx
69
+ args: ["-y", "@my/mcp-server-postgres"]
70
+ env:
71
+ DATABASE_URL: ${DATABASE_URL}
72
+ my-api:
73
+ command: node
74
+ args: ["/path/to/my-mcp-server.js"]
75
+ ```
76
+
77
+ ## Per-Employee Overrides
78
+
79
+ Employees can opt out of MCP servers or request only specific ones:
80
+
81
+ ```yaml
82
+ # In employee YAML (e.g. org/engineering/backend-dev.yaml)
83
+ name: backend-dev
84
+ mcp: false # No MCP servers at all
85
+
86
+ # Or specific servers only:
87
+ mcp:
88
+ - search
89
+ - gateway
90
+ ```
91
+
92
+ By default, all globally enabled MCP servers are available to all employees.
93
+
94
+ ## Environment Variables
95
+
96
+ API keys and secrets should use `${VAR_NAME}` syntax to reference environment variables:
97
+
98
+ ```yaml
99
+ mcp:
100
+ search:
101
+ apiKey: ${BRAVE_API_KEY}
102
+ custom:
103
+ stripe:
104
+ env:
105
+ STRIPE_KEY: ${STRIPE_SECRET_KEY}
106
+ ```
107
+
108
+ This keeps secrets out of config files.
@@ -0,0 +1,105 @@
1
+ # Organization
2
+
3
+ {{portalName}} supports an organizational structure with employee personas, departments, ranks, and inter-agent communication through boards.
4
+
5
+ ## Employee Personas
6
+
7
+ Employee files live at `~/.jinn/org/<department>/<name>.yaml`.
8
+
9
+ ```yaml
10
+ name: alice
11
+ displayName: Alice
12
+ department: engineering
13
+ rank: senior
14
+ engine: claude
15
+ model: opus
16
+ persona: |
17
+ You are Alice, a senior engineer focused on backend systems.
18
+ You write clean, well-tested code and prefer simple solutions.
19
+ You review PRs thoroughly and flag potential performance issues.
20
+ ```
21
+
22
+ ### Fields
23
+
24
+ | Field | Type | Required | Description |
25
+ |---|---|---|---|
26
+ | `name` | string | yes | Unique identifier (lowercase, no spaces) |
27
+ | `displayName` | string | yes | Human-readable name |
28
+ | `department` | string | yes | Department directory name |
29
+ | `rank` | string | yes | One of: executive, manager, senior, employee |
30
+ | `engine` | string | yes | Engine to use: "claude" or "codex" |
31
+ | `model` | string | no | Model override (default from config) |
32
+ | `persona` | string | yes | System prompt defining personality and behavior |
33
+
34
+ ## Departments
35
+
36
+ Each department is a directory under `~/.jinn/org/` containing:
37
+
38
+ ```
39
+ ~/.jinn/org/engineering/
40
+ department.yaml # Department metadata
41
+ board.json # Shared task board
42
+ alice.yaml # Employee persona
43
+ bob.yaml # Employee persona
44
+ ```
45
+
46
+ ### department.yaml
47
+
48
+ ```yaml
49
+ name: engineering
50
+ displayName: Engineering
51
+ description: Builds and maintains the product codebase.
52
+ ```
53
+
54
+ ### board.json
55
+
56
+ A JSON array of task objects used for inter-agent communication:
57
+
58
+ ```json
59
+ [
60
+ {
61
+ "id": "task_001",
62
+ "title": "Refactor auth module",
63
+ "assignee": "alice",
64
+ "status": "in-progress",
65
+ "priority": "high",
66
+ "description": "Move auth logic into a dedicated service class.",
67
+ "createdAt": "2026-01-10T14:00:00.000Z",
68
+ "updatedAt": "2026-01-11T09:30:00.000Z"
69
+ }
70
+ ]
71
+ ```
72
+
73
+ Task fields: `id`, `title`, `assignee`, `status` (open, in-progress, done, blocked), `priority` (low, medium, high, critical), `description`, `createdAt`, `updatedAt`.
74
+
75
+ ## Ranks
76
+
77
+ | Rank | Privileges |
78
+ |---|---|
79
+ | **executive** | Full access. Can message any employee, modify org structure, create departments. {{portalName}} holds this rank. |
80
+ | **manager** | Can message employees in their department. Can assign tasks on their department's board. |
81
+ | **senior** | Can message employees in their department. Can update tasks assigned to them. |
82
+ | **employee** | Can update tasks assigned to them. Can post to their department's board. |
83
+
84
+ ## Communication
85
+
86
+ - **Downward**: Higher-ranked agents write tasks to lower-ranked agents' department boards
87
+ - **@mentions**: Messages containing `@name` route to that specific employee
88
+ - **Board-based**: Agents check their department's `board.json` for assigned tasks
89
+ - **Cross-department**: Executives and managers can write to any department's board
90
+
91
+ ## Default Organization
92
+
93
+ {{portalName}} ships with a single executive employee:
94
+
95
+ ```yaml
96
+ name: {{portalSlug}}
97
+ displayName: {{portalName}}
98
+ department: executive
99
+ rank: executive
100
+ engine: claude
101
+ model: opus
102
+ persona: |
103
+ You are {{portalName}}, the executive AI assistant and gateway administrator.
104
+ You manage the organization, delegate tasks, and handle direct requests.
105
+ ```
@@ -0,0 +1,39 @@
1
+ # {{portalName}} Overview
2
+
3
+ {{portalName}} is a lightweight AI gateway daemon that wraps professional AI CLI tools as "engines." It is published as `jinn-cli`.
4
+
5
+ ## Core Principle
6
+
7
+ **{{portalName}} is a bus, not a brain.** All AI intelligence comes from the engines natively. {{portalName}} adds no custom agentic loop, no prompt engineering layer, no opinions on how AI should behave. It delegates everything to professional tools (Claude Code CLI, Codex SDK) and focuses solely on routing, scheduling, and connectivity.
8
+
9
+ ## What {{portalName}} Does
10
+
11
+ - **Gateway**: Single Node.js process that accepts messages from multiple sources and routes them to AI engines
12
+ - **Connectors**: Modular input/output adapters (Slack, web UI, future: Discord, iMessage)
13
+ - **Cron**: Scheduled AI jobs with hot-reloadable configuration
14
+ - **Organization**: Employee personas with departments, ranks, and inter-agent communication via boards
15
+ - **Skills**: Markdown instruction sets that engines read and follow natively
16
+ - **Self-modification**: {{portalName}} can edit its own config, skills, cron jobs, and org structure at runtime
17
+
18
+ ## How It Differs from Custom Agentic Frameworks
19
+
20
+ Traditional approaches build custom tool-calling loops, manage context windows, and implement retry logic. {{portalName}} does none of that. The engines (Claude Code, Codex) already handle tool use, file editing, command execution, and multi-step reasoning. {{portalName}} just connects them to the outside world.
21
+
22
+ ## Directory Structure
23
+
24
+ ```
25
+ ~/.jinn/
26
+ config.yaml # Gateway configuration
27
+ jinn.db # SQLite session registry
28
+ docs/ # These reference docs
29
+ skills/ # Skill directories with SKILL.md files
30
+ cron/
31
+ jobs.json # Cron job definitions
32
+ runs/ # Run logs (JSONL)
33
+ org/
34
+ <department>/
35
+ department.yaml # Department config
36
+ board.json # Task board
37
+ <name>.yaml # Employee persona
38
+ logs/ # Application logs
39
+ ```
@@ -0,0 +1,65 @@
1
+ # Self-Modification
2
+
3
+ {{portalName}}'s engines operate within `~/.jinn/` and can modify any file in that directory. This enables {{portalName}} to update its own configuration, create skills, manage cron jobs, and restructure the organization at runtime.
4
+
5
+ ## What {{portalName}} Can Edit
6
+
7
+ | File/Directory | Effect of Modification |
8
+ |---|---|
9
+ | `config.yaml` | File watcher triggers full config reload |
10
+ | `cron/jobs.json` | File watcher triggers cron reschedule |
11
+ | `org/**/*.yaml` | File watcher triggers employee registry rebuild |
12
+ | `org/**/board.json` | Read on demand by employees; no watcher needed |
13
+ | `skills/*/SKILL.md` | Read on demand by engines; no watcher needed |
14
+ | `skills/**/*` | Supporting skill data; read on demand |
15
+
16
+ ## File Watcher Reactions
17
+
18
+ The gateway uses chokidar to watch for changes:
19
+
20
+ - **config.yaml** → Parse YAML, validate schema, reload gateway configuration (port, engines, connectors, logging)
21
+ - **cron/jobs.json** → Cancel all scheduled jobs, parse JSON, validate schema, reschedule enabled jobs
22
+ - **org/\*\*/\*.yaml** → Rebuild the employee registry from all persona and department YAML files
23
+
24
+ Changes take effect immediately. No restart required.
25
+
26
+ ## Safety Guidelines
27
+
28
+ Engines have full file access within `~/.jinn/`. To avoid breaking the gateway:
29
+
30
+ ### Do
31
+
32
+ - Validate YAML before writing to `config.yaml` (must be valid YAML with expected schema)
33
+ - Validate JSON before writing to `jobs.json` or `board.json`
34
+ - Use atomic writes (write to temp file, then rename) for critical files
35
+ - Back up files before making destructive changes
36
+ - Test cron expressions before adding them to `jobs.json`
37
+
38
+ ### Do Not
39
+
40
+ - Break `config.yaml` structure — invalid YAML will prevent config reload
41
+ - Corrupt `jinn.db` — the SQLite database is managed by the gateway process
42
+ - Write invalid JSON to `jobs.json` — this will cancel all cron jobs with nothing to replace them
43
+ - Delete the `docs/` directory — these reference docs are needed for self-awareness
44
+ - Modify files outside `~/.jinn/` unless explicitly instructed by the user
45
+
46
+ ## Example: Creating a Cron Job at Runtime
47
+
48
+ An engine can create a new cron job by reading `cron/jobs.json`, appending a new entry, and writing it back:
49
+
50
+ ```
51
+ 1. Read ~/.jinn/cron/jobs.json
52
+ 2. Parse the JSON array
53
+ 3. Append new job object with unique id, schedule, prompt, etc.
54
+ 4. Validate the full array
55
+ 5. Write back to ~/.jinn/cron/jobs.json
56
+ 6. The file watcher automatically reschedules all jobs
57
+ ```
58
+
59
+ ## Example: Adding a New Employee
60
+
61
+ ```
62
+ 1. Create ~/.jinn/org/<department>/<name>.yaml with required fields
63
+ 2. The file watcher detects the new file and rebuilds the employee registry
64
+ 3. The new employee is immediately available for @mention routing
65
+ ```
@@ -0,0 +1,58 @@
1
+ # Skills
2
+
3
+ Skills are markdown instruction sets that engines read and follow. There is no runtime, no loading system, no plugin API. Engines handle skills natively by reading the SKILL.md file.
4
+
5
+ ## How Skills Work
6
+
7
+ Each skill is a directory in `~/.jinn/skills/` containing at minimum a `SKILL.md` file. When an engine starts a session, it has access to the skills directory and can read any skill's instructions.
8
+
9
+ The `SKILL.md` file contains:
10
+ - **Trigger description**: When this skill should be activated
11
+ - **Instructions**: Step-by-step directions for the engine
12
+ - **Data file references**: Paths to any supporting files in the skill directory
13
+
14
+ ## Creating a Skill
15
+
16
+ ```
17
+ ~/.jinn/skills/
18
+ my-skill/
19
+ SKILL.md # Required: instructions
20
+ data.json # Optional: supporting data
21
+ template.txt # Optional: templates, examples, etc.
22
+ ```
23
+
24
+ ### Example SKILL.md
25
+
26
+ ```markdown
27
+ # Deploy Notification Skill
28
+
29
+ ## Trigger
30
+ When the user says "deploy" or asks about deployment status.
31
+
32
+ ## Instructions
33
+ 1. Read the deployment config from `data/deploy-targets.json` in this skill directory
34
+ 2. Check the current git branch and latest commit
35
+ 3. Format a deployment summary with target environment, branch, and commit hash
36
+ 4. Ask for confirmation before proceeding
37
+
38
+ ## Data Files
39
+ - `deploy-targets.json`: List of deployment targets with URLs and environment names
40
+ ```
41
+
42
+ ## Pre-packaged Skills
43
+
44
+ {{portalName}} ships with several default skills:
45
+
46
+ - **self**: Instructions for {{portalName}} to understand and modify its own configuration
47
+ - **slack**: Slack-specific behavior and formatting guidelines
48
+ - **cron**: How to create and manage scheduled jobs
49
+ - **org**: Working with the organization structure and employee personas
50
+ - **skills**: Meta-skill for creating and managing other skills
51
+
52
+ ## Key Points
53
+
54
+ - Skills are just files. Engines read them as context.
55
+ - No compilation, no imports, no runtime hooks.
56
+ - Any file format works as supporting data (JSON, YAML, CSV, plain text).
57
+ - Skills can reference other skills by path.
58
+ - Engines decide when and how to apply skill instructions based on the trigger description.
File without changes
File without changes