openryoko 2026.10.8 → 2026.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (691) hide show
  1. package/dist/bin/jimmy.js +51 -1
  2. package/dist/bin/jimmy.js.map +1 -1
  3. package/dist/package.json +2 -1
  4. package/dist/src/backup/archive.d.ts +65 -0
  5. package/dist/src/backup/archive.d.ts.map +1 -0
  6. package/dist/src/backup/archive.js +214 -0
  7. package/dist/src/backup/archive.js.map +1 -0
  8. package/dist/src/backup/catalog.d.ts +64 -0
  9. package/dist/src/backup/catalog.d.ts.map +1 -0
  10. package/dist/src/backup/catalog.js +252 -0
  11. package/dist/src/backup/catalog.js.map +1 -0
  12. package/dist/src/backup/database-restore.d.ts +63 -0
  13. package/dist/src/backup/database-restore.d.ts.map +1 -0
  14. package/dist/src/backup/database-restore.js +236 -0
  15. package/dist/src/backup/database-restore.js.map +1 -0
  16. package/dist/src/backup/database-source.d.ts +70 -0
  17. package/dist/src/backup/database-source.d.ts.map +1 -0
  18. package/dist/src/backup/database-source.js +70 -0
  19. package/dist/src/backup/database-source.js.map +1 -0
  20. package/dist/src/backup/format.d.ts +4 -0
  21. package/dist/src/backup/format.d.ts.map +1 -0
  22. package/dist/src/backup/format.js +15 -0
  23. package/dist/src/backup/format.js.map +1 -0
  24. package/dist/src/backup/gateway-liveness.d.ts +44 -0
  25. package/dist/src/backup/gateway-liveness.d.ts.map +1 -0
  26. package/dist/src/backup/gateway-liveness.js +120 -0
  27. package/dist/src/backup/gateway-liveness.js.map +1 -0
  28. package/dist/src/backup/inspect.d.ts +45 -0
  29. package/dist/src/backup/inspect.d.ts.map +1 -0
  30. package/dist/src/backup/inspect.js +291 -0
  31. package/dist/src/backup/inspect.js.map +1 -0
  32. package/dist/src/backup/layout.d.ts +11 -0
  33. package/dist/src/backup/layout.d.ts.map +1 -0
  34. package/dist/src/backup/layout.js +16 -0
  35. package/dist/src/backup/layout.js.map +1 -0
  36. package/dist/src/backup/limits.d.ts +54 -0
  37. package/dist/src/backup/limits.d.ts.map +1 -0
  38. package/dist/src/backup/limits.js +59 -0
  39. package/dist/src/backup/limits.js.map +1 -0
  40. package/dist/src/backup/manifest.d.ts +45 -0
  41. package/dist/src/backup/manifest.d.ts.map +1 -0
  42. package/dist/src/backup/manifest.js +77 -0
  43. package/dist/src/backup/manifest.js.map +1 -0
  44. package/dist/src/backup/restore.d.ts +73 -0
  45. package/dist/src/backup/restore.d.ts.map +1 -0
  46. package/dist/src/backup/restore.js +685 -0
  47. package/dist/src/backup/restore.js.map +1 -0
  48. package/dist/src/backup/run.d.ts +76 -0
  49. package/dist/src/backup/run.d.ts.map +1 -0
  50. package/dist/src/backup/run.js +181 -0
  51. package/dist/src/backup/run.js.map +1 -0
  52. package/dist/src/backup/scheduler.d.ts +51 -0
  53. package/dist/src/backup/scheduler.d.ts.map +1 -0
  54. package/dist/src/backup/scheduler.js +198 -0
  55. package/dist/src/backup/scheduler.js.map +1 -0
  56. package/dist/src/backup/settings.d.ts +44 -0
  57. package/dist/src/backup/settings.d.ts.map +1 -0
  58. package/dist/src/backup/settings.js +91 -0
  59. package/dist/src/backup/settings.js.map +1 -0
  60. package/dist/src/backup/space.d.ts +22 -0
  61. package/dist/src/backup/space.d.ts.map +1 -0
  62. package/dist/src/backup/space.js +47 -0
  63. package/dist/src/backup/space.js.map +1 -0
  64. package/dist/src/backup/state.d.ts +46 -0
  65. package/dist/src/backup/state.d.ts.map +1 -0
  66. package/dist/src/backup/state.js +137 -0
  67. package/dist/src/backup/state.js.map +1 -0
  68. package/dist/src/backup/tar.d.ts +64 -0
  69. package/dist/src/backup/tar.d.ts.map +1 -0
  70. package/dist/src/backup/tar.js +274 -0
  71. package/dist/src/backup/tar.js.map +1 -0
  72. package/dist/src/backup/targets.d.ts +85 -0
  73. package/dist/src/backup/targets.d.ts.map +1 -0
  74. package/dist/src/backup/targets.js +104 -0
  75. package/dist/src/backup/targets.js.map +1 -0
  76. package/dist/src/backup/walk.d.ts +42 -0
  77. package/dist/src/backup/walk.d.ts.map +1 -0
  78. package/dist/src/backup/walk.js +324 -0
  79. package/dist/src/backup/walk.js.map +1 -0
  80. package/dist/src/cli/backup.d.ts +45 -0
  81. package/dist/src/cli/backup.d.ts.map +1 -0
  82. package/dist/src/cli/backup.js +344 -0
  83. package/dist/src/cli/backup.js.map +1 -0
  84. package/dist/src/cli/bundled-skills.d.ts +7 -1
  85. package/dist/src/cli/bundled-skills.d.ts.map +1 -1
  86. package/dist/src/cli/bundled-skills.js +12 -2
  87. package/dist/src/cli/bundled-skills.js.map +1 -1
  88. package/dist/src/cli/config-failure.d.ts +18 -0
  89. package/dist/src/cli/config-failure.d.ts.map +1 -0
  90. package/dist/src/cli/config-failure.js +39 -0
  91. package/dist/src/cli/config-failure.js.map +1 -0
  92. package/dist/src/cli/gateway-audit.d.ts +3 -0
  93. package/dist/src/cli/gateway-audit.d.ts.map +1 -1
  94. package/dist/src/cli/gateway-audit.js +61 -14
  95. package/dist/src/cli/gateway-audit.js.map +1 -1
  96. package/dist/src/cli/gateway-url-backup.d.ts +21 -0
  97. package/dist/src/cli/gateway-url-backup.d.ts.map +1 -0
  98. package/dist/src/cli/gateway-url-backup.js +87 -0
  99. package/dist/src/cli/gateway-url-backup.js.map +1 -0
  100. package/dist/src/cli/home-copy.d.ts +37 -0
  101. package/dist/src/cli/home-copy.d.ts.map +1 -0
  102. package/dist/src/cli/home-copy.js +155 -0
  103. package/dist/src/cli/home-copy.js.map +1 -0
  104. package/dist/src/cli/interactive-config.d.ts +5 -0
  105. package/dist/src/cli/interactive-config.d.ts.map +1 -1
  106. package/dist/src/cli/interactive-config.js +16 -7
  107. package/dist/src/cli/interactive-config.js.map +1 -1
  108. package/dist/src/cli/migrate.d.ts +20 -0
  109. package/dist/src/cli/migrate.d.ts.map +1 -1
  110. package/dist/src/cli/migrate.js +365 -68
  111. package/dist/src/cli/migrate.js.map +1 -1
  112. package/dist/src/cli/migration-declarations.d.ts +24 -0
  113. package/dist/src/cli/migration-declarations.d.ts.map +1 -0
  114. package/dist/src/cli/migration-declarations.js +54 -0
  115. package/dist/src/cli/migration-declarations.js.map +1 -0
  116. package/dist/src/cli/start.d.ts.map +1 -1
  117. package/dist/src/cli/start.js +40 -1
  118. package/dist/src/cli/start.js.map +1 -1
  119. package/dist/src/connectors/chunked-send.d.ts +27 -0
  120. package/dist/src/connectors/chunked-send.d.ts.map +1 -0
  121. package/dist/src/connectors/chunked-send.js +40 -0
  122. package/dist/src/connectors/chunked-send.js.map +1 -0
  123. package/dist/src/connectors/cron/index.d.ts +10 -0
  124. package/dist/src/connectors/cron/index.d.ts.map +1 -1
  125. package/dist/src/connectors/cron/index.js +26 -3
  126. package/dist/src/connectors/cron/index.js.map +1 -1
  127. package/dist/src/connectors/discord/attachments.d.ts +25 -0
  128. package/dist/src/connectors/discord/attachments.d.ts.map +1 -0
  129. package/dist/src/connectors/discord/attachments.js +33 -0
  130. package/dist/src/connectors/discord/attachments.js.map +1 -0
  131. package/dist/src/connectors/discord/format.d.ts +17 -1
  132. package/dist/src/connectors/discord/format.d.ts.map +1 -1
  133. package/dist/src/connectors/discord/format.js +36 -6
  134. package/dist/src/connectors/discord/format.js.map +1 -1
  135. package/dist/src/connectors/discord/index.d.ts +12 -0
  136. package/dist/src/connectors/discord/index.d.ts.map +1 -1
  137. package/dist/src/connectors/discord/index.js +47 -40
  138. package/dist/src/connectors/discord/index.js.map +1 -1
  139. package/dist/src/connectors/discord/remote.d.ts +45 -1
  140. package/dist/src/connectors/discord/remote.d.ts.map +1 -1
  141. package/dist/src/connectors/discord/remote.js +147 -22
  142. package/dist/src/connectors/discord/remote.js.map +1 -1
  143. package/dist/src/connectors/slack/attachments.d.ts +25 -0
  144. package/dist/src/connectors/slack/attachments.d.ts.map +1 -0
  145. package/dist/src/connectors/slack/attachments.js +32 -0
  146. package/dist/src/connectors/slack/attachments.js.map +1 -0
  147. package/dist/src/connectors/slack/auth-test-cache.d.ts +22 -0
  148. package/dist/src/connectors/slack/auth-test-cache.d.ts.map +1 -0
  149. package/dist/src/connectors/slack/auth-test-cache.js +34 -0
  150. package/dist/src/connectors/slack/auth-test-cache.js.map +1 -0
  151. package/dist/src/connectors/slack/format.d.ts +6 -1
  152. package/dist/src/connectors/slack/format.d.ts.map +1 -1
  153. package/dist/src/connectors/slack/format.js +65 -13
  154. package/dist/src/connectors/slack/format.js.map +1 -1
  155. package/dist/src/connectors/slack/index.d.ts +4 -0
  156. package/dist/src/connectors/slack/index.d.ts.map +1 -1
  157. package/dist/src/connectors/slack/index.js +64 -52
  158. package/dist/src/connectors/slack/index.js.map +1 -1
  159. package/dist/src/connectors/slack/provider-auth-blocks.d.ts +62 -0
  160. package/dist/src/connectors/slack/provider-auth-blocks.d.ts.map +1 -0
  161. package/dist/src/connectors/slack/provider-auth-blocks.js +204 -0
  162. package/dist/src/connectors/slack/provider-auth-blocks.js.map +1 -0
  163. package/dist/src/connectors/slack/provider-auth.d.ts +126 -0
  164. package/dist/src/connectors/slack/provider-auth.d.ts.map +1 -0
  165. package/dist/src/connectors/slack/provider-auth.js +357 -0
  166. package/dist/src/connectors/slack/provider-auth.js.map +1 -0
  167. package/dist/src/connectors/telegram/index.d.ts +5 -0
  168. package/dist/src/connectors/telegram/index.d.ts.map +1 -1
  169. package/dist/src/connectors/telegram/index.js +14 -22
  170. package/dist/src/connectors/telegram/index.js.map +1 -1
  171. package/dist/src/connectors/whatsapp/index.d.ts +3 -0
  172. package/dist/src/connectors/whatsapp/index.d.ts.map +1 -1
  173. package/dist/src/connectors/whatsapp/index.js +33 -14
  174. package/dist/src/connectors/whatsapp/index.js.map +1 -1
  175. package/dist/src/cron/alert-throttle.d.ts +28 -0
  176. package/dist/src/cron/alert-throttle.d.ts.map +1 -0
  177. package/dist/src/cron/alert-throttle.js +106 -0
  178. package/dist/src/cron/alert-throttle.js.map +1 -0
  179. package/dist/src/cron/jobs.d.ts +8 -0
  180. package/dist/src/cron/jobs.d.ts.map +1 -1
  181. package/dist/src/cron/jobs.js +27 -1
  182. package/dist/src/cron/jobs.js.map +1 -1
  183. package/dist/src/cron/run-outcome.d.ts +28 -0
  184. package/dist/src/cron/run-outcome.d.ts.map +1 -0
  185. package/dist/src/cron/run-outcome.js +66 -0
  186. package/dist/src/cron/run-outcome.js.map +1 -0
  187. package/dist/src/cron/runner.d.ts.map +1 -1
  188. package/dist/src/cron/runner.js +68 -5
  189. package/dist/src/cron/runner.js.map +1 -1
  190. package/dist/src/cron/scheduler.d.ts +8 -1
  191. package/dist/src/cron/scheduler.d.ts.map +1 -1
  192. package/dist/src/cron/scheduler.js +11 -4
  193. package/dist/src/cron/scheduler.js.map +1 -1
  194. package/dist/src/cron/waiting-fires.d.ts +18 -0
  195. package/dist/src/cron/waiting-fires.d.ts.map +1 -0
  196. package/dist/src/cron/waiting-fires.js +49 -0
  197. package/dist/src/cron/waiting-fires.js.map +1 -0
  198. package/dist/src/engines/claude-interactive.d.ts +19 -3
  199. package/dist/src/engines/claude-interactive.d.ts.map +1 -1
  200. package/dist/src/engines/claude-interactive.js +42 -17
  201. package/dist/src/engines/claude-interactive.js.map +1 -1
  202. package/dist/src/engines/claude.d.ts.map +1 -1
  203. package/dist/src/engines/claude.js +38 -5
  204. package/dist/src/engines/claude.js.map +1 -1
  205. package/dist/src/engines/codex.d.ts.map +1 -1
  206. package/dist/src/engines/codex.js +1 -0
  207. package/dist/src/engines/codex.js.map +1 -1
  208. package/dist/src/engines/gemini.d.ts.map +1 -1
  209. package/dist/src/engines/gemini.js +1 -0
  210. package/dist/src/engines/gemini.js.map +1 -1
  211. package/dist/src/gateway/api.d.ts.map +1 -1
  212. package/dist/src/gateway/api.js +184 -160
  213. package/dist/src/gateway/api.js.map +1 -1
  214. package/dist/src/gateway/config-redaction.d.ts +32 -0
  215. package/dist/src/gateway/config-redaction.d.ts.map +1 -0
  216. package/dist/src/gateway/config-redaction.js +139 -0
  217. package/dist/src/gateway/config-redaction.js.map +1 -0
  218. package/dist/src/gateway/config-revision.d.ts +46 -0
  219. package/dist/src/gateway/config-revision.d.ts.map +1 -0
  220. package/dist/src/gateway/config-revision.js +63 -0
  221. package/dist/src/gateway/config-revision.js.map +1 -0
  222. package/dist/src/gateway/connector-config.d.ts +21 -0
  223. package/dist/src/gateway/connector-config.d.ts.map +1 -0
  224. package/dist/src/gateway/connector-config.js +24 -0
  225. package/dist/src/gateway/connector-config.js.map +1 -0
  226. package/dist/src/gateway/daemon-entry.js +5 -0
  227. package/dist/src/gateway/daemon-entry.js.map +1 -1
  228. package/dist/src/gateway/engine-health-monitor.d.ts +67 -0
  229. package/dist/src/gateway/engine-health-monitor.d.ts.map +1 -0
  230. package/dist/src/gateway/engine-health-monitor.js +221 -0
  231. package/dist/src/gateway/engine-health-monitor.js.map +1 -0
  232. package/dist/src/gateway/files.d.ts +7 -1
  233. package/dist/src/gateway/files.d.ts.map +1 -1
  234. package/dist/src/gateway/files.js +110 -217
  235. package/dist/src/gateway/files.js.map +1 -1
  236. package/dist/src/gateway/onboarding-personalize.d.ts +2 -0
  237. package/dist/src/gateway/onboarding-personalize.d.ts.map +1 -1
  238. package/dist/src/gateway/onboarding-personalize.js +17 -1
  239. package/dist/src/gateway/onboarding-personalize.js.map +1 -1
  240. package/dist/src/gateway/portal-config.d.ts +17 -3
  241. package/dist/src/gateway/portal-config.d.ts.map +1 -1
  242. package/dist/src/gateway/portal-config.js +52 -3
  243. package/dist/src/gateway/portal-config.js.map +1 -1
  244. package/dist/src/gateway/request-origin.d.ts +9 -0
  245. package/dist/src/gateway/request-origin.d.ts.map +1 -1
  246. package/dist/src/gateway/request-origin.js +10 -0
  247. package/dist/src/gateway/request-origin.js.map +1 -1
  248. package/dist/src/gateway/server.d.ts.map +1 -1
  249. package/dist/src/gateway/server.js +82 -59
  250. package/dist/src/gateway/server.js.map +1 -1
  251. package/dist/src/gateway/slack-connect-rollback.d.ts +23 -0
  252. package/dist/src/gateway/slack-connect-rollback.d.ts.map +1 -0
  253. package/dist/src/gateway/slack-connect-rollback.js +53 -0
  254. package/dist/src/gateway/slack-connect-rollback.js.map +1 -0
  255. package/dist/src/gateway/status-reconciler.d.ts +25 -7
  256. package/dist/src/gateway/status-reconciler.d.ts.map +1 -1
  257. package/dist/src/gateway/status-reconciler.js +86 -43
  258. package/dist/src/gateway/status-reconciler.js.map +1 -1
  259. package/dist/src/gateway/watcher.d.ts.map +1 -1
  260. package/dist/src/gateway/watcher.js +44 -3
  261. package/dist/src/gateway/watcher.js.map +1 -1
  262. package/dist/src/mcp/gateway-server.js +21 -3
  263. package/dist/src/mcp/gateway-server.js.map +1 -1
  264. package/dist/src/mcp/resolver.d.ts.map +1 -1
  265. package/dist/src/mcp/resolver.js +51 -1
  266. package/dist/src/mcp/resolver.js.map +1 -1
  267. package/dist/src/models/service.d.ts.map +1 -1
  268. package/dist/src/models/service.js +14 -8
  269. package/dist/src/models/service.js.map +1 -1
  270. package/dist/src/provider-auth/discovery.d.ts +16 -0
  271. package/dist/src/provider-auth/discovery.d.ts.map +1 -0
  272. package/dist/src/provider-auth/discovery.js +66 -0
  273. package/dist/src/provider-auth/discovery.js.map +1 -0
  274. package/dist/src/provider-auth/failure-notices.d.ts +29 -0
  275. package/dist/src/provider-auth/failure-notices.d.ts.map +1 -0
  276. package/dist/src/provider-auth/failure-notices.js +48 -0
  277. package/dist/src/provider-auth/failure-notices.js.map +1 -0
  278. package/dist/src/provider-auth/failure-signal.d.ts +22 -0
  279. package/dist/src/provider-auth/failure-signal.d.ts.map +1 -0
  280. package/dist/src/provider-auth/failure-signal.js +79 -0
  281. package/dist/src/provider-auth/failure-signal.js.map +1 -0
  282. package/dist/src/provider-auth/index.d.ts +26 -0
  283. package/dist/src/provider-auth/index.d.ts.map +1 -0
  284. package/dist/src/provider-auth/index.js +51 -0
  285. package/dist/src/provider-auth/index.js.map +1 -0
  286. package/dist/src/provider-auth/input.d.ts +44 -0
  287. package/dist/src/provider-auth/input.d.ts.map +1 -0
  288. package/dist/src/provider-auth/input.js +86 -0
  289. package/dist/src/provider-auth/input.js.map +1 -0
  290. package/dist/src/provider-auth/providers.d.ts +26 -0
  291. package/dist/src/provider-auth/providers.d.ts.map +1 -0
  292. package/dist/src/provider-auth/providers.js +86 -0
  293. package/dist/src/provider-auth/providers.js.map +1 -0
  294. package/dist/src/provider-auth/runtime.d.ts +21 -0
  295. package/dist/src/provider-auth/runtime.d.ts.map +1 -0
  296. package/dist/src/provider-auth/runtime.js +104 -0
  297. package/dist/src/provider-auth/runtime.js.map +1 -0
  298. package/dist/src/provider-auth/service.d.ts +70 -0
  299. package/dist/src/provider-auth/service.d.ts.map +1 -0
  300. package/dist/src/provider-auth/service.js +349 -0
  301. package/dist/src/provider-auth/service.js.map +1 -0
  302. package/dist/src/provider-auth/terminal.d.ts +21 -0
  303. package/dist/src/provider-auth/terminal.d.ts.map +1 -0
  304. package/dist/src/provider-auth/terminal.js +46 -0
  305. package/dist/src/provider-auth/terminal.js.map +1 -0
  306. package/dist/src/provider-auth/types.d.ts +123 -0
  307. package/dist/src/provider-auth/types.d.ts.map +1 -0
  308. package/dist/src/provider-auth/types.js +10 -0
  309. package/dist/src/provider-auth/types.js.map +1 -0
  310. package/dist/src/sessions/accounting.d.ts +3 -0
  311. package/dist/src/sessions/accounting.d.ts.map +1 -1
  312. package/dist/src/sessions/accounting.js +5 -0
  313. package/dist/src/sessions/accounting.js.map +1 -1
  314. package/dist/src/sessions/backup-integrity.d.ts +45 -0
  315. package/dist/src/sessions/backup-integrity.d.ts.map +1 -0
  316. package/dist/src/sessions/backup-integrity.js +122 -0
  317. package/dist/src/sessions/backup-integrity.js.map +1 -0
  318. package/dist/src/sessions/backup.d.ts +40 -2
  319. package/dist/src/sessions/backup.d.ts.map +1 -1
  320. package/dist/src/sessions/backup.js +88 -12
  321. package/dist/src/sessions/backup.js.map +1 -1
  322. package/dist/src/sessions/callbacks.d.ts +9 -0
  323. package/dist/src/sessions/callbacks.d.ts.map +1 -1
  324. package/dist/src/sessions/callbacks.js +55 -10
  325. package/dist/src/sessions/callbacks.js.map +1 -1
  326. package/dist/src/sessions/completion-batching.d.ts +82 -0
  327. package/dist/src/sessions/completion-batching.d.ts.map +1 -0
  328. package/dist/src/sessions/completion-batching.js +126 -0
  329. package/dist/src/sessions/completion-batching.js.map +1 -0
  330. package/dist/src/sessions/connector-command-guard.d.ts +66 -0
  331. package/dist/src/sessions/connector-command-guard.d.ts.map +1 -0
  332. package/dist/src/sessions/connector-command-guard.js +145 -0
  333. package/dist/src/sessions/connector-command-guard.js.map +1 -0
  334. package/dist/src/sessions/context.d.ts.map +1 -1
  335. package/dist/src/sessions/context.js +3 -4
  336. package/dist/src/sessions/context.js.map +1 -1
  337. package/dist/src/sessions/engine-fallback.d.ts +43 -1
  338. package/dist/src/sessions/engine-fallback.d.ts.map +1 -1
  339. package/dist/src/sessions/engine-fallback.js +266 -15
  340. package/dist/src/sessions/engine-fallback.js.map +1 -1
  341. package/dist/src/sessions/engine-health-gate.d.ts +83 -0
  342. package/dist/src/sessions/engine-health-gate.d.ts.map +1 -0
  343. package/dist/src/sessions/engine-health-gate.js +186 -0
  344. package/dist/src/sessions/engine-health-gate.js.map +1 -0
  345. package/dist/src/sessions/engine-login.d.ts +58 -0
  346. package/dist/src/sessions/engine-login.d.ts.map +1 -0
  347. package/dist/src/sessions/engine-login.js +107 -0
  348. package/dist/src/sessions/engine-login.js.map +1 -0
  349. package/dist/src/sessions/fork.d.ts.map +1 -1
  350. package/dist/src/sessions/fork.js +3 -1
  351. package/dist/src/sessions/fork.js.map +1 -1
  352. package/dist/src/sessions/goal-execution.d.ts.map +1 -1
  353. package/dist/src/sessions/goal-execution.js +8 -1
  354. package/dist/src/sessions/goal-execution.js.map +1 -1
  355. package/dist/src/sessions/limit-failure-notice.d.ts +41 -0
  356. package/dist/src/sessions/limit-failure-notice.d.ts.map +1 -0
  357. package/dist/src/sessions/limit-failure-notice.js +87 -0
  358. package/dist/src/sessions/limit-failure-notice.js.map +1 -0
  359. package/dist/src/sessions/lost-turn.d.ts +39 -0
  360. package/dist/src/sessions/lost-turn.d.ts.map +1 -0
  361. package/dist/src/sessions/lost-turn.js +32 -0
  362. package/dist/src/sessions/lost-turn.js.map +1 -0
  363. package/dist/src/sessions/manager.d.ts.map +1 -1
  364. package/dist/src/sessions/manager.js +104 -47
  365. package/dist/src/sessions/manager.js.map +1 -1
  366. package/dist/src/sessions/new-session-engine.d.ts +42 -0
  367. package/dist/src/sessions/new-session-engine.d.ts.map +1 -0
  368. package/dist/src/sessions/new-session-engine.js +100 -0
  369. package/dist/src/sessions/new-session-engine.js.map +1 -0
  370. package/dist/src/sessions/origin-delivery.d.ts +50 -4
  371. package/dist/src/sessions/origin-delivery.d.ts.map +1 -1
  372. package/dist/src/sessions/origin-delivery.js +108 -9
  373. package/dist/src/sessions/origin-delivery.js.map +1 -1
  374. package/dist/src/sessions/queue.d.ts +14 -0
  375. package/dist/src/sessions/queue.d.ts.map +1 -1
  376. package/dist/src/sessions/queue.js +38 -2
  377. package/dist/src/sessions/queue.js.map +1 -1
  378. package/dist/src/sessions/registry.d.ts +4 -2
  379. package/dist/src/sessions/registry.d.ts.map +1 -1
  380. package/dist/src/sessions/registry.js +21 -4
  381. package/dist/src/sessions/registry.js.map +1 -1
  382. package/dist/src/sessions/reply-disposition.d.ts +8 -0
  383. package/dist/src/sessions/reply-disposition.d.ts.map +1 -1
  384. package/dist/src/sessions/reply-disposition.js +8 -0
  385. package/dist/src/sessions/reply-disposition.js.map +1 -1
  386. package/dist/src/sessions/restart-resume.d.ts +234 -0
  387. package/dist/src/sessions/restart-resume.d.ts.map +1 -0
  388. package/dist/src/sessions/restart-resume.js +596 -0
  389. package/dist/src/sessions/restart-resume.js.map +1 -0
  390. package/dist/src/sessions/speaker-prefix.d.ts.map +1 -1
  391. package/dist/src/sessions/speaker-prefix.js +3 -1
  392. package/dist/src/sessions/speaker-prefix.js.map +1 -1
  393. package/dist/src/sessions/turn-delivery.d.ts +26 -0
  394. package/dist/src/sessions/turn-delivery.d.ts.map +1 -0
  395. package/dist/src/sessions/turn-delivery.js +34 -0
  396. package/dist/src/sessions/turn-delivery.js.map +1 -0
  397. package/dist/src/sessions/unrequested-stop.d.ts +26 -0
  398. package/dist/src/sessions/unrequested-stop.d.ts.map +1 -0
  399. package/dist/src/sessions/unrequested-stop.js +19 -0
  400. package/dist/src/sessions/unrequested-stop.js.map +1 -0
  401. package/dist/src/sessions/usage-limit-wait.d.ts +14 -0
  402. package/dist/src/sessions/usage-limit-wait.d.ts.map +1 -0
  403. package/dist/src/sessions/usage-limit-wait.js +9 -0
  404. package/dist/src/sessions/usage-limit-wait.js.map +1 -0
  405. package/dist/src/shared/attachment-download.d.ts +41 -0
  406. package/dist/src/shared/attachment-download.d.ts.map +1 -0
  407. package/dist/src/shared/attachment-download.js +110 -0
  408. package/dist/src/shared/attachment-download.js.map +1 -0
  409. package/dist/src/shared/attachment-notice.d.ts +24 -0
  410. package/dist/src/shared/attachment-notice.d.ts.map +1 -0
  411. package/dist/src/shared/attachment-notice.js +37 -0
  412. package/dist/src/shared/attachment-notice.js.map +1 -0
  413. package/dist/src/shared/attachments.d.ts +65 -0
  414. package/dist/src/shared/attachments.d.ts.map +1 -0
  415. package/dist/src/shared/attachments.js +153 -0
  416. package/dist/src/shared/attachments.js.map +1 -0
  417. package/dist/src/shared/childEnv.d.ts +15 -0
  418. package/dist/src/shared/childEnv.d.ts.map +1 -1
  419. package/dist/src/shared/childEnv.js +15 -0
  420. package/dist/src/shared/childEnv.js.map +1 -1
  421. package/dist/src/shared/claude-auto-memory.d.ts +33 -0
  422. package/dist/src/shared/claude-auto-memory.d.ts.map +1 -0
  423. package/dist/src/shared/claude-auto-memory.js +156 -0
  424. package/dist/src/shared/claude-auto-memory.js.map +1 -0
  425. package/dist/src/shared/claude-limit-reset.d.ts +54 -0
  426. package/dist/src/shared/claude-limit-reset.d.ts.map +1 -0
  427. package/dist/src/shared/claude-limit-reset.js +99 -0
  428. package/dist/src/shared/claude-limit-reset.js.map +1 -0
  429. package/dist/src/shared/config-error.d.ts +21 -0
  430. package/dist/src/shared/config-error.d.ts.map +1 -0
  431. package/dist/src/shared/config-error.js +37 -0
  432. package/dist/src/shared/config-error.js.map +1 -0
  433. package/dist/src/shared/config-file.d.ts +57 -0
  434. package/dist/src/shared/config-file.d.ts.map +1 -0
  435. package/dist/src/shared/config-file.js +217 -0
  436. package/dist/src/shared/config-file.js.map +1 -0
  437. package/dist/src/shared/config-yaml-edit.d.ts +20 -0
  438. package/dist/src/shared/config-yaml-edit.d.ts.map +1 -0
  439. package/dist/src/shared/config-yaml-edit.js +468 -0
  440. package/dist/src/shared/config-yaml-edit.js.map +1 -0
  441. package/dist/src/shared/config.d.ts.map +1 -1
  442. package/dist/src/shared/config.js +12 -4
  443. package/dist/src/shared/config.js.map +1 -1
  444. package/dist/src/shared/engine-fallback.d.ts +22 -0
  445. package/dist/src/shared/engine-fallback.d.ts.map +1 -1
  446. package/dist/src/shared/engine-fallback.js +55 -4
  447. package/dist/src/shared/engine-fallback.js.map +1 -1
  448. package/dist/src/shared/engine-health.d.ts +16 -0
  449. package/dist/src/shared/engine-health.d.ts.map +1 -1
  450. package/dist/src/shared/engine-health.js +42 -0
  451. package/dist/src/shared/engine-health.js.map +1 -1
  452. package/dist/src/shared/list-alignment.d.ts +23 -0
  453. package/dist/src/shared/list-alignment.d.ts.map +1 -0
  454. package/dist/src/shared/list-alignment.js +61 -0
  455. package/dist/src/shared/list-alignment.js.map +1 -0
  456. package/dist/src/shared/logger.d.ts.map +1 -1
  457. package/dist/src/shared/logger.js +104 -33
  458. package/dist/src/shared/logger.js.map +1 -1
  459. package/dist/src/shared/map-limited.d.ts +11 -0
  460. package/dist/src/shared/map-limited.d.ts.map +1 -0
  461. package/dist/src/shared/map-limited.js +30 -0
  462. package/dist/src/shared/map-limited.js.map +1 -0
  463. package/dist/src/shared/oneShotCli.d.ts.map +1 -1
  464. package/dist/src/shared/oneShotCli.js +4 -2
  465. package/dist/src/shared/oneShotCli.js.map +1 -1
  466. package/dist/src/shared/partial-delivery.d.ts +24 -0
  467. package/dist/src/shared/partial-delivery.d.ts.map +1 -0
  468. package/dist/src/shared/partial-delivery.js +46 -0
  469. package/dist/src/shared/partial-delivery.js.map +1 -0
  470. package/dist/src/shared/process-safety-net.d.ts +44 -0
  471. package/dist/src/shared/process-safety-net.d.ts.map +1 -0
  472. package/dist/src/shared/process-safety-net.js +88 -0
  473. package/dist/src/shared/process-safety-net.js.map +1 -0
  474. package/dist/src/shared/rateLimit.d.ts +45 -2
  475. package/dist/src/shared/rateLimit.d.ts.map +1 -1
  476. package/dist/src/shared/rateLimit.js +64 -2
  477. package/dist/src/shared/rateLimit.js.map +1 -1
  478. package/dist/src/shared/redact.d.ts.map +1 -1
  479. package/dist/src/shared/redact.js +11 -1
  480. package/dist/src/shared/redact.js.map +1 -1
  481. package/dist/src/shared/safe-file-name.d.ts +9 -0
  482. package/dist/src/shared/safe-file-name.d.ts.map +1 -0
  483. package/dist/src/shared/safe-file-name.js +16 -0
  484. package/dist/src/shared/safe-file-name.js.map +1 -0
  485. package/dist/src/shared/terminal-safe-text.d.ts +2 -0
  486. package/dist/src/shared/terminal-safe-text.d.ts.map +1 -0
  487. package/dist/src/shared/terminal-safe-text.js +21 -0
  488. package/dist/src/shared/terminal-safe-text.js.map +1 -0
  489. package/dist/src/shared/types.d.ts +75 -4
  490. package/dist/src/shared/types.d.ts.map +1 -1
  491. package/dist/src/skills-sync/apply.d.ts +21 -0
  492. package/dist/src/skills-sync/apply.d.ts.map +1 -0
  493. package/dist/src/skills-sync/apply.js +209 -0
  494. package/dist/src/skills-sync/apply.js.map +1 -0
  495. package/dist/src/skills-sync/backup-run.d.ts +47 -0
  496. package/dist/src/skills-sync/backup-run.d.ts.map +1 -0
  497. package/dist/src/skills-sync/backup-run.js +150 -0
  498. package/dist/src/skills-sync/backup-run.js.map +1 -0
  499. package/dist/src/skills-sync/bounded-read.d.ts +32 -0
  500. package/dist/src/skills-sync/bounded-read.d.ts.map +1 -0
  501. package/dist/src/skills-sync/bounded-read.js +104 -0
  502. package/dist/src/skills-sync/bounded-read.js.map +1 -0
  503. package/dist/src/skills-sync/bundled.d.ts +28 -0
  504. package/dist/src/skills-sync/bundled.d.ts.map +1 -0
  505. package/dist/src/skills-sync/bundled.js +84 -0
  506. package/dist/src/skills-sync/bundled.js.map +1 -0
  507. package/dist/src/skills-sync/fingerprint.d.ts +32 -0
  508. package/dist/src/skills-sync/fingerprint.d.ts.map +1 -0
  509. package/dist/src/skills-sync/fingerprint.js +58 -0
  510. package/dist/src/skills-sync/fingerprint.js.map +1 -0
  511. package/dist/src/skills-sync/history.d.ts +44 -0
  512. package/dist/src/skills-sync/history.d.ts.map +1 -0
  513. package/dist/src/skills-sync/history.js +115 -0
  514. package/dist/src/skills-sync/history.js.map +1 -0
  515. package/dist/src/skills-sync/home-skill.d.ts +28 -0
  516. package/dist/src/skills-sync/home-skill.d.ts.map +1 -0
  517. package/dist/src/skills-sync/home-skill.js +67 -0
  518. package/dist/src/skills-sync/home-skill.js.map +1 -0
  519. package/dist/src/skills-sync/instance.d.ts +26 -0
  520. package/dist/src/skills-sync/instance.d.ts.map +1 -0
  521. package/dist/src/skills-sync/instance.js +128 -0
  522. package/dist/src/skills-sync/instance.js.map +1 -0
  523. package/dist/src/skills-sync/names.d.ts +25 -0
  524. package/dist/src/skills-sync/names.d.ts.map +1 -0
  525. package/dist/src/skills-sync/names.js +56 -0
  526. package/dist/src/skills-sync/names.js.map +1 -0
  527. package/dist/src/skills-sync/plan.d.ts +58 -0
  528. package/dist/src/skills-sync/plan.d.ts.map +1 -0
  529. package/dist/src/skills-sync/plan.js +132 -0
  530. package/dist/src/skills-sync/plan.js.map +1 -0
  531. package/dist/src/skills-sync/receipt.d.ts +61 -0
  532. package/dist/src/skills-sync/receipt.d.ts.map +1 -0
  533. package/dist/src/skills-sync/receipt.js +149 -0
  534. package/dist/src/skills-sync/receipt.js.map +1 -0
  535. package/dist/src/skills-sync/staging.d.ts +21 -0
  536. package/dist/src/skills-sync/staging.d.ts.map +1 -0
  537. package/dist/src/skills-sync/staging.js +81 -0
  538. package/dist/src/skills-sync/staging.js.map +1 -0
  539. package/dist/src/skills-sync/sync.d.ts +37 -0
  540. package/dist/src/skills-sync/sync.d.ts.map +1 -0
  541. package/dist/src/skills-sync/sync.js +201 -0
  542. package/dist/src/skills-sync/sync.js.map +1 -0
  543. package/dist/src/skills-sync/types.d.ts +66 -0
  544. package/dist/src/skills-sync/types.d.ts.map +1 -0
  545. package/dist/src/skills-sync/types.js +2 -0
  546. package/dist/src/skills-sync/types.js.map +1 -0
  547. package/dist/src/stt/config.d.ts +5 -0
  548. package/dist/src/stt/config.d.ts.map +1 -0
  549. package/dist/src/stt/config.js +18 -0
  550. package/dist/src/stt/config.js.map +1 -0
  551. package/dist/src/updates/maintenance.d.ts.map +1 -1
  552. package/dist/src/updates/maintenance.js +24 -4
  553. package/dist/src/updates/maintenance.js.map +1 -1
  554. package/dist/src/workflows/repository-mutex.d.ts +1 -1
  555. package/dist/web/404.html +1 -1
  556. package/dist/web/__next.__PAGE__.txt +11 -11
  557. package/dist/web/__next._full.txt +12 -12
  558. package/dist/web/__next._tree.txt +2 -2
  559. package/dist/web/_next/static/chunks/{0g5c5ppr8zmup.js → 20v6mri7epga5.js} +1 -1
  560. package/dist/web/_next/static/chunks/2u0328ngpt-ek.js +1 -0
  561. package/dist/web/_next/static/chunks/3f9i3f9q6v6_j.css +1 -0
  562. package/dist/web/_next/static/chunks/{08i7uo3uz6_fn.js → 3yy053rafgrzy.js} +1 -1
  563. package/dist/web/_not-found/__next._full.txt +10 -10
  564. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +9 -9
  565. package/dist/web/_not-found/__next._tree.txt +2 -2
  566. package/dist/web/_not-found.html +1 -1
  567. package/dist/web/_not-found.txt +10 -10
  568. package/dist/web/chat/__next._full.txt +12 -12
  569. package/dist/web/chat/__next._tree.txt +2 -2
  570. package/dist/web/chat/__next.chat.__PAGE__.txt +11 -11
  571. package/dist/web/chat.html +1 -1
  572. package/dist/web/chat.txt +12 -12
  573. package/dist/web/cron/__next._full.txt +12 -12
  574. package/dist/web/cron/__next._tree.txt +2 -2
  575. package/dist/web/cron/__next.cron.__PAGE__.txt +11 -11
  576. package/dist/web/cron.html +1 -1
  577. package/dist/web/cron.txt +12 -12
  578. package/dist/web/index.html +1 -1
  579. package/dist/web/index.txt +12 -12
  580. package/dist/web/kanban/__next._full.txt +12 -12
  581. package/dist/web/kanban/__next._tree.txt +2 -2
  582. package/dist/web/kanban/__next.kanban.__PAGE__.txt +11 -11
  583. package/dist/web/kanban.html +1 -1
  584. package/dist/web/kanban.txt +12 -12
  585. package/dist/web/logs/__next._full.txt +12 -12
  586. package/dist/web/logs/__next._tree.txt +2 -2
  587. package/dist/web/logs/__next.logs.__PAGE__.txt +11 -11
  588. package/dist/web/logs.html +1 -1
  589. package/dist/web/logs.txt +12 -12
  590. package/dist/web/models/__next._full.txt +12 -12
  591. package/dist/web/models/__next._tree.txt +2 -2
  592. package/dist/web/models/__next.models.__PAGE__.txt +11 -11
  593. package/dist/web/models.html +1 -1
  594. package/dist/web/models.txt +12 -12
  595. package/dist/web/org/__next._full.txt +12 -12
  596. package/dist/web/org/__next._tree.txt +2 -2
  597. package/dist/web/org/__next.org.__PAGE__.txt +11 -11
  598. package/dist/web/org.html +1 -1
  599. package/dist/web/org.txt +12 -12
  600. package/dist/web/sessions/__next._full.txt +10 -10
  601. package/dist/web/sessions/__next._tree.txt +2 -2
  602. package/dist/web/sessions/__next.sessions.__PAGE__.txt +9 -9
  603. package/dist/web/sessions.html +1 -1
  604. package/dist/web/sessions.txt +10 -10
  605. package/dist/web/settings/__next._full.txt +12 -12
  606. package/dist/web/settings/__next._tree.txt +2 -2
  607. package/dist/web/settings/__next.settings.__PAGE__.txt +11 -11
  608. package/dist/web/settings.html +1 -1
  609. package/dist/web/settings.txt +12 -12
  610. package/dist/web/skills/__next._full.txt +12 -12
  611. package/dist/web/skills/__next._tree.txt +2 -2
  612. package/dist/web/skills/__next.skills.__PAGE__.txt +11 -11
  613. package/dist/web/skills.html +1 -1
  614. package/dist/web/skills.txt +12 -12
  615. package/package.json +2 -1
  616. package/template/AGENTS.md +48 -308
  617. package/template/CLAUDE.md +4 -349
  618. package/template/bundled-skill-history.json +377 -0
  619. package/template/config.default.yaml +52 -3
  620. package/template/docs/architecture.md +41 -3
  621. package/template/docs/backup.md +142 -0
  622. package/template/docs/connectors.md +192 -16
  623. package/template/docs/cron.md +30 -11
  624. package/template/docs/memory.md +47 -0
  625. package/template/docs/overview.md +6 -2
  626. package/template/docs/self-modification.md +11 -10
  627. package/template/docs/skills.md +77 -4
  628. package/template/migrations/0.3.0/MIGRATION.md +6 -0
  629. package/template/migrations/0.7.3/MIGRATION.md +6 -0
  630. package/template/migrations/0.7.5/MIGRATION.md +1 -1
  631. package/template/migrations/0.9.0/MIGRATION.md +6 -0
  632. package/template/migrations/2026.10.13/MIGRATION.md +76 -0
  633. package/template/migrations/2026.10.13/files/docs/architecture.md +112 -0
  634. package/template/migrations/2026.10.13/files/docs/automations.md +110 -0
  635. package/template/migrations/2026.10.13/files/docs/backup.md +142 -0
  636. package/template/migrations/2026.10.13/files/docs/connectors.md +370 -0
  637. package/template/migrations/2026.10.13/files/docs/cron-commands.md +52 -0
  638. package/template/migrations/2026.10.13/files/docs/cron.md +178 -0
  639. package/template/migrations/2026.10.13/files/docs/mcp.md +108 -0
  640. package/template/migrations/2026.10.13/files/docs/memory.md +47 -0
  641. package/template/migrations/2026.10.13/files/docs/org.md +111 -0
  642. package/template/migrations/2026.10.13/files/docs/overview.md +44 -0
  643. package/template/migrations/2026.10.13/files/docs/self-modification.md +71 -0
  644. package/template/migrations/2026.10.13/files/docs/skills.md +140 -0
  645. package/template/migrations/2026.10.13/files/skills/cron-manager/SKILL.md +107 -0
  646. package/template/migrations/2026.10.13/files/skills/management/SKILL.md +227 -0
  647. package/template/migrations/2026.10.13/files/skills/migrate/SKILL.md +194 -0
  648. package/template/migrations/2026.10.13/files/skills/onboarding/SKILL.md +153 -0
  649. package/template/migrations/2026.10.13/files/skills/openryoko-config/SKILL.md +35 -0
  650. package/template/migrations/2026.10.13/files/skills/openryoko-config/references/engine-fallback.md +98 -0
  651. package/template/migrations/2026.10.13/files/skills/openryoko-config/references/jev.md +89 -0
  652. package/template/migrations/2026.10.13/files/skills/openryoko-config/references/maintenance.md +49 -0
  653. package/template/migrations/2026.10.13/files/skills/openryoko-config/references/platform.md +100 -0
  654. package/template/migrations/2026.10.13/files/skills/self-heal/SKILL.md +187 -0
  655. package/template/migrations/2026.10.9/MIGRATION.md +44 -0
  656. package/template/migrations/2026.10.9/files/docs/memory.md +47 -0
  657. package/template/migrations/2026.10.9/files/skills/migrate/SKILL.md +194 -0
  658. package/template/migrations/2026.5.7/MIGRATION.md +6 -0
  659. package/template/migrations/2026.8.28/MIGRATION.md +6 -0
  660. package/template/migrations/2026.9.11/MIGRATION.md +6 -0
  661. package/template/skills/cron-manager/SKILL.md +10 -0
  662. package/template/skills/management/SKILL.md +5 -4
  663. package/template/skills/migrate/SKILL.md +47 -14
  664. package/template/skills/onboarding/SKILL.md +3 -3
  665. package/template/skills/openryoko-config/SKILL.md +1 -1
  666. package/template/skills/openryoko-config/references/engine-fallback.md +16 -5
  667. package/template/skills/openryoko-config/references/platform.md +23 -4
  668. package/template/skills/self-heal/SKILL.md +117 -44
  669. package/dist/src/engines/mock.d.ts +0 -16
  670. package/dist/src/engines/mock.d.ts.map +0 -1
  671. package/dist/src/engines/mock.js +0 -47
  672. package/dist/src/engines/mock.js.map +0 -1
  673. package/dist/src/shared/test-support/posix-mode.d.ts +0 -17
  674. package/dist/src/shared/test-support/posix-mode.d.ts.map +0 -1
  675. package/dist/src/shared/test-support/posix-mode.js +0 -23
  676. package/dist/src/shared/test-support/posix-mode.js.map +0 -1
  677. package/dist/web/_next/static/Oux0UBcCkbX5eOp9-vC4k/_buildManifest.js +0 -11
  678. package/dist/web/_next/static/Oux0UBcCkbX5eOp9-vC4k/_clientMiddlewareManifest.js +0 -1
  679. package/dist/web/_next/static/Oux0UBcCkbX5eOp9-vC4k/_ssgManifest.js +0 -1
  680. package/dist/web/_next/static/chunks/02h65sho8c14h.js +0 -1
  681. package/dist/web/_next/static/chunks/0ic18n-m7ixyw.css +0 -1
  682. package/dist/web/_next/static/chunks/19s8vn2kgy7q1.js +0 -1
  683. package/dist/web/_next/static/chunks/1_jm0szyu2the.js +0 -1
  684. package/dist/web/_next/static/chunks/1omdg4m5w9lgx.js +0 -1
  685. package/dist/web/_next/static/chunks/25nob1new8t4s.js +0 -79
  686. package/dist/web/_next/static/chunks/2iqxlc9wtxzm2.js +0 -1
  687. package/dist/web/_next/static/chunks/3_6klkygi417n.js +0 -1
  688. package/dist/web/_next/static/chunks/3alc-b00c58_3.css +0 -1
  689. /package/dist/web/_next/static/{70PNIyOj8-2kywAG6J41- → ov0mWzyHx0B5oEnTHE_pa}/_buildManifest.js +0 -0
  690. /package/dist/web/_next/static/{70PNIyOj8-2kywAG6J41- → ov0mWzyHx0B5oEnTHE_pa}/_clientMiddlewareManifest.js +0 -0
  691. /package/dist/web/_next/static/{70PNIyOj8-2kywAG6J41- → ov0mWzyHx0B5oEnTHE_pa}/_ssgManifest.js +0 -0
