@jungjaehoon/mama-os 0.78.0 → 0.79.1

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 (288) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/README.md +38 -24
  3. package/db/migrations/002-model-runs-parent-index.sql +11 -0
  4. package/db/migrations/003-upkeep-settled.sql +15 -0
  5. package/dist/api/google-read-actions.d.ts +30 -0
  6. package/dist/api/google-read-actions.d.ts.map +1 -0
  7. package/dist/api/google-read-actions.js +256 -0
  8. package/dist/api/google-read-actions.js.map +1 -0
  9. package/dist/api/record-actions.d.ts.map +1 -1
  10. package/dist/api/record-actions.js +23 -5
  11. package/dist/api/record-actions.js.map +1 -1
  12. package/dist/api/report-handler.d.ts +0 -6
  13. package/dist/api/report-handler.d.ts.map +1 -1
  14. package/dist/api/report-handler.js +0 -54
  15. package/dist/api/report-handler.js.map +1 -1
  16. package/dist/api/security-events.d.ts +1 -1
  17. package/dist/api/security-events.d.ts.map +1 -1
  18. package/dist/api/security-events.js.map +1 -1
  19. package/dist/api/source-actions.d.ts +9 -0
  20. package/dist/api/source-actions.d.ts.map +1 -1
  21. package/dist/api/source-actions.js +49 -0
  22. package/dist/api/source-actions.js.map +1 -1
  23. package/dist/api/viewer-request-security.d.ts +14 -1
  24. package/dist/api/viewer-request-security.d.ts.map +1 -1
  25. package/dist/api/viewer-request-security.js +26 -3
  26. package/dist/api/viewer-request-security.js.map +1 -1
  27. package/dist/api/viewer-server.d.ts +7 -0
  28. package/dist/api/viewer-server.d.ts.map +1 -1
  29. package/dist/api/viewer-server.js +32 -0
  30. package/dist/api/viewer-server.js.map +1 -1
  31. package/dist/api/work-actions.d.ts +19 -2
  32. package/dist/api/work-actions.d.ts.map +1 -1
  33. package/dist/api/work-actions.js +15 -0
  34. package/dist/api/work-actions.js.map +1 -1
  35. package/dist/cli/commands/backup.d.ts +7 -6
  36. package/dist/cli/commands/backup.d.ts.map +1 -1
  37. package/dist/cli/commands/backup.js +44 -7
  38. package/dist/cli/commands/backup.js.map +1 -1
  39. package/dist/cli/commands/control.d.ts +22 -4
  40. package/dist/cli/commands/control.d.ts.map +1 -1
  41. package/dist/cli/commands/control.js +172 -11
  42. package/dist/cli/commands/control.js.map +1 -1
  43. package/dist/cli/commands/daemon.d.ts +13 -2
  44. package/dist/cli/commands/daemon.d.ts.map +1 -1
  45. package/dist/cli/commands/daemon.js +211 -5
  46. package/dist/cli/commands/daemon.js.map +1 -1
  47. package/dist/cli/commands/init-questions.d.ts +110 -0
  48. package/dist/cli/commands/init-questions.d.ts.map +1 -0
  49. package/dist/cli/commands/init-questions.js +445 -0
  50. package/dist/cli/commands/init-questions.js.map +1 -0
  51. package/dist/cli/commands/init-section.d.ts +13 -0
  52. package/dist/cli/commands/init-section.d.ts.map +1 -0
  53. package/dist/cli/commands/init-section.js +439 -0
  54. package/dist/cli/commands/init-section.js.map +1 -0
  55. package/dist/cli/commands/init.d.ts +56 -2
  56. package/dist/cli/commands/init.d.ts.map +1 -1
  57. package/dist/cli/commands/init.js +562 -351
  58. package/dist/cli/commands/init.js.map +1 -1
  59. package/dist/cli/commands/node-move.d.ts +20 -0
  60. package/dist/cli/commands/node-move.d.ts.map +1 -0
  61. package/dist/cli/commands/node-move.js +289 -0
  62. package/dist/cli/commands/node-move.js.map +1 -0
  63. package/dist/cli/commands/register-owner.d.ts +3 -0
  64. package/dist/cli/commands/register-owner.d.ts.map +1 -1
  65. package/dist/cli/commands/register-owner.js +2 -0
  66. package/dist/cli/commands/register-owner.js.map +1 -1
  67. package/dist/cli/commands/restore.d.ts +2 -0
  68. package/dist/cli/commands/restore.d.ts.map +1 -1
  69. package/dist/cli/commands/restore.js +7 -0
  70. package/dist/cli/commands/restore.js.map +1 -1
  71. package/dist/cli/commands/service.d.ts +16 -0
  72. package/dist/cli/commands/service.d.ts.map +1 -1
  73. package/dist/cli/commands/service.js +36 -8
  74. package/dist/cli/commands/service.js.map +1 -1
  75. package/dist/cli/commands/tools.d.ts +1 -1
  76. package/dist/cli/commands/tools.d.ts.map +1 -1
  77. package/dist/cli/commands/tools.js +8 -3
  78. package/dist/cli/commands/tools.js.map +1 -1
  79. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  80. package/dist/cli/commands/uninstall.js +123 -15
  81. package/dist/cli/commands/uninstall.js.map +1 -1
  82. package/dist/cli/commands/update.d.ts +59 -0
  83. package/dist/cli/commands/update.d.ts.map +1 -0
  84. package/dist/cli/commands/update.js +948 -0
  85. package/dist/cli/commands/update.js.map +1 -0
  86. package/dist/cli/index.js +8 -4
  87. package/dist/cli/index.js.map +1 -1
  88. package/dist/cli/launch-files.d.ts +36 -0
  89. package/dist/cli/launch-files.d.ts.map +1 -1
  90. package/dist/cli/launch-files.js +94 -1
  91. package/dist/cli/launch-files.js.map +1 -1
  92. package/dist/cli/prompt.d.ts +2 -1
  93. package/dist/cli/prompt.d.ts.map +1 -1
  94. package/dist/cli/prompt.js +5 -2
  95. package/dist/cli/prompt.js.map +1 -1
  96. package/dist/cli/runtime/backup.d.ts +17 -1
  97. package/dist/cli/runtime/backup.d.ts.map +1 -1
  98. package/dist/cli/runtime/backup.js +32 -4
  99. package/dist/cli/runtime/backup.js.map +1 -1
  100. package/dist/cli/runtime/daemon-control.d.ts +92 -7
  101. package/dist/cli/runtime/daemon-control.d.ts.map +1 -1
  102. package/dist/cli/runtime/daemon-control.js +183 -8
  103. package/dist/cli/runtime/daemon-control.js.map +1 -1
  104. package/dist/cli/runtime/default-roots.d.ts +27 -0
  105. package/dist/cli/runtime/default-roots.d.ts.map +1 -0
  106. package/dist/cli/runtime/default-roots.js +61 -0
  107. package/dist/cli/runtime/default-roots.js.map +1 -0
  108. package/dist/cli/runtime/diagnostics.d.ts +25 -0
  109. package/dist/cli/runtime/diagnostics.d.ts.map +1 -1
  110. package/dist/cli/runtime/diagnostics.js +250 -63
  111. package/dist/cli/runtime/diagnostics.js.map +1 -1
  112. package/dist/cli/runtime/init-state.d.ts +20 -0
  113. package/dist/cli/runtime/init-state.d.ts.map +1 -0
  114. package/dist/cli/runtime/init-state.js +51 -0
  115. package/dist/cli/runtime/init-state.js.map +1 -0
  116. package/dist/cli/runtime/install-kind.d.ts +54 -0
  117. package/dist/cli/runtime/install-kind.d.ts.map +1 -0
  118. package/dist/cli/runtime/install-kind.js +164 -0
  119. package/dist/cli/runtime/install-kind.js.map +1 -0
  120. package/dist/cli/runtime/node-move-journal.d.ts +44 -0
  121. package/dist/cli/runtime/node-move-journal.d.ts.map +1 -0
  122. package/dist/cli/runtime/node-move-journal.js +48 -0
  123. package/dist/cli/runtime/node-move-journal.js.map +1 -0
  124. package/dist/cli/runtime/release-check.d.ts +94 -0
  125. package/dist/cli/runtime/release-check.d.ts.map +1 -0
  126. package/dist/cli/runtime/release-check.js +316 -0
  127. package/dist/cli/runtime/release-check.js.map +1 -0
  128. package/dist/cli/runtime/setup-page.d.ts +57 -0
  129. package/dist/cli/runtime/setup-page.d.ts.map +1 -0
  130. package/dist/cli/runtime/setup-page.js +266 -0
  131. package/dist/cli/runtime/setup-page.js.map +1 -0
  132. package/dist/cli/runtime/source-tools.d.ts +60 -0
  133. package/dist/cli/runtime/source-tools.d.ts.map +1 -0
  134. package/dist/cli/runtime/source-tools.js +170 -0
  135. package/dist/cli/runtime/source-tools.js.map +1 -0
  136. package/dist/cli/runtime/telegram-pairing.d.ts +73 -0
  137. package/dist/cli/runtime/telegram-pairing.d.ts.map +1 -0
  138. package/dist/cli/runtime/telegram-pairing.js +184 -0
  139. package/dist/cli/runtime/telegram-pairing.js.map +1 -0
  140. package/dist/cli/runtime/update-journal.d.ts +135 -0
  141. package/dist/cli/runtime/update-journal.d.ts.map +1 -0
  142. package/dist/cli/runtime/update-journal.js +144 -0
  143. package/dist/cli/runtime/update-journal.js.map +1 -0
  144. package/dist/cli/runtime/update-progress.d.ts +95 -0
  145. package/dist/cli/runtime/update-progress.d.ts.map +1 -0
  146. package/dist/cli/runtime/update-progress.js +154 -0
  147. package/dist/cli/runtime/update-progress.js.map +1 -0
  148. package/dist/cli/runtime/update-request.d.ts +58 -0
  149. package/dist/cli/runtime/update-request.d.ts.map +1 -0
  150. package/dist/cli/runtime/update-request.js +172 -0
  151. package/dist/cli/runtime/update-request.js.map +1 -0
  152. package/dist/connectors/calendar/index.d.ts +5 -1
  153. package/dist/connectors/calendar/index.d.ts.map +1 -1
  154. package/dist/connectors/calendar/index.js +19 -28
  155. package/dist/connectors/calendar/index.js.map +1 -1
  156. package/dist/connectors/chatwork/index.d.ts.map +1 -1
  157. package/dist/connectors/chatwork/index.js +7 -3
  158. package/dist/connectors/chatwork/index.js.map +1 -1
  159. package/dist/connectors/config-loader.d.ts +5 -0
  160. package/dist/connectors/config-loader.d.ts.map +1 -1
  161. package/dist/connectors/config-loader.js +8 -0
  162. package/dist/connectors/config-loader.js.map +1 -1
  163. package/dist/connectors/discord/index.d.ts.map +1 -1
  164. package/dist/connectors/discord/index.js +4 -3
  165. package/dist/connectors/discord/index.js.map +1 -1
  166. package/dist/connectors/drive/index.d.ts.map +1 -1
  167. package/dist/connectors/drive/index.js +15 -13
  168. package/dist/connectors/drive/index.js.map +1 -1
  169. package/dist/connectors/framework/gws-utils.d.ts +62 -0
  170. package/dist/connectors/framework/gws-utils.d.ts.map +1 -1
  171. package/dist/connectors/framework/gws-utils.js +133 -3
  172. package/dist/connectors/framework/gws-utils.js.map +1 -1
  173. package/dist/connectors/framework/types.d.ts +24 -0
  174. package/dist/connectors/framework/types.d.ts.map +1 -1
  175. package/dist/connectors/framework/types.js +9 -0
  176. package/dist/connectors/framework/types.js.map +1 -1
  177. package/dist/connectors/gmail/index.d.ts.map +1 -1
  178. package/dist/connectors/gmail/index.js +14 -13
  179. package/dist/connectors/gmail/index.js.map +1 -1
  180. package/dist/connectors/index.d.ts +4 -4
  181. package/dist/connectors/index.d.ts.map +1 -1
  182. package/dist/connectors/index.js +4 -10
  183. package/dist/connectors/index.js.map +1 -1
  184. package/dist/connectors/notion/index.d.ts.map +1 -1
  185. package/dist/connectors/notion/index.js +5 -3
  186. package/dist/connectors/notion/index.js.map +1 -1
  187. package/dist/connectors/sheets/index.d.ts.map +1 -1
  188. package/dist/connectors/sheets/index.js +17 -12
  189. package/dist/connectors/sheets/index.js.map +1 -1
  190. package/dist/connectors/slack/index.d.ts.map +1 -1
  191. package/dist/connectors/slack/index.js +9 -3
  192. package/dist/connectors/slack/index.js.map +1 -1
  193. package/dist/connectors/telegram/index.d.ts.map +1 -1
  194. package/dist/connectors/telegram/index.js +4 -3
  195. package/dist/connectors/telegram/index.js.map +1 -1
  196. package/dist/connectors/trello/index.d.ts +1 -1
  197. package/dist/connectors/trello/index.d.ts.map +1 -1
  198. package/dist/connectors/trello/index.js +10 -5
  199. package/dist/connectors/trello/index.js.map +1 -1
  200. package/dist/gateways/discord.d.ts +6 -0
  201. package/dist/gateways/discord.d.ts.map +1 -1
  202. package/dist/gateways/discord.js +38 -27
  203. package/dist/gateways/discord.js.map +1 -1
  204. package/dist/gateways/slack.d.ts +6 -0
  205. package/dist/gateways/slack.d.ts.map +1 -1
  206. package/dist/gateways/slack.js +38 -27
  207. package/dist/gateways/slack.js.map +1 -1
  208. package/dist/gateways/telegram-commands.d.ts +124 -0
  209. package/dist/gateways/telegram-commands.d.ts.map +1 -0
  210. package/dist/gateways/telegram-commands.js +131 -0
  211. package/dist/gateways/telegram-commands.js.map +1 -0
  212. package/dist/gateways/telegram.d.ts +20 -0
  213. package/dist/gateways/telegram.d.ts.map +1 -1
  214. package/dist/gateways/telegram.js +138 -34
  215. package/dist/gateways/telegram.js.map +1 -1
  216. package/dist/gateways/turn-contract.d.ts +11 -0
  217. package/dist/gateways/turn-contract.d.ts.map +1 -1
  218. package/dist/runtime/action-surface.d.ts +1 -1
  219. package/dist/runtime/action-surface.d.ts.map +1 -1
  220. package/dist/runtime/action-surface.js +10 -0
  221. package/dist/runtime/action-surface.js.map +1 -1
  222. package/dist/runtime/backend-security.d.ts +23 -2
  223. package/dist/runtime/backend-security.d.ts.map +1 -1
  224. package/dist/runtime/backend-security.js +50 -5
  225. package/dist/runtime/backend-security.js.map +1 -1
  226. package/dist/runtime/member-paths.d.ts +15 -7
  227. package/dist/runtime/member-paths.d.ts.map +1 -1
  228. package/dist/runtime/member-paths.js +64 -12
  229. package/dist/runtime/member-paths.js.map +1 -1
  230. package/dist/runtime/member-session.d.ts +4 -0
  231. package/dist/runtime/member-session.d.ts.map +1 -1
  232. package/dist/runtime/member-session.js +23 -2
  233. package/dist/runtime/member-session.js.map +1 -1
  234. package/dist/runtime/native-session.d.ts +2 -0
  235. package/dist/runtime/native-session.d.ts.map +1 -1
  236. package/dist/runtime/native-session.js +1 -0
  237. package/dist/runtime/native-session.js.map +1 -1
  238. package/dist/runtime/owner-runtime.d.ts +63 -1
  239. package/dist/runtime/owner-runtime.d.ts.map +1 -1
  240. package/dist/runtime/owner-runtime.js +180 -3
  241. package/dist/runtime/owner-runtime.js.map +1 -1
  242. package/dist/runtime/owner-system-prompt.d.ts.map +1 -1
  243. package/dist/runtime/owner-system-prompt.js +0 -1
  244. package/dist/runtime/owner-system-prompt.js.map +1 -1
  245. package/dist/runtime/principal-access.d.ts +2 -0
  246. package/dist/runtime/principal-access.d.ts.map +1 -1
  247. package/dist/runtime/principal-access.js +7 -0
  248. package/dist/runtime/principal-access.js.map +1 -1
  249. package/dist/runtime/principal-sessions.d.ts.map +1 -1
  250. package/dist/runtime/principal-sessions.js +8 -1
  251. package/dist/runtime/principal-sessions.js.map +1 -1
  252. package/dist/runtime/record-orders.d.ts.map +1 -1
  253. package/dist/runtime/record-orders.js +3 -29
  254. package/dist/runtime/record-orders.js.map +1 -1
  255. package/dist/runtime/report-scheduler.d.ts +9 -2
  256. package/dist/runtime/report-scheduler.d.ts.map +1 -1
  257. package/dist/runtime/report-scheduler.js +37 -10
  258. package/dist/runtime/report-scheduler.js.map +1 -1
  259. package/dist/runtime/stimulus-delivery.d.ts +3 -0
  260. package/dist/runtime/stimulus-delivery.d.ts.map +1 -1
  261. package/dist/runtime/stimulus-delivery.js +19 -3
  262. package/dist/runtime/stimulus-delivery.js.map +1 -1
  263. package/dist/runtime/tools-paths.d.ts +7 -0
  264. package/dist/runtime/tools-paths.d.ts.map +1 -1
  265. package/dist/runtime/tools-paths.js +11 -5
  266. package/dist/runtime/tools-paths.js.map +1 -1
  267. package/dist/runtime/upkeep-close.d.ts +17 -0
  268. package/dist/runtime/upkeep-close.d.ts.map +1 -0
  269. package/dist/runtime/upkeep-close.js +127 -0
  270. package/dist/runtime/upkeep-close.js.map +1 -0
  271. package/dist/runtime/upkeep-orders.d.ts +124 -0
  272. package/dist/runtime/upkeep-orders.d.ts.map +1 -0
  273. package/dist/runtime/upkeep-orders.js +310 -0
  274. package/dist/runtime/upkeep-orders.js.map +1 -0
  275. package/dist/runtime/upkeep-reconcile.d.ts +25 -0
  276. package/dist/runtime/upkeep-reconcile.d.ts.map +1 -0
  277. package/dist/runtime/upkeep-reconcile.js +231 -0
  278. package/dist/runtime/upkeep-reconcile.js.map +1 -0
  279. package/dist/runtime/upkeep-writeback.d.ts +22 -0
  280. package/dist/runtime/upkeep-writeback.d.ts.map +1 -0
  281. package/dist/runtime/upkeep-writeback.js +203 -0
  282. package/dist/runtime/upkeep-writeback.js.map +1 -0
  283. package/dist/utils/untrusted-content.d.ts.map +1 -1
  284. package/dist/utils/untrusted-content.js +8 -1
  285. package/dist/utils/untrusted-content.js.map +1 -1
  286. package/install/install.sh +457 -0
  287. package/install/node.json +9 -0
  288. package/package.json +3 -4
package/CHANGELOG.md CHANGED
@@ -7,6 +7,347 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.79.1] - 2026-11-01
11
+
12
+ ### Fixed
13
+
14
+ - Enabling a source no longer asks again for a token `auth.env` already holds, so it cannot
15
+ switch a messenger to another bot (#552). The Slack and Discord sources read the same token as
16
+ the Slack and Discord messengers (`MAMA_SLACK_TOKEN`, `MAMA_DISCORD_TOKEN`). Before, enabling
17
+ the source, even to add a channel, asked for that token on the setup page, and a token entered
18
+ there became the messenger's at the next start. Now
19
+ `mama init --section connectors --non-interactive` keeps a stored token and prints that it did;
20
+ a blank value counts as missing, as it does for boot and `mama doctor`, and is asked for. It
21
+ asks for a stored token again only when `MAMA_INIT_REPLACE_SECRETS` names it, on a field that
22
+ says which messenger that is on also reads it, and refuses a name that no source being enabled
23
+ reads, before it looks for the sources' tools. At a terminal, `--section connectors`,
24
+ `--section slack` and `--section discord` ask before replacing a stored token, naming the
25
+ sources and messengers that are on and also read it; Enter keeps it. `--section connectors` no
26
+ longer asks for the Slack app token, which only the messenger reads. For a source whose stored
27
+ token is refused, `mama doctor` names `MAMA_INIT_REPLACE_SECRETS`.
28
+ - `mama uninstall --data` removes the MAMA home entry by entry, goes on past one it cannot
29
+ remove, and names each one. Before, on Node 22 (the Node the install command installs), the
30
+ first failure stopped the removal, so later entries stayed, credentials among them, and only
31
+ that failure was reported (#540).
32
+ - When anything before the MAMA home cannot be removed (a person's folder or temporary files, a
33
+ retired folder, the common skills or a toolkit version), `mama uninstall --data` keeps the MAMA
34
+ home and the program, names what could not be removed, and ends with the command to run again
35
+ once it is cleared, with `--toolkit` when it was given. That rerun finds what is left through
36
+ the kept config and database, a person's temporary files included after `member_root` went.
37
+ Before, the home went with the config and database that name those folders, so the rerun did
38
+ not find them and their data stayed with nothing pointing to it (#541).
39
+
40
+ ## [0.79.0] - 2026-11-01
41
+
42
+ ### Added
43
+
44
+ - `google.read`: the owner agent reads Gmail, Calendar and Sheets, and a Google Doc, Sheet or
45
+ Slides file as text, live through `gws`, which the daemon runs with its own sign-in. The agent
46
+ names the method as gws takes it (`service`, `argv`, `params`); read methods only, and no gws
47
+ flag is an input, so nothing is sent or uploaded. Each call runs in a directory of its own that
48
+ is removed after it, and a response gws writes to a file instead of printing (a parameter such
49
+ as `alt` or `callback` asking for another format) is refused, never left on disk. A list
50
+ returns one page with its `nextPageToken`; a result over 100,000 characters is refused with how
51
+ to narrow it. A replay turn cannot use it: Google read now is past the replay's window. A missing `gws`, no sign-in, a sign-in without the service, an API not enabled in
52
+ the client's Cloud project, and a rate or quota refusal each come back saying what to do. The
53
+ result is quoted as external evidence and each call is in `tool_traces`. The common session has
54
+ it in chat, source changes and reports, and an owner-role person in their own DM; members
55
+ without the role and room sessions do not. Drive files are still found with `drive.read` and
56
+ fetched with `drive.download`.
57
+ - Closing summaries for finished work. Every hour MAMA orders the work it saw closed or cancelled
58
+ since its first start with this version, ten items at a time. For each, the agent writes one
59
+ summary: the rounds, the points of outside feedback, who did what, and how it ended. Then a
60
+ later question reads one place. The order is checked item by item: a revision from the order's
61
+ run that leaves a description counts, as does a `work.no_update` naming an item whose summary
62
+ is already current. A status-only revision does not count. An item that
63
+ stays unchecked is ordered again, and after three orders it is logged as lost. `work.no_update`
64
+ can now name work items (`commitmentIds`) as well as observations.
65
+ - A daily board check. Once a day, before the first full report, MAMA orders work items to
66
+ compare with the board: up to ten open items whose Trello card moved after the item was last
67
+ revised, and up to ten items in progress or in review with no source event in over 30 days,
68
+ oldest first. The agent reads each card live and either revises the item with the reason or
69
+ says why it stays. Each item is checked like the closing summaries. An item that was kept, or
70
+ given up on after three tries, comes back only after it is revised again. The stale-work step
71
+ leaves the daily page, since this order now does it.
72
+ - Telegram commands MAMA answers itself, without a model turn, listed in the bot's command menu:
73
+ `/whoami` (your Telegram ID and whether MAMA knows you as an owner or a member), `/status`
74
+ (MAMA's version, whether a turn is running in this conversation, what waits; owners, in their
75
+ own DM, also see every conversation and the sources), `/new` (starts the conversation over;
76
+ refused while MAMA still works on something of that person's or a message of theirs waits) and
77
+ `/help`. In the common group an owner's commands act on the common session and a member's on
78
+ their own group conversation. Unregistered senders still get no answer, a command addressed to
79
+ another bot is left alone, and any other command goes to MAMA as a message.
80
+ - `mama init` sets up a new install and starts it:
81
+ - **Checks first, before writing anything:** the backend is installed, at least the verified
82
+ version, and signed in; Telegram accepts the bot token; the member and tool folders stay
83
+ outside HOME. Those folders default to a folder of the user's (`Shared/mama-<user>/…` in the Shared folder beside the home folders
84
+ on macOS, `/var/lib/mama/<user>/…` on Linux), and init refuses one another account owns or can
85
+ write.
86
+ - **Sign-in:** init signs nothing in. A backend that is not signed in stops it before anything
87
+ is written, and init names the login with the backend's full path (`claude auth login`, or
88
+ `codex login` in MAMA's Codex home, which init creates), for the person's agent to run.
89
+ `mama init --section model` runs that login on its terminal, and offers the only backend on
90
+ PATH as the default answer (#539).
91
+ - **Then in order:** writes the setup, registers the person running it as the first owner,
92
+ installs the document tools, installs and starts the service through `mama service`, and
93
+ waits until the daemon reports it is running and the viewer answers `/health`. Last, the
94
+ daemon runs one real backend turn in a session of its own, so the login is proven as the
95
+ service runs it; a failure names `mama logs` and `mama doctor`, and the install command run
96
+ again checks it after a fix.
97
+ - **Repeat-safe:** a failed run continues from its last finished step.
98
+ On a finished setup, init says so, names `mama doctor`, `mama service restart` and
99
+ `mama update`, and exits 0 (#538, #539).
100
+ - **No typed Telegram IDs:** last, the bot sends a six-digit code to whoever messages it
101
+ privately, and the code entered on the setup page names the first owner; that owner's
102
+ `/bind` in a group names the common channel. Messages the bot held from before are dropped, a
103
+ bot another program already reads is refused, and no `/bind` within 15 minutes stops setup
104
+ with the way to continue.
105
+ - **One part again:** `mama init --section <part>` asks one part of a finished setup again
106
+ (`telegram`, `model`, `timezone`, `connectors`, `discord`, `slack`, `jev`) while MAMA is
107
+ stopped. The answers get init's checks, the result must pass the checks MAMA runs at boot
108
+ (delivery routes included) before anything is written, tokens go only to `auth.env`, and the
109
+ other parts stay as they were. A new bot must already be in the common group.
110
+ - **Without a terminal:** `mama init --non-interactive` reads `MAMA_INIT_*` variables, and takes
111
+ the bot token and the pairing code on its setup page.
112
+ - **No longer offered:** the Kagemusha bridge, which a fresh install cannot use, and the
113
+ launch-agent question, since the service is installed for you.
114
+ - `/stop` in Telegram stops the turn running in that conversation and keeps the conversation: the
115
+ message it was answering is told it was interrupted and is not run again, and messages sent
116
+ after it still run. In the common group an owner stops the common session's turn and a member
117
+ their own.
118
+ - A daily release check. Once a day the daemon asks npm for the latest MAMA OS release and keeps
119
+ the answer. `mama status` and `mama doctor` show it without a network call of their own: a newer
120
+ release and how this install updates (`mama update`, or the git commands for a checkout), that
121
+ this version is current, or when the last check failed (#534).
122
+ - `mama update` updates an npm install to the latest release, or to the version you name:
123
+ - **Nothing changes first:** it asks the registry npm uses and shows the plan (`--dry-run`
124
+ stops there). It installs the new version next to the old one, so a failed download changes
125
+ nothing. A version older than the running one is refused (#535), and so is a release whose
126
+ Node.js range (`engines`) leaves out the Node that MAMA runs on (#539).
127
+ - **Then the swap:** it lets running turns finish as `mama stop` does, stops MAMA, takes a
128
+ backup with credentials and swaps the two versions. The new version writes `start.sh` and the
129
+ service file, checks the install, and starts with new work held. Once it runs and its viewer
130
+ answers, the held work runs, and the backup and the old version are removed (#535).
131
+ - **A failed step puts the old version back** with its own `start.sh` and service file, and
132
+ starts it. A check that newly fails under the new version counts as a failed step. The
133
+ database comes back from the backup only when the new version changed its schema, and the
134
+ report says how many inputs that arrived after the backup were dropped (#535).
135
+ - **Cut off:** if `mama update` itself is killed, `mama doctor`, and `mama status` on a stopped
136
+ install, name the `mama update --rollback` command that resolves it. `mama restore` refuses
137
+ until then (#535).
138
+ - **A git checkout** gets the commands that update it instead: stop, `git pull`,
139
+ `pnpm install`, `pnpm build`, `service install` and `service start` (#535).
140
+ - **The first update** needs a `start.sh` that this version's `mama service install` wrote, and
141
+ says so otherwise (#535).
142
+ - On an install the install command made, the report ends by naming the install command when
143
+ the new release pins another Node.js (#539).
144
+ - `/update` in Telegram updates MAMA. Only an owner can run it, in their own DM or in the common
145
+ group. It runs `mama update` as a job of its own, with no model turn, so it works even when the
146
+ backend does not. Progress comes back to the same chat: versions, steps and error codes, never a
147
+ path. While an update runs, another `/update` says only since when. A git checkout answers with
148
+ the commands that update it; asked in the group, those go to the owner's DM, since they name
149
+ folders on MAMA's machine. `/update` is in the bot's command menu (#536).
150
+ - An install command, `install.sh`, attached to each MAMA OS release starting with this one
151
+ (#538):
152
+ - It runs on macOS and Linux, on x64 or arm64, and reads no terminal. A new install is given
153
+ its backend (Claude Code or Codex) with `--backend`, and `--non-interactive` or `--no-init`.
154
+ - It puts Node.js in `~/.mama/node`, at a version it pins and checks by hash, MAMA OS in
155
+ `~/.mama/npm`, and a `mama` command in `~/.mama/bin`. The backend is installed with its
156
+ vendor's installer when none that runs is on PATH.
157
+ - It adds `~/.mama/bin` to PATH in a marked block of your shell's startup file (for fish it
158
+ prints the line instead), then runs `mama init --non-interactive`.
159
+ - On Linux it shows one `sudo` command and runs it: MAMA's folders under `/var/lib/mama`, and
160
+ linger, so the service keeps running after you log out. If sudo is refused, it prints the
161
+ command and goes on.
162
+ - Run again, it skips what is already in place. It will not take over a MAMA home that another
163
+ install set up.
164
+ - When a release pins another Node.js, running it again moves MAMA to that Node with
165
+ `mama update --node` (#539). That lets running turns finish, stops MAMA, swaps the Node in and
166
+ checks that MAMA starts on it. A new major version first rebuilds the installed packages for
167
+ that Node, before anything stops. If a step fails, the old Node is put back and started. If
168
+ the move is cut off, the next run of the install command finishes or undoes it, and
169
+ `mama status` and `mama doctor` say so.
170
+ - `mama doctor` warns when such an install runs another Node.js than its release pins (#539).
171
+ - How to get `gws` when a Google source needs it (Calendar, Gmail, Drive, Sheets). `mama init`,
172
+ `mama init --section connectors` and `mama doctor` look for it where MAMA's service runs it: on
173
+ start.sh's PATH, or, before `mama init` has written start.sh, on the PATH it will write, which
174
+ carries the folder where the terminal finds `gws`. When the service would not find it, they
175
+ print how to install it and how to sign in. On an install the install command made, both
176
+ commands use MAMA's own Node and put `gws` where the service finds it:
177
+ `PATH="$HOME/.mama/node/bin:$PATH" ~/.mama/node/bin/npm install -g --prefix ~/.mama/npm @googleworkspace/cli`,
178
+ then `PATH="$HOME/.mama/node/bin:$PATH" ~/.mama/npm/bin/gws auth login --scopes <scopes>`.
179
+ Other installs get `npm install -g @googleworkspace/cli` or `brew install googleworkspace-cli`,
180
+ then `gws auth login --scopes <scopes>`. The login names the OAuth scope of every Google source
181
+ that is on (see Changed), since one login serves them all. Before it, `mama init` and
182
+ `--section` name the OAuth client gws signs in through: a Desktop app client from Google Cloud
183
+ Console, saved as `~/.config/gws/client_secret.json`. When only the terminal finds `gws`, they
184
+ say that `mama service install` adds its folder. MAMA's service does not start while such a
185
+ source is on and `gws` is missing, and they say so: `mama init`, continuing a setup that
186
+ stopped, names `gws` again and says to install it now and run the install command again, and
187
+ `--section` no longer enables the source (below). Doctor's fix for a source that does not
188
+ start, or whose sign-in is refused, names the same login command, and the sources' own errors
189
+ point to `mama doctor` for those commands instead of a bare `gws auth login` (#543).
190
+ - `mama init --section connectors --non-interactive` enables sources without a terminal, for the
191
+ person's agent, while MAMA is stopped:
192
+ - It reads `MAMA_INIT_CONNECTORS`, a JSON object of `connectors.json` blocks keyed by source
193
+ name, checked as boot checks `connectors.json`. A source name or setting MAMA does not read is
194
+ refused.
195
+ - The tokens the sources read, as each source names them (Trello's key too), are entered on the
196
+ setup page, one field each, and go only to `auth.env`.
197
+ - The other parts of `mama init --section` still need a terminal.
198
+ - A source is enabled only once its tool is installed where MAMA's service finds it and signed
199
+ in, from either form of `mama init --section connectors`. With a Google source and `gws`
200
+ missing from start.sh's PATH, boot stopped; signed out, every poll failed. The section saves
201
+ nothing and prints how to install `gws`, or the OAuth client file and the login
202
+ (`gws auth login --scopes <scopes>`, naming the OAuth scope of every Google source that is on,
203
+ since one login serves them all), then "Then run this again." The sign-in is each source's own check, run in the
204
+ environment start.sh gives the daemon: one read with that source's own scope (Gmail its
205
+ profile, Drive `about`, Sheets its first spreadsheet, Calendar the calendar), so a sign-in made
206
+ for other services is refused too, with gws's reason.
207
+ - Each refusal of `mama init --section`, an expired setup page included, ends by saying MAMA is
208
+ still stopped and how to start it (`mama service install` first while no service is
209
+ installed). On an install the install command made, the section's lines
210
+ name `~/.mama/bin/mama`.
211
+ - An enabled source already in `connectors.json` that boot cannot build refuses the section, which
212
+ names it and says how to turn it off: its block with `"enabled": false` in
213
+ `MAMA_INIT_CONNECTORS`.
214
+ - `mama init --non-interactive` opens a setup page on this machine for the bot token and the
215
+ pairing code, once every other answer has been checked:
216
+ - The page listens on 127.0.0.1 at a path of 32 random bytes, and answers only a request whose
217
+ one Host header names `localhost`, `127.0.0.1` or `[::1]`, on any port. The address goes
218
+ only into `open.html`, a 0600 file in a 0700 folder, which init opens with `open` or `xdg-open`;
219
+ the address is never printed or passed as an argument, and the folder goes with the page. If
220
+ no browser opens, init prints the file's `file://` path.
221
+ - It takes the token, checked with Telegram, then the code the bot sent, by form POST. A refused
222
+ token or a wrong code is shown with its form again. After one token and one code it closes.
223
+ - Unused, it closes after 15 minutes, and setup stops without writing the setup; only the two
224
+ folders it made before the page opened stay. Neither the token nor the address appears in a
225
+ printed line or on the page.
226
+
227
+ ### Changed
228
+
229
+ - The Google login MAMA prints (setup, `init --section connectors`, `mama doctor`) asks for
230
+ explicit scopes, `gws auth login --scopes <scopes>`: read-only for Gmail, Calendar and Sheets,
231
+ and full Drive access, which `deliver.drive.file` needs to upload into the owner's folder and
232
+ set its readers. It was `-s <services>`, which in a terminal opened gws's scope picker and
233
+ otherwise asked for gws's defaults (`gmail.modify`, full Calendar and Sheets). An existing
234
+ sign-in keeps working; signing in again with the printed line narrows it.
235
+ - A closing summary, once checked, is not ordered again even if a later write clears or replaces
236
+ it. Before, an order was placed again when that happened within a week.
237
+ - `mama stop` lets running work finish first. MAMA claims nothing new: messages, source changes
238
+ and reports that arrive wait for the next start, and Telegram commands such as `/stop` still
239
+ answer. The stop waits until running turns finish and their replies are delivered, and prints
240
+ what it waits for. It gives up after one `agent.max_turn_ms` for each turn that may still run,
241
+ plus a minute, or when the daemon stops answering; then nothing changes and it exits 1.
242
+ `mama stop --now` stops at once, as before. `mama service stop`, `mama service restart`,
243
+ `mama uninstall` and, on macOS, `mama service uninstall` stop the same way, and `mama status`
244
+ shows while a stop holds new work. A daemon older than this version refuses to drain, and
245
+ `mama stop` then names `--now` (#533).
246
+ - `mama backup --restart` stops a running install the same way, backs it up and starts it again
247
+ through its service, also when the backup fails. Without an installed service it refuses before
248
+ it stops anything (#533).
249
+ - `mama status` shows the Node.js version the daemon runs (#539).
250
+ - `mama uninstall --data` also removes the program the install command put in the MAMA home
251
+ (Node.js, MAMA OS and the `mama` command), after everything else. Without `--data` it names that
252
+ program as staying. Both name the startup files that hold the install command's PATH block, for
253
+ you to remove. `mama backup` no longer lists that program as left out, since the install command
254
+ makes it again (#539).
255
+ - `mama service install`, for an npm install, also puts the npm prefix's `bin` folder on
256
+ `start.sh`'s PATH, where npm puts commands installed beside MAMA (#539).
257
+ - The install script asks nothing and runs from an agent's shell. A found backend must run before
258
+ the installer is skipped: its `--version` must exit 0 and print a version, so a shim with no
259
+ backend behind it gets the vendor's installer. A set-up install needs no flags: it runs
260
+ `mama init --non-interactive`, and without `--backend` it keeps the backend it has.
261
+ - Slack, Chatwork and Trello sources read only `MAMA_SLACK_TOKEN`, `MAMA_CHATWORK_TOKEN` and
262
+ `MAMA_TRELLO_TOKEN`, so the setup page never takes another secret, such as the owner bot's
263
+ token or `MAMA_AUTH_TOKEN`. A block without `auth.tokenName` reads that name. A Slack or
264
+ Chatwork block without one read `SLACK_BOT_TOKEN` or `CHATWORK_API_TOKEN` before; it now needs
265
+ `MAMA_SLACK_TOKEN` or `MAMA_CHATWORK_TOKEN` in `auth.env`, and doctor names the one missing. A
266
+ block that names any other variable stops boot until it is corrected, and doctor names it.
267
+ - `mama doctor`'s fix for a source token that is missing or refused names
268
+ `mama init --section connectors --non-interactive` with that source's block, whose setup page
269
+ takes the token, instead of `mama secret set`, which needs a terminal. A messenger's token
270
+ still names `mama secret set`.
271
+ - The package README and the install guide (`docs/start/owner-setup.md`) describe setup through
272
+ the person's agent: the sentence to give it, naming this repository, and the install command it
273
+ runs, with `npm install -g` for a person who keeps their own Node.js. The guide lists the
274
+ supported versions of Node.js, Claude Code, Codex and macOS with their sources, what the install
275
+ command makes, how a new Node.js release is moved to, and the known limits: no setup path yet for
276
+ Linux over SSH or without a desktop, and the document tools on a Mac account without its own
277
+ Homebrew.
278
+
279
+ ### Removed
280
+
281
+ - The interactive whole setup: bare `mama init` is now a usage error. `mama init --non-interactive`
282
+ is the setup, run by the person's agent ("Set up through your agent" in
283
+ `docs/start/owner-setup.md`), and its messages say to run the install command again. The tunnel
284
+ settings are read from the environment: `MAMA_CF_ACCESS_ISSUER`, `MAMA_CF_ACCESS_AUD` and
285
+ `MAMA_VIEWER_HOSTNAMES` together, and optionally `MAMA_VIEWER_OWNER_EMAILS`. Sources, Discord,
286
+ Slack and Jev are set up with `mama init --section`.
287
+ - The init variables `MAMA_INIT_OWNER_TELEGRAM_ID` and `MAMA_INIT_COMMON_CHAT_ID`, and
288
+ `MAMA_TELEGRAM_TOKEN` as an init variable (the secret name stays): the setup page takes the token,
289
+ and the bot's pairing code and `/bind` name the owner and the common group.
290
+ - The package no longer installs Express. Its only use was an old report router with write routes
291
+ that nothing ever served.
292
+
293
+ ### Fixed
294
+
295
+ - A Notion, Discord or Telegram source whose block names another token than its own is refused
296
+ when the source is built, in the section, doctor and boot; before, only its start in boot
297
+ refused it.
298
+ - Gmail, Drive and Sheets' sign-in check is a read with the source's own scope. It ran
299
+ `gws auth status`, which exits 0 signed in or not and does not say which services a sign-in
300
+ grants, so doctor reported a signed-out source, or one without its scope, as signed in.
301
+ - Calendar starts as the other Google sources do, when `gws` runs. Its calendar read is its sign-in
302
+ check, so a sign-in that ended (a testing-mode client's, after 7 days) fails its polls and
303
+ doctor's check instead of stopping MAMA at boot.
304
+ - A backend failure such as a signed-out Claude CLI or an API error no longer arrives as MAMA's
305
+ answer. The turn fails, its message is told it was interrupted, and `daemon.log` names the
306
+ error. Before, the CLI's error text was sent as the reply and the run was recorded as committed
307
+ (mama-core).
308
+ - A scheduled full report or reminder that a newer report already covered is no longer sent.
309
+ Before, a report whose first send failed stayed queued and kept being retried, so it could still
310
+ go out days late; one had waited 13 days. Reports already stuck this way close after the next
311
+ full report is sent (#542).
312
+ - After a report's send fails, MAMA no longer writes the same hour's report again every minute
313
+ (#542).
314
+ - If the clock is behind the latest report sent, MAMA queues no report and logs an error each
315
+ minute naming that report's time, until the clock passes it (#542).
316
+ - `mama stop` no longer refuses a MAMA that is just starting. In its first moments MAMA holds the
317
+ install before it can answer the stop or say which process it is. The stop used to report
318
+ "does not answer on its control socket" and leave it running, or report "unknown (pid 0) holds
319
+ the install" as still running after it had already stopped it (macOS). It now waits up to 5
320
+ seconds for MAMA to answer, then lets it finish what runs and stops it as usual. `mama stop
321
+ --now` waits the same way, only while the holder is still unnamed, before it stops the service.
322
+ Running the install command again right after a Node move was cut off hit this: the install
323
+ command stopped with "MAMA on it did not stop" and changed nothing (#546).
324
+
325
+ ### Security
326
+
327
+ - gws's credential store is now closed to the agents' own file reads and shell, as MAMA's own
328
+ credentials are (owner, 2026-10-31): its config directory (`~/.config/gws`, the legacy
329
+ `~/Library/Application Support/gws`, or the one `GOOGLE_WORKSPACE_CLI_CONFIG_DIR` names) and a
330
+ `GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE`. MAMA's Google sources and `google.read` run on that
331
+ sign-in, and an agent that could read it, or run `gws auth export` against it, could carry the
332
+ refresh token, with Drive write access, out in a reply or a fetched URL. Claude's Read rules
333
+ and shell sandbox and the Codex permission profile all deny it; the daemon's own gws calls are
334
+ unaffected. Other tools' credential stores stay as they were.
335
+ - Another website open in your browser can no longer read through MAMA's viewer in your name.
336
+ Before, a link or a page your browser had allowed onto this machine could make one viewer
337
+ request, such as a memory search with words it chose. MAMA ran that search as yours and kept
338
+ the words in its record of your actions. The viewer now answers such a request with 403 and runs
339
+ nothing. It records the request in `security-events.jsonl` as `cross_origin` and alerts you as
340
+ for other viewer security events. A page on another port of this machine counts as another
341
+ website. The viewer itself, a link or bookmark that opens it, curl and local tools work as
342
+ before. Through the tunnel, a bookmark to an `/api` address opened after your Cloudflare Access
343
+ sign-in expired comes back from the sign-in page as another website's request and gets 403;
344
+ open the viewer instead.
345
+ - The board's live updates allow 8 open connections at once. Another connection is refused with
346
+ 503 and a line in `daemon.log`, instead of each one adding memory without limit. The browser
347
+ does not retry a refused connection: that board keeps its content and its refresh button but
348
+ shows no live updates until the page is reloaded. A connection whose browser left while MAMA
349
+ was still checking its Cloudflare Access sign-in is no longer kept open for good.
350
+
10
351
  ## [0.78.0] - 2026-10-16
11
352
 
12
353
  ### Fixed
package/README.md CHANGED
@@ -5,36 +5,50 @@ Codex, watch connected work, keep task revisions and evidence, answer in Telegra
5
5
  and the common group), Discord or Slack, publish reports and a board, and recall corrections.
6
6
  [mama-core](../mama-core/README.md) supplies the shared engine.
7
7
 
8
- Current manifest: **0.78.0**. Install with `npm install -g @jungjaehoon/mama-os` (Node.js 22.13+)
9
- and follow [owner setup](../../docs/start/owner-setup.md).
8
+ Current manifest: **0.79.1**. Install it through your agent: on the Mac that will run MAMA, tell
9
+ Claude Code or Codex "Install MAMA OS from https://github.com/jungjaehoon-lifegamez/MAMA by
10
+ following its owner setup guide, docs/start/owner-setup.md". See
11
+ [owner setup](../../docs/start/owner-setup.md), with the supported versions.
10
12
 
11
13
  ## Start and operate
12
14
 
15
+ The agent runs the install command. It installs MAMA's own Node.js, MAMA OS and, when needed, the
16
+ backend, then sets MAMA up and starts it:
17
+
18
+ ```bash
19
+ curl -fsSL https://github.com/jungjaehoon-lifegamez/MAMA/releases/latest/download/install.sh | MAMA_INIT_MODEL=<model> sh -s -- --backend <claude|codex> --non-interactive
20
+ ```
21
+
22
+ With your own Node.js 22.13 or newer, install with npm instead, then run setup:
23
+
13
24
  ```bash
14
25
  npm install -g @jungjaehoon/mama-os
15
- mama init
26
+ MAMA_INIT_BACKEND=<claude|codex> MAMA_INIT_MODEL=<model> mama init --non-interactive
16
27
  ```
17
28
 
18
29
  From a checkout, run `pnpm install` and `pnpm build`, then use
19
- `node packages/standalone/dist/cli/index.js` in place of `mama`. Onboarding is terminal-only: the owner types tokens
20
- with echo off. It writes configuration and optional launchd files; backend login and service
21
- startup are separate steps.
22
-
23
- For Telegram's common session, create a group with the bot, even for a solo owner, and enter
24
- its negative group or supergroup ID in `mama init`. Private chats always enter personal sessions.
25
- Before starting the daemon, set `member_root` outside HOME in `config.yaml` and run
26
- `mama register-owner <telegram id>` for each owner's positive user ID.
27
-
28
- | Command | Purpose |
29
- | --------------------------------------------- | ------------------------------------------------ |
30
- | `mama init` | Set up the owner, backend and connectors |
31
- | `mama register-owner <telegram id>` | Register an owner before the daemon starts |
32
- | `mama tools install` | Install or update the document toolkit |
33
- | `mama secret set <NAME>` / `mama secret list` | Rotate a token / list names only |
34
- | `mama daemon` | Run the configured daemon in the foreground |
35
- | `mama backfill <file>` | Write a prepared past-period backfill file |
36
- | `mama replay` | Replay prepared historical inputs in day windows |
37
- | `mama status` / `mama stop` | Report running/stopped / stop the process |
30
+ `node packages/standalone/dist/cli/index.js` in place of `mama`. Setup reads its answers from
31
+ `MAMA_INIT_*` variables and opens a page in the browser on this machine, where the owner enters the
32
+ bot token and the pairing code; nothing secret goes through the chat or a terminal. Sign in to the
33
+ backend first; setup checks it, writes the setup, registers the first owner, installs the document
34
+ toolkit and starts the service.
35
+
36
+ For Telegram's common session, create a group with the bot, even for a solo owner, and send
37
+ `/bind` there when setup asks. Private chats always enter personal sessions.
38
+ Setup pairs you through a code the bot sends you and registers you as the first owner; `mama register-owner <telegram id>` registers
39
+ another owner while the daemon is stopped.
40
+
41
+ | Command | Purpose |
42
+ | -------------------------------------------------- | ---------------------------------------------------- |
43
+ | `mama init --non-interactive` | Set up and start MAMA, with the first owner |
44
+ | `mama init --section connectors --non-interactive` | Enable sources, with MAMA stopped; the agent runs it |
45
+ | `mama register-owner <telegram id>` | Register another owner while MAMA is stopped |
46
+ | `mama tools install` | Install or update the document toolkit |
47
+ | `mama secret set <NAME>` / `mama secret list` | Rotate a token / list names only |
48
+ | `mama daemon` | Run the configured daemon in the foreground |
49
+ | `mama backfill <file>` | Write a prepared past-period backfill file |
50
+ | `mama replay` | Replay prepared historical inputs in day windows |
51
+ | `mama status` / `mama stop` | Report running/stopped / stop the process |
38
52
 
39
53
  See [CLI flags](../../docs/reference/cli.md) and
40
54
  [launchd management](../../docs/guides/troubleshooting.md).
@@ -71,8 +85,8 @@ and viewer sources/assets in `ui/` and `public/viewer/`.
71
85
  ## Data, security and status
72
86
 
73
87
  OS state lives in `~/.mama/`; its database defaults to `~/.mama/memory.db`.
74
- `config.yaml` and `connectors.json` hold settings; terminal-entered credentials live in
75
- `auth.env` (0600). Both backends have workspace-only writes and credential-read exclusions.
88
+ `config.yaml` and `connectors.json` hold settings; credentials, entered on the setup page or at a
89
+ terminal, live in `auth.env` (0600). Both backends have workspace-only writes and credential-read exclusions.
76
90
  The viewer binds to `127.0.0.1:3847` by default; remote data access requires a bearer token
77
91
  or verified Access JWT. See [security](../../docs/guides/security.md).
78
92
 
@@ -0,0 +1,11 @@
1
+ -- A run's child runs are read by parent, and only the product reads them that way: the upkeep and
2
+ -- record-order runners wait for an order run's children, and the write-back scan reads and checks
3
+ -- each question turn with its children. Core never queries by parent, so the index lives with the
4
+ -- package that does. Without it every lookup scans model_runs; on a copy of a live install the
5
+ -- write-back scan took about 3 s per pass, and about 50 ms with this index.
6
+ CREATE INDEX IF NOT EXISTS idx_model_runs_parent
7
+ ON model_runs(parent_model_run_id)
8
+ WHERE parent_model_run_id IS NOT NULL;
9
+
10
+ INSERT OR IGNORE INTO schema_version (source, version, description)
11
+ VALUES ('standalone', 2, 'Index model runs by parent run, for the product runners that read children');
@@ -0,0 +1,15 @@
1
+ -- Upkeep subjects the runner has settled for good: checked, or lost after its last attempt.
2
+ -- Attempts are counted from the stored order rows, and the mailbox deletes acked rows after seven
3
+ -- days, so without this record a subject whose scan has no time bound (the board reconcile's stale
4
+ -- items) would be ordered three more times every week, kept or lost. A settled subject is never
5
+ -- ordered again; new work on the same thing is a new subject with a new key.
6
+ CREATE TABLE IF NOT EXISTS upkeep_settled (
7
+ kind TEXT NOT NULL,
8
+ subject_key TEXT NOT NULL,
9
+ state TEXT NOT NULL CHECK (state IN ('checked', 'lost')),
10
+ settled_at INTEGER NOT NULL,
11
+ PRIMARY KEY (kind, subject_key)
12
+ );
13
+
14
+ INSERT OR IGNORE INTO schema_version (source, version, description)
15
+ VALUES ('standalone', 3, 'Upkeep subjects settled for good, kept past the mailbox retention');
@@ -0,0 +1,30 @@
1
+ import type { ActionRegistration } from '@jungjaehoon/mama-core';
2
+ import type { GwsCall } from './drive-actions.js';
3
+ export declare const GOOGLE_READ_ACTION = "google.read";
4
+ /**
5
+ * The read methods, per service, as gws takes them after the service name. The connectors call
6
+ * most of them; `users labels list` names the label ids messages carry. Drive's listing, file
7
+ * metadata and downloads are drive.read and drive.download; only a Google Doc, Sheet or Slides
8
+ * file read as text is new here.
9
+ */
10
+ export declare const GOOGLE_READ_METHODS: {
11
+ readonly gmail: readonly ["users getProfile", "users labels list", "users messages list", "users messages get", "users threads list", "users threads get"];
12
+ readonly calendar: readonly ["calendarList list", "events list", "events get"];
13
+ readonly drive: readonly ["files export"];
14
+ readonly sheets: readonly ["spreadsheets get", "spreadsheets values get"];
15
+ };
16
+ export type GoogleService = keyof typeof GOOGLE_READ_METHODS;
17
+ /**
18
+ * About 25,000 tokens of ASCII JSON: Claude Code's default limit for one MCP tool result, which a
19
+ * code_act return meets, while a Codex turn takes the result whole. Japanese or Korean text costs
20
+ * about a token per character, so a page of it near the cap is several times that. A page over it
21
+ * is narrowed by the request, not cut: cut JSON does not parse.
22
+ */
23
+ export declare const GOOGLE_READ_MAX_CHARS = 100000;
24
+ export interface GoogleReadPorts {
25
+ /** A directory only the daemon reads (under the MAMA home's runtime/): each call's own cwd. */
26
+ scratchDir: string;
27
+ gws?: GwsCall;
28
+ }
29
+ export declare function googleReadActionRegistrations(ports: GoogleReadPorts): ActionRegistration[];
30
+ //# sourceMappingURL=google-read-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-read-actions.d.ts","sourceRoot":"","sources":["../../src/api/google-read-actions.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AASjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;CAYtB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAqB7C,MAAM,WAAW,eAAe;IAC9B,+FAA+F;IAC/F,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAiFD,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,EAAE,CAyJ1F"}