@@ -0,0 +1,142 @@
1
+ # Backup
2
+
3
+ `~/.ryoko/` の設定・cron・人格・記憶は、人もエージェントも直接編集します。壊したときに前の状態へ戻せるように、gateway が1日1回バックアップを取ります。設定は要りません。既定で有効です。
4
+
5
+ ファイルを壊したと気づいたら、手で作り直す前に `ryoko backup list` を見てください。昨日の状態が残っています。
6
+
7
+ ## 何が取られるか
8
+
9
+ gateway が動いている間、対象ごとに前回の成功から24時間たつと取ります(起動した直後にも判定します)。できるものは2種類です。
10
+
11
+ **ホームのアーカイブ**(`home-<日時>.tar.gz`)。中身は次の種類に分かれていて、復元のときに `--only` で選べます。
12
+
13
+ | 種類 | 中身 |
14
+ |---|---|
15
+ | `config` | `config.yaml`、`.env`(あれば) |
16
+ | `cron` | `cron/jobs.json` |
17
+ | `cron-history` | `cron/runs/`(ジョブの実行履歴) |
18
+ | `persona` | ホーム直下の `*.md` すべて。`AGENTS.md`・`CLAUDE.md`・`SOUL.md`・`IDENTITY.md`・`TOOLS.md`・`BOOTSTRAP.md` と、自分で足した文書。`MEMORY.md` だけは `memory` に入る |
19
+ | `memory` | `MEMORY.md`、`memory/` |
20
+ | `org` | `org/` |
21
+ | `skills` | `skills/`、`skills.json` |
22
+ | `docs` | `docs/` |
23
+ | `knowledge` | `knowledge/` |
24
+ | `workflows` | `workflows/` のうち DB 以外 |
25
+
26
+ **DB のコピー**。セッションの記録(`sessions-<日付>.db`)と、workflow の定義と実行履歴(`workflows-<日付>.db`。workflow を使っている場合)。DB のコピーは1日に1つで、同じ日にもう一度実行しても取り直しません。
27
+
28
+ DB をコピーするのは gateway だけです。動いている間、1日1回、自分でコピーします。手動の `ryoko backup run` が取るのはホームのアーカイブ(上の表のファイル)だけです。DB は開きません。
29
+
30
+ DB のコピーは、名前を付ける前に SQLite の `integrity_check` で確かめます。通らなければ、そのコピーは捨てて失敗として報告します(次に試すのは翌日です)。コピーはページ単位の複製なので、通らないときは元の DB 自体が壊れている可能性があります。`ryoko backup list` で以前のコピーを確かめ、下の「DB を戻すとき」を見てください。
31
+
32
+ この検査で分かるのは構造の破損だけです。別々の時点のページが混ざったコピーは、構造が保たれていれば検出できません。そういうコピーができるのは、動いている gateway に気づかないまま外からコピーした場合です。
33
+
34
+ 検査そのものを実行できなかった場合(決められた時間内に終わらず打ち切った場合を含みます)は、コピーは残し、検査できなかったことを警告としてログに出します(`the copy was kept without being checked`)。
35
+
36
+ アーカイブには `config.yaml` の token や `.env` の鍵がそのまま入ります。ファイルは所有者だけが読める権限(0600)で作られますが、持ち出すときは秘密として扱ってください。
37
+
38
+ ## 取られないもの
39
+
40
+ 次のものはバックアップに入りません。入っている前提で作業しないでください。
41
+
42
+ - `logs/`、`tmp/`、`files/`(アップロードされたファイル)、`cron/commands/`(実行中のロックと出力)
43
+ - 対象の中にある `node_modules`、`.git`、`.venv`、`__pycache__`(どの深さでも)
44
+ - 認証の状態: `credentials/`、`connectors/`、`.whatsapp-auth`、`gateway-auth.json`、`auth-devices.json`。編集するものではないので、ホームごと失ったときは復元ではなく再認証します
45
+ - **symlink の先**。symlink はリンクとして記録するだけで、指している先の中身は読みません。`skills/` にホームの外のフォルダを symlink している場合、その中身は別の方法で守ってください
46
+ - ホーム直下の `*.md` 以外のファイル(`AGENTS.md.bak-…` のような退避ファイルなど)
47
+
48
+ ## 保存先と設定
49
+
50
+ 保存先は `~/.ryoko/backups/` です。ホームの中にあるので、目的は誤編集からの復旧です。ディスクごと失う事故に備えるなら、`backup.directory` でホームの外(別のディスクなど)を指定します。
51
+
52
+ ```yaml
53
+ backup:
54
+ enabled: true # false にすると日次のバックアップを止める
55
+ directory: /path/to/backups # 省略時は ~/.ryoko/backups
56
+ retention: 14 # アーカイブを残す日数
57
+ maxArchiveMb: 512 # 1回のアーカイブに入れるファイル合計の上限
58
+ maxEntries: 50000 # 1回のアーカイブに入れるファイル・ディレクトリ・symlink の数の上限
59
+ ```
60
+
61
+ `retention` は日数です。バックアップのある日を新しい順に `retention` 日分残し、それぞれの日の最新を必ず残します。同じ日に何度も取った場合、その日の分は直近 3 個までです。手動で何回取っても、前の日の分が押し出されることはありません。復元の前に自動で取られる `pre-restore-…` も、同じ数え方で別枠に残ります。
62
+
63
+ DB のコピーは1日1つ、7 世代で固定です。
64
+
65
+ ホームの対象が `maxArchiveMb` か `maxEntries` を超えると、アーカイブは書かれず失敗として扱います(DB のコピーは続きます)。空のファイルやディレクトリは容量を取りませんが、数としては数えます。大きなファイルや不要なファイルの山を対象の外へ出すか、上限を上げてください。この失敗は次の日次の機会まで再試行しないので、直したあとは `ryoko backup run` で取り直せます。
66
+
67
+ 2つの上限は、アーカイブを読むとき(`verify`・`restore`)にも掛かります。上限を上げて取ったアーカイブは、同じ設定のもとで読めます。`config.yaml` が壊れていて読めないときは既定の上限が使われるので、それを超えるアーカイブから戻すには、先に `backup:` の節だけを書いた最小の `config.yaml` を置いてください。
68
+
69
+ 復元の前に取る退避(`pre-restore-…`)にも同じ上限が掛かりますが、退避するのは復元が上書きするファイルだけです。バックアップを取ったあとでホーム全体が上限を超えていても復元できます。上書きするファイルだけで上限を超える場合は、`--only` で種類を絞って少しずつ戻すか、上限を上げてください。
70
+
71
+ 失敗は gateway のログ(`Backup failed (...)`)と、`GET /api/status` の `backup` に出ます。`level` が `warning` のときは、どの対象がなぜ失敗したかが `targets` に入っています。
72
+
73
+ ## どこで実行するか
74
+
75
+ `ryoko backup` は、gateway が動いている場所で実行します。ホームをコンテナに bind mount している場合は、コンテナの中です。
76
+
77
+ ホスト側のコマンドは、コンテナの中で動いている gateway を確実には見つけられません。コンテナの境界を越えると、プロセスの番号は通じません。ファイルのロックも、構成によっては共有されません。
78
+
79
+ そのため、どのコマンドも既定ではホームの DB を開きません。`run` はファイルをアーカイブするだけ、`list`・`verify`・`restore` が開くのはバックアップ先のファイルだけです。DB に触れるのは、明示して頼んだ2つの場合だけです(`run --include-databases` と、DB の `restore`)。この2つは、gateway が動いていた場所で、gateway を止めてから実行してください。
80
+
81
+ ## 戻し方
82
+
83
+ ```bash
84
+ ryoko backup list # 新しい順の一覧。左端が id
85
+ ryoko backup verify <id> # 読み戻して壊れていないか確かめる
86
+ ryoko backup restore <id> --only config --dry-run # 何が変わるかだけ表示する
87
+ ryoko backup restore <id> --only config # 実際に戻す
88
+ ```
89
+
90
+ - `--only` には上の表の種類をカンマ区切りで渡します(`--only config,cron`)。省くと、アーカイブにあるすべての種類が対象です。まず `--dry-run` で確かめてください。
91
+ - ファイルの復元は、gateway が動いたままで構いません。`config.yaml`・`cron/jobs.json`・`org/`・`skills/` は、gateway が変更を検知して読み直します。
92
+ - **復元は上書きだけ**です。バックアップにあるファイルを戻し、バックアップに無いファイル(あとから足したメモや Skill)は消しません。消したいものは、表示された一覧を見て自分で消します。
93
+ - 復元が上書きするファイル(置き換えるものと、権限を変えるもの)は、直前の状態が自動で `pre-restore-<日時>` に退避されます。退避するのはそのファイルだけで、ホーム全体ではありません。戻しすぎたら `ryoko backup restore pre-restore-<日時>` で、上書きされたファイルを復元前の内容に戻せます。
94
+ - ただし、戻すのも上書きだけの復元です。**復元で新しく作られたファイルは、`pre-restore-…` へ戻しても消えません**。どれが作られたかは復元の出力の「作成」の行で分かります(件数が多いときは `--json` で全件が出ます)。要らないものは自分で消します。何も上書きしない復元(作成だけ)では、退避は作られません。
95
+ - `cron` が戻すのは `jobs.json` だけです。実行履歴まで巻き戻したいときだけ `cron-history` を指定します。
96
+ - `persona` を戻すと、オンボーディングが終わる前のバックアップなら `BOOTSTRAP.md` も戻ります。`--dry-run` に「作成 BOOTSTRAP.md」と出たら、戻したあとで消してください(残すとオンボーディングがやり直しになります)。
97
+ - ホームの外を指す symlink を新しく作ることになる復元は、既定では拒否されます。自分で張ったリンクを戻すときは `--allow-external-symlinks` を付けます。
98
+ - `<id>` には、別の場所へ持ち出したバックアップのファイルパスも渡せます。
99
+ - 復元は `tmp/restore-…` という作業ディレクトリに展開してから配置します。終わると自分が置いたファイルだけを消し、空になったディレクトリを消します。ほかの何かが入っていた場合は、ディレクトリごと残して警告を出します(`… was left as it is`)。中身を確かめて、要らなければ自分で消してください。
100
+
101
+ 大きな変更の前に、いま取っておきたいときは `ryoko backup run` を使います。取るのは設定・cron・人格・記憶などのファイルです。何度実行しても構いません(その日の分は直近 3 個が残ります)。DB はこのコマンドでは取りません。gateway が毎日自分でコピーしています。
102
+
103
+ ## DB を手動でコピーするとき
104
+
105
+ ふつうは要りません。DB は gateway が1日1回、自分でコピーします。`ryoko backup run` を `--json` で実行すると、開かなかった DB は `status` が `withheld`、`reason` が `not-requested` と出ます。
106
+
107
+ 日次のバックアップを止めている場合(`backup.enabled: false`)や、gateway を止めたついでにその時点の DB を取っておきたい場合だけ、次のようにします。
108
+
109
+ 1. gateway を止める
110
+ 2. 1分ほど待つ
111
+ 3. gateway が動いていた場所(コンテナで動かしているなら、コンテナの中)で `ryoko backup run --include-databases`
112
+
113
+ gateway が動いている気配があると、DB は開きません。気配とは、PID ファイルが指すプロセスが生きていること、または DB への直近1分以内の書き込みです。そのときはファイルのアーカイブだけを取り、終了コード 1 で終わります。`--json` では、全体の `status` が `incomplete`、その DB の `status` が `withheld`、`reason` が `gateway-running` になります。その日のコピーがすでにあれば、gateway が動いていても何もせずに正常終了します。
114
+
115
+ 気配が無いことは、止まっている証拠にはなりません(下の「DB を戻すとき」と同じです)。必ず止めてから実行してください。
116
+
117
+ 既定で DB を開かないのは、読み取り専用の接続でも DB の隣の `-shm` には書き込むためです。ほかのプロセスがその DB を開いていることが見えないと、`-shm` を作り直します。ホスト側から、コンテナの中で動いている gateway の DB にこれをした場合に何が起きるかは、確かめられていません。このコマンド自身の読み取りも `-shm` を更新するので、続けて DB を復元するときは、もう1分待ってください。
118
+
119
+ ## DB を戻すとき
120
+
121
+ DB(`sessions-…`、`workflows-…`)の復元は、**gateway を止めてから**行います。動いている gateway の下で DB を差し替えると、記録が壊れます。
122
+
123
+ 1. gateway を止める(`ryoko stop`。サービスやコンテナで動かしている場合は、その方法で止める)
124
+ 2. 1分ほど待つ
125
+ 3. gateway が動いていた場所で実行する。ホームをコンテナに bind mount している場合は、**コンテナの中**で実行する。gateway を止めるとコンテナごと終了する構成では、同じホームを mount した一回限りのコンテナで実行する
126
+ 4. `ryoko backup restore sessions-<日付> --gateway-stopped`
127
+ 5. gateway を起動する
128
+
129
+ `--gateway-stopped` は「止めたことを確認した」という申告で、必須です。コマンドも稼働中の gateway を自分で探しますが、DB を開いて確かめることはしません。使われているかもしれない DB は、開くだけで記録を壊すことがあるためです。見るのは次の2つだけです。
130
+
131
+ - PID ファイル(`gateway.json`・`gateway.pid`)が指すプロセスが生きているか
132
+ - DB と、その `-wal`・`-shm` が、直近1分以内に書き換えられているか
133
+
134
+ どちらかに当たると、何も変えずに断ります。gateway を止めた直後は、たいてい2つ目に当たります。手順2で1分ほど待つのはそのためです。
135
+
136
+ この確認は確実ではありません。コンテナの中の gateway の PID は、ホスト側からは見えません。1分以上なにも書いていない gateway は、動いていても見つけられません。ホスト側で実行すると、動いている gateway に気づかないまま差し替えてしまうことがあります。手順3のとおり、gateway が動いていた場所で実行してください。
137
+
138
+ 置き換える前の DB は `pre-restore-<日時>-sessions` として退避されます。
139
+
140
+ DB の復元は、ホームの中では実ディレクトリにしか書きません。`sessions/`・`workflows/` や、ホームの中のバックアップ先が symlink になっていると、何も変えずに断ります。バックアップをホームの外に置きたいときは、symlink ではなく `backup.directory` で指定してください。
141
+
142
+ エージェントは DB を復元できません。自分が動いている gateway を止める必要があるためです。DB の復元が要ると判断したら、上の手順をオペレータに伝えてください。
@@ -0,0 +1,370 @@
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
+ getCapabilities(): ConnectorCapabilities; // threading, messageEdits, reactions, attachments
13
+ getHealth(): ConnectorHealth; // running | stopped | error | qr_pending
14
+ reconstructTarget(replyContext: ReplyContext): Target;
15
+ sendMessage(target: Target, text: string): Promise<string | void>;
16
+ replyMessage(target: Target, text: string): Promise<string | void>;
17
+ addReaction(target: Target, emoji: string): Promise<void>;
18
+ removeReaction(target: Target, emoji: string): Promise<void>;
19
+ editMessage(target: Target, text: string): Promise<void>;
20
+ onMessage(handler: (msg: IncomingMessage) => void): void;
21
+ }
22
+
23
+ interface IncomingMessage {
24
+ connector: string; // Connector name
25
+ source: string; // Platform the message arrived on
26
+ sessionKey: string; // The session the message belongs to
27
+ channel: string;
28
+ thread?: string;
29
+ user: string; // Display name
30
+ userId: string; // Platform user ID
31
+ text: string; // Message content
32
+ attachments: Attachment[]; // Files the connector downloaded
33
+ replyContext: ReplyContext; // What a reply needs to find its way back
34
+ }
35
+ ```
36
+
37
+ `sendMessage` and `replyMessage` report delivery. The promise resolves when the whole message reached the platform, and rejects when it did not. A long reply is sent in chunks; one that stops part-way rejects as a partial delivery and is not sent again from the top, because that would post the first chunks twice. `POST /api/connectors/<name>/send` answers `{"status":"sent"}` only when all of the message arrived. Otherwise it answers 500 with the reason — `only N of M chunks were delivered` for a partial delivery.
38
+
39
+ ## Slack Connector
40
+
41
+ Uses `@slack/bolt` with Socket Mode (no public URL required).
42
+
43
+ ### Configuration
44
+
45
+ ```yaml
46
+ connectors:
47
+ slack:
48
+ appToken: xapp-... # Socket Mode app token
49
+ botToken: xoxb-... # Bot user OAuth token
50
+ maxAttachmentMb: 200 # optional: largest attachment downloaded, in MB (default 200)
51
+ ```
52
+
53
+ An attachment over `maxAttachmentMb` is not downloaded; the session is told which one and why, so it can say so in its reply. The same key works under `discord` and `whatsapp`.
54
+
55
+ Files are fetched only for a message the bot is going to answer, and only from Slack's own file host (`files.slack.com`), the one place the bot token is sent. A file that Slack only links to — a Google Drive document or another remote file shared in the channel — is not downloaded. The session is told that it could not be retrieved, as for any attachment that fails.
56
+
57
+ ### Response Gating (`respondTo`)
58
+
59
+ By default the bot responds to every message it can see. `respondTo` adds a
60
+ deterministic gate, evaluated before the LLM triage layer, so gated messages
61
+ cost zero tokens and zero latency:
62
+
63
+ ```yaml
64
+ connectors:
65
+ slack:
66
+ respondTo:
67
+ im: always # 1:1 DMs — reply without a mention (default: always)
68
+ mpim: mention # group DMs — reply only when @-mentioned (default: always)
69
+ channel: mention # channels — reply only when @-mentioned (default: always)
70
+ engagedThreads: true # keep replying inside threads the bot already
71
+ # engaged, without a re-mention (default: true)
72
+ ```
73
+
74
+ Modes per scope: `always` | `mention` | `never`.
75
+
76
+ - `mention` drops messages that don't @-mention the bot. With
77
+ `engagedThreads: true`, once the bot has replied (or reacted) in a thread,
78
+ follow-ups in that thread flow without a re-mention — mention once, then
79
+ converse naturally.
80
+ - `never` silences a scope entirely, including mentions.
81
+ - Unset scopes default to `always`, so existing configs keep the legacy
82
+ respond-to-everything behavior.
83
+ - `respondTo` composes with `triage`: the gate decides *may we respond at
84
+ all* (hard policy), triage decides *should we* (air-reading). Messages
85
+ dropped by the gate never reach triage.
86
+
87
+ ### Thread Mapping
88
+
89
+ Slack messages are mapped to sessions based on conversation context:
90
+
91
+ | Slack Context | Session Key | Session Behavior |
92
+ |---|---|---|
93
+ | Direct message | `slack:dm:<userId>` | One session per DM user |
94
+ | Thread inside a direct message | `slack:dm:<userId>:<threadTs>` | One session per thread |
95
+ | Channel root message | `slack:<channelId>:<ts>` | One session per root message; replies in its thread continue it |
96
+ | Thread reply | `slack:<channelId>:<threadTs>` | The session of that thread's root message |
97
+
98
+ ### Reaction Workflow
99
+
100
+ Reactions provide visual feedback during processing:
101
+
102
+ 1. Message waits behind a turn that is still running → add :clock1:
103
+ 2. Its turn starts → remove :clock1:, add :eyes:
104
+ 3. The turn waits for a usage limit to reset → replace :eyes: with :hourglass_flowing_sand:
105
+ 4. The turn ends → remove the reaction. The reply, or the error, is the answer; no reaction marks success or failure
106
+
107
+ ### Employee Routing
108
+
109
+ - Default: messages route to the default employee ({{portalName}})
110
+ - `@mention`: messages mentioning a specific employee name route to that employee
111
+ - Thread continuity: replies in a thread continue with the same employee
112
+
113
+ ### Provider Re-login from the Operator's DM (`providerAuth`)
114
+
115
+ When Claude's or Codex's login expires, every turn fails until someone logs in
116
+ again on the host. On a host with no shell to log in from (a read-only
117
+ container, a headless server) the operator can do it from Slack instead. It is
118
+ off by default.
119
+
120
+ ```yaml
121
+ portal:
122
+ operatorSlackId: U0123ABCDE # required — the only person who can use it
123
+
124
+ connectors:
125
+ slack:
126
+ providerAuth:
127
+ enabled: true
128
+ ```
129
+
130
+ A named Slack instance under `connectors.instances[]` takes the same
131
+ `providerAuth` block. Saving the config reloads the connector; the gateway log
132
+ then shows `[slack] provider-auth: enabled`. If it shows a warning about
133
+ `portal.operatorSlackId` instead, the feature is inert until that is fixed:
134
+ the value must be the operator's Slack *user* ID (`U…`, or `W…` on Enterprise
135
+ Grid). A channel ID, a handle or a display name is treated as unset.
136
+
137
+ **Using it** — in your own 1:1 DM with the bot:
138
+
139
+ 1. Send `ログイン` (also `再ログイン`, `login`, or `/login`). The bot answers
140
+ with two buttons, *Claude にログイン* and *Codex にログイン*.
141
+ 2. **Claude**: open the login page from the button, approve, copy the
142
+ authentication code the page shows (it contains a `#`), press *コードを入力*
143
+ and paste it into the dialog. If your browser lands on a
144
+ `http://localhost:…/callback?...` address instead, paste that whole address.
145
+ 3. **Codex**: open the login page from the button and type in the device code
146
+ the bot shows. Nothing is sent back; the bot notices when you are done.
147
+ 4. The bot confirms the result with the CLI's own status command and rewrites
148
+ its message — the link and the code are gone from the DM either way. After
149
+ a Codex login it also shows what the CLI reports about the login and asks
150
+ you to confirm the approval was yours (see the note on device codes below).
151
+
152
+ A login that is not finished within 10 minutes is stopped; press *キャンセル*
153
+ to stop it sooner. Only one login per provider runs at a time. Saving the
154
+ config (which reloads the connectors) or restarting the gateway also stops a
155
+ login in progress — start it again afterwards.
156
+
157
+ If the bot reports that it cannot read a sign-in link from the CLI, the CLI's
158
+ output has changed in a way this version does not understand. Cancel, and log
159
+ in on the host instead.
160
+
161
+ When a turn fails because a login is gone, the bot DMs the operator a button
162
+ to log in again — at most once per provider every 30 minutes. This covers
163
+ Slack messages, cron jobs, workflows and web chat alike.
164
+
165
+ **Slack app settings.** Buttons and the code dialog need *Interactivity*
166
+ turned on (Socket Mode delivers it; no Request URL is needed), the `chat:write`
167
+ and `im:history` bot scopes, and the `message.im` bot event. The manifest
168
+ offered in Settings already contains all of these. An app set up by hand needs
169
+ Interactivity enabled and a reinstall to the workspace. Slack gives the bot no
170
+ way to detect that Interactivity is off — a button that does nothing when
171
+ pressed means exactly that.
172
+
173
+ **What to know before enabling it:**
174
+
175
+ - It reacts only to `portal.operatorSlackId`, compared exactly, and only in
176
+ that person's 1:1 DM. In channels, group DMs, and for everyone else, the
177
+ bot behaves as if the feature did not exist. If `allowFrom` is set, the
178
+ operator must be on it.
179
+ - Whoever controls the operator's Slack account can sign the instance in to a
180
+ provider account of their choosing. Protect that account accordingly.
181
+ - Never paste the code into the chat. A bot cannot delete your message, so the
182
+ bot refuses a pasted code, keeps it out of the session and the log, and asks
183
+ you to delete it yourself. While a login is open — ten minutes at most —
184
+ this is applied broadly: any message of yours in the DM that contains
185
+ something shaped like a code, even inside a sentence or with a file
186
+ attached, gets that answer instead of reaching the assistant. (A short
187
+ `XXXX-XXXX` code counts only during a Codex login, the one that has such a
188
+ code.) Send the message again once the login has ended. Outside a login,
189
+ only a message that is nothing but an OAuth code is held back.
190
+ - The link and the device code stay in the DM until the login ends, and are
191
+ never written to the gateway log or the session database. Slack itself may
192
+ retain edited messages under your workspace's retention and export settings.
193
+ - **A Codex device code works for whoever sees it.** That is how a device
194
+ login is built: the code is typed into a browser, and the CLI is signed in
195
+ to whichever account that browser is using. Someone who can read the
196
+ operator's DM while a Codex login is open — a shared screen, a workspace
197
+ admin, a second device — can enter the code with *their own* ChatGPT
198
+ account. The instance then runs as that account, and the bot reports a
199
+ perfectly successful login. So: treat the code like a password for those
200
+ minutes, and when the bot reports success, make sure you had finished the
201
+ browser step yourself. If a Codex login completes and you had not, log in
202
+ again at once. Claude is not exposed to this — its code only ever travels
203
+ from you to the CLI, through the dialog.
204
+ - The CLI runs with the same binary (`engines.<name>.bin`) and environment as
205
+ the engine, so the credentials land where the engine reads them
206
+ (`~/.claude` or `CLAUDE_CONFIG_DIR`; `~/.codex`). In a container that
207
+ location must be writable and must survive a restart.
208
+ - Employees with `sshHost` run on another machine; their login is not touched.
209
+ - Codex's device-code login is governed by a setting in ChatGPT's security
210
+ settings, per account or workspace. If the Codex login ends at once, check
211
+ that it is allowed there.
212
+ - In the operator's DM, `/login` opens this menu rather than being passed to
213
+ Claude Code.
214
+
215
+ ## Discord Connector
216
+
217
+ Uses `discord.js` over the Discord gateway (no public URL required).
218
+
219
+ ### Configuration
220
+
221
+ ```yaml
222
+ connectors:
223
+ discord:
224
+ botToken: ... # Discord bot token
225
+ guildId: ... # optional: only handle messages from this guild
226
+ channelId: ... # optional: only handle messages from this channel
227
+ maxAttachmentMb: 200 # optional: largest attachment downloaded, in MB (default 200)
228
+ ```
229
+
230
+ `maxAttachmentMb` applies to messages this instance receives from Discord itself. An instance that receives messages forwarded by a primary (`proxyVia`, see `channelRouting` below) fetches a forwarded attachment only from Discord's CDN over https, at most ten per message and up to 50 MB each, whatever `maxAttachmentMb` says.
231
+
232
+ ### Response Gating (`respondTo`)
233
+
234
+ The Discord port of the Slack gate. By default the bot responds to every
235
+ message it can see, with one deliberate exception described below (messages
236
+ addressed to somebody else); `respondTo` adds a deterministic gate so gated
237
+ messages never reach the engine:
238
+
239
+ ```yaml
240
+ connectors:
241
+ discord:
242
+ respondTo:
243
+ dm: always # 1:1 and group DMs (default: always)
244
+ channel: mention # guild channels/threads — reply only when
245
+ # @-mentioned or replied to (default: always)
246
+ engagedThreads: true # keep replying inside threads the bot already
247
+ # engaged, without a re-mention (default: true)
248
+ ```
249
+
250
+ Modes per scope: `always` | `mention` | `never` — same semantics as the Slack
251
+ gate, with Discord-specific mention rules:
252
+
253
+ - A Discord **reply** to one of the bot's messages counts as a mention,
254
+ whether or not the reply pinged (if the replied-to message was since
255
+ deleted, the reply can no longer be attributed and does not count). In flat
256
+ channels (no thread), reply to the bot or re-mention it to continue a
257
+ conversation. Thread engagement is tracked in memory and resets whenever
258
+ the connector is recreated — a gateway restart, a config save, or a
259
+ connector reload — mention the bot once more afterwards.
260
+ - Role mentions and `@everyone`/`@here` do **not** count as mentions.
261
+ - Messages that @-mention or reply to *somebody else* (and not the bot) are
262
+ always ignored outside DMs, even in `always` scopes and even with
263
+ `respondTo` unset — they're addressed to that person, not the bot. This is
264
+ an intentional behavior change from earlier releases (Slack parity), and
265
+ the one way an unconfigured connector no longer responds to everything.
266
+ - Channels proxied via `channelRouting` are gated by the *receiving*
267
+ instance's `respondTo`, not the sender's — the primary forwards the
268
+ resolved addressing so the remote can decide without a Discord round-trip.
269
+ Upgrade the primary first: a primary too old to forward addressing leaves
270
+ the receiver's mention scopes fail-closed (every routed message dropped,
271
+ with a warning in the receiver's log).
272
+ - Cross-instance calls authenticate like any API client. Give each route the
273
+ receiving gateway's bearer token (`channelRouting: { "<channelId>":
274
+ { url: "http://remote:7777", token: "..." } }`), and give a remote
275
+ instance the primary's token via `proxyViaToken`. A plain URL string keeps
276
+ working for gateways that run with auth disabled.
277
+ - Unset scopes default to `always`. There is no triage layer on Discord —
278
+ this gate is the only response filter.
279
+
280
+ ### Reply Targeting (`replyStyle`)
281
+
282
+ Where the bot's responses land in flat guild channels (threads and DMs are
283
+ already precise destinations and ignore this setting):
284
+
285
+ ```yaml
286
+ connectors:
287
+ discord:
288
+ replyStyle: reply # channel | reply | thread (default: channel)
289
+ ```
290
+
291
+ - `channel` (default): plain channel messages — the legacy behavior.
292
+ - `reply`: each response is a Discord reply attached to the message that
293
+ triggered it, so conversations stay legible in busy channels. Pairs well
294
+ with `respondTo.channel: mention` — people replying back to the bot count
295
+ as mentions.
296
+ - `thread`: the response opens (or reuses) a thread rooted on the
297
+ triggering message and lands there, Slack-style. Each flat-channel
298
+ message then maps to its own session (a public thread reuses its root
299
+ message's ID), so follow-ups inside the thread continue that
300
+ conversation — and count as engaged for `respondTo.engagedThreads`.
301
+ Channels that can't host message threads (voice/stage text chat) use
302
+ `reply` instead, session mapping included; a channel-level refusal
303
+ (missing Create Public Threads permission) is remembered and the channel
304
+ settles into `reply` behavior from the next turn. Note the migration
305
+ effect: switching an existing deployment to `thread` re-keys flat-channel
306
+ conversations, so ongoing channel sessions start fresh from the first
307
+ message after the switch.
308
+ - With `channelRouting`, the *primary* instance's `replyStyle` applies —
309
+ it renders every proxied send.
310
+
311
+ ## Commands in Chat
312
+
313
+ A message that starts with `/` is one of three things. This applies to every
314
+ connector (Slack, Discord, Telegram, WhatsApp).
315
+
316
+ - **A gateway command** — answered by the gateway, never sent to the CLI.
317
+ `/new`, `/status`, `/doctor`, `/cron list` and `/goal …` work for anyone
318
+ the connector lets in (they read, or touch only the one conversation). Who
319
+ may use the state-changing ones — `/model <name>`, and
320
+ `/cron run|enable|disable` — depends on whether an operator ID is set
321
+ (`portal.operatorSlackId` / `portal.operatorDiscordId`):
322
+ - **No operator ID set**: they stay open to everyone, on every connector,
323
+ as before.
324
+ - **An operator ID set**: only the operator runs them, and only on a
325
+ platform whose operator ID is configured. From anyone else they reach the
326
+ assistant as an ordinary message instead. A platform with no operator ID
327
+ has no operator: Telegram and WhatsApp always, and Discord while only
328
+ the Slack ID is set (or the reverse). On such an instance nobody can run
329
+ these commands from there — use Slack, Discord or the dashboard for them.
330
+
331
+ (On Slack the model-settings panel has always been operator-only; the text
332
+ command now matches it.)
333
+ - **A Claude Code command the operator may run from chat** —
334
+ `/compact [instructions]`, `/clear`. Passed to the CLI only when the
335
+ sender's platform ID equals `portal.operatorSlackId` (Slack) or
336
+ `portal.operatorDiscordId` (Discord). A display name never counts. If
337
+ neither ID is configured nobody is the operator, and Telegram and WhatsApp
338
+ have no operator at all — so set the ID if you want these from chat.
339
+ - **Anything else** — delivered to the assistant as an ordinary message, with
340
+ a one-line note that it was not run. That includes `/usage` and `/cost`
341
+ (they open a panel that nothing in chat can see), `/logout`, `/login`,
342
+ `/permissions`, `/resume`, `/config`, `/mcp`, `/hooks`, `/agents`,
343
+ `/add-dir`, `/exit` and every other CLI command, from the operator too, and
344
+ any command a later CLI version adds: only the two above are let through.
345
+ Run the others in a terminal on the machine.
346
+
347
+ `/<skill-name>` still works: the assistant reads it and uses the skill.
348
+
349
+ The same holds for a message that starts with `-` or `!`, or that is only
350
+ `exit` or `quit`: it reaches the assistant as text, never the CLI as an
351
+ option, a shell command or a quit. Control characters are removed from chat
352
+ messages.
353
+
354
+ `/logout` is turned off in the Claude CLI the gateway runs: it signs the
355
+ shared account out from under every session, so it is disabled at the source
356
+ rather than left to chance. To log out, use a terminal on the machine. (The
357
+ sign-in command is left on, so the operator can recover from the web live
358
+ terminal.) A turn that runs over SSH on an employee's own machine (`sshHost`)
359
+ uses that machine's CLI, which the gateway does not change.
360
+
361
+ The gateway does not answer "that command is not allowed" — the sender gets
362
+ the assistant's reply to the message. Prompts from the web UI, the API and
363
+ cron jobs are yours and are not affected.
364
+
365
+ ## Future Connectors
366
+
367
+ The connector interface is designed for additional platforms:
368
+ - **iMessage**: macOS-only via AppleScript bridge
369
+ - **Web UI**: Built-in, served by the HTTP server
370
+ - **CLI**: Direct terminal input/output
@@ -0,0 +1,52 @@
1
+ # Direct command cron jobs
2
+
3
+ Use `kind: "command"` for scheduled programs that already perform all required
4
+ work. They bypass SessionManager and never create an AI session. Existing prompt
5
+ and update-notification jobs continue to work.
6
+
7
+ Create or update through the authenticated `/api/cron` API so the live scheduler
8
+ is reloaded immediately:
9
+
10
+ ```json
11
+ {
12
+ "id": "my-patrol",
13
+ "name": "My patrol",
14
+ "enabled": true,
15
+ "schedule": "*/15 * * * *",
16
+ "kind": "command",
17
+ "command": {
18
+ "executable": "/usr/bin/python3",
19
+ "args": ["/absolute/path/patrol.py"],
20
+ "cwd": "/absolute/path",
21
+ "timeoutSeconds": 300
22
+ },
23
+ "failureDelivery": { "connector": "slack", "channel": "YOUR_CHANNEL" }
24
+ }
25
+ ```
26
+
27
+ Arguments are passed literally, without a shell. Put pipelines, environment
28
+ setup, output validation, or conditional notifications in a maintained script.
29
+ An exit code of zero is success. Nonzero exits, spawn failures and timeouts are
30
+ errors. Success output stays in the private command log; it is never posted by
31
+ cron. Failure alerts use `failureDelivery`, falling back to the configured cron
32
+ alert destination. They contain the exit reason, not program output.
33
+
34
+ Runs appear in the existing cron history with `kind`, `exitCode`, `signal`,
35
+ `timedOut` and `logFile`. Each job retains up to 100 logs capped at 1 MiB each.
36
+ The default timeout is 300 seconds; supported limits are 1–86400 seconds.
37
+ On POSIX, the process group is terminated on timeout and remaining descendants
38
+ are killed before the run releases its lock.
39
+
40
+ A durable exclusive lock under `cron/commands/<job-hash>/running.lock` prevents
41
+ overlap, including across gateway restarts. If the gateway dies during a command,
42
+ the lock deliberately remains. Inspect the recorded gateway PID, child PID,
43
+ program state and log before removing that one lock. Do not blindly rerun a
44
+ command whose external effects are unknown.
45
+
46
+ For prompt cron jobs, `effortLevel` is now passed through to the engine, allowing
47
+ routine work to use `medium` and difficult work to use `high` independently.
48
+
49
+ For conditional AI work, run a deterministic detector as a command job and emit
50
+ an existing Workflow event only for new candidates. Reuse the event `fireId` on
51
+ HTTP retries and keep a durable receipt; check failures instead of silently
52
+ marking the underlying work complete.