@jungjaehoon/mama-os 0.77.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +25 -10
  3. package/dist/api/security-events.d.ts.map +1 -1
  4. package/dist/api/security-events.js +10 -1
  5. package/dist/api/security-events.js.map +1 -1
  6. package/dist/api/viewer-server.d.ts +1 -0
  7. package/dist/api/viewer-server.d.ts.map +1 -1
  8. package/dist/api/viewer-server.js +34 -0
  9. package/dist/api/viewer-server.js.map +1 -1
  10. package/dist/api/work-actions.d.ts.map +1 -1
  11. package/dist/api/work-actions.js +27 -2
  12. package/dist/api/work-actions.js.map +1 -1
  13. package/dist/cli/commands/backfill.d.ts.map +1 -1
  14. package/dist/cli/commands/backfill.js +1 -0
  15. package/dist/cli/commands/backfill.js.map +1 -1
  16. package/dist/cli/commands/backup.d.ts +13 -0
  17. package/dist/cli/commands/backup.d.ts.map +1 -0
  18. package/dist/cli/commands/backup.js +137 -0
  19. package/dist/cli/commands/backup.js.map +1 -0
  20. package/dist/cli/commands/control.d.ts +26 -0
  21. package/dist/cli/commands/control.d.ts.map +1 -0
  22. package/dist/cli/commands/control.js +193 -0
  23. package/dist/cli/commands/control.js.map +1 -0
  24. package/dist/cli/commands/daemon.d.ts +49 -3
  25. package/dist/cli/commands/daemon.d.ts.map +1 -1
  26. package/dist/cli/commands/daemon.js +244 -74
  27. package/dist/cli/commands/daemon.js.map +1 -1
  28. package/dist/cli/commands/doctor.d.ts +13 -0
  29. package/dist/cli/commands/doctor.d.ts.map +1 -0
  30. package/dist/cli/commands/doctor.js +216 -0
  31. package/dist/cli/commands/doctor.js.map +1 -0
  32. package/dist/cli/commands/init.d.ts.map +1 -1
  33. package/dist/cli/commands/init.js +3 -2
  34. package/dist/cli/commands/init.js.map +1 -1
  35. package/dist/cli/commands/logs.d.ts +9 -0
  36. package/dist/cli/commands/logs.d.ts.map +1 -0
  37. package/dist/cli/commands/logs.js +109 -0
  38. package/dist/cli/commands/logs.js.map +1 -0
  39. package/dist/cli/commands/register-owner.d.ts.map +1 -1
  40. package/dist/cli/commands/register-owner.js +12 -0
  41. package/dist/cli/commands/register-owner.js.map +1 -1
  42. package/dist/cli/commands/restore.d.ts +14 -0
  43. package/dist/cli/commands/restore.d.ts.map +1 -0
  44. package/dist/cli/commands/restore.js +130 -0
  45. package/dist/cli/commands/restore.js.map +1 -0
  46. package/dist/cli/commands/service.d.ts +28 -0
  47. package/dist/cli/commands/service.d.ts.map +1 -0
  48. package/dist/cli/commands/service.js +278 -0
  49. package/dist/cli/commands/service.js.map +1 -0
  50. package/dist/cli/commands/uninstall.d.ts +7 -0
  51. package/dist/cli/commands/uninstall.d.ts.map +1 -0
  52. package/dist/cli/commands/uninstall.js +262 -0
  53. package/dist/cli/commands/uninstall.js.map +1 -0
  54. package/dist/cli/index.js +67 -20
  55. package/dist/cli/index.js.map +1 -1
  56. package/dist/cli/launch-files.d.ts +83 -0
  57. package/dist/cli/launch-files.d.ts.map +1 -1
  58. package/dist/cli/launch-files.js +231 -15
  59. package/dist/cli/launch-files.js.map +1 -1
  60. package/dist/cli/runtime/backend-probe.d.ts +34 -0
  61. package/dist/cli/runtime/backend-probe.d.ts.map +1 -0
  62. package/dist/cli/runtime/backend-probe.js +83 -0
  63. package/dist/cli/runtime/backend-probe.js.map +1 -0
  64. package/dist/cli/runtime/backup.d.ts +114 -0
  65. package/dist/cli/runtime/backup.d.ts.map +1 -0
  66. package/dist/cli/runtime/backup.js +564 -0
  67. package/dist/cli/runtime/backup.js.map +1 -0
  68. package/dist/cli/runtime/daemon-control.d.ts +84 -0
  69. package/dist/cli/runtime/daemon-control.d.ts.map +1 -0
  70. package/dist/cli/runtime/daemon-control.js +266 -0
  71. package/dist/cli/runtime/daemon-control.js.map +1 -0
  72. package/dist/cli/runtime/diagnostics.d.ts +43 -0
  73. package/dist/cli/runtime/diagnostics.d.ts.map +1 -0
  74. package/dist/cli/runtime/diagnostics.js +953 -0
  75. package/dist/cli/runtime/diagnostics.js.map +1 -0
  76. package/dist/cli/runtime/restore.d.ts +98 -0
  77. package/dist/cli/runtime/restore.d.ts.map +1 -0
  78. package/dist/cli/runtime/restore.js +756 -0
  79. package/dist/cli/runtime/restore.js.map +1 -0
  80. package/dist/cli/runtime/systemd-service.d.ts +13 -0
  81. package/dist/cli/runtime/systemd-service.d.ts.map +1 -0
  82. package/dist/cli/runtime/systemd-service.js +32 -0
  83. package/dist/cli/runtime/systemd-service.js.map +1 -0
  84. package/dist/connectors/chatwork/index.js +1 -1
  85. package/dist/connectors/chatwork/index.js.map +1 -1
  86. package/dist/connectors/config-loader.d.ts +2 -1
  87. package/dist/connectors/config-loader.d.ts.map +1 -1
  88. package/dist/connectors/config-loader.js +3 -2
  89. package/dist/connectors/config-loader.js.map +1 -1
  90. package/dist/connectors/framework/polling-scheduler.d.ts.map +1 -1
  91. package/dist/connectors/framework/polling-scheduler.js +12 -11
  92. package/dist/connectors/framework/polling-scheduler.js.map +1 -1
  93. package/dist/connectors/imessage/index.d.ts.map +1 -1
  94. package/dist/connectors/imessage/index.js +2 -1
  95. package/dist/connectors/imessage/index.js.map +1 -1
  96. package/dist/connectors/slack/index.js +1 -1
  97. package/dist/connectors/slack/index.js.map +1 -1
  98. package/dist/runtime/backend-security.d.ts +3 -0
  99. package/dist/runtime/backend-security.d.ts.map +1 -1
  100. package/dist/runtime/backend-security.js +13 -5
  101. package/dist/runtime/backend-security.js.map +1 -1
  102. package/dist/runtime/config.d.ts +3 -0
  103. package/dist/runtime/config.d.ts.map +1 -1
  104. package/dist/runtime/config.js +4 -4
  105. package/dist/runtime/config.js.map +1 -1
  106. package/dist/runtime/connectors.d.ts +21 -1
  107. package/dist/runtime/connectors.d.ts.map +1 -1
  108. package/dist/runtime/connectors.js +28 -17
  109. package/dist/runtime/connectors.js.map +1 -1
  110. package/dist/runtime/core-db.d.ts.map +1 -1
  111. package/dist/runtime/core-db.js +2 -0
  112. package/dist/runtime/core-db.js.map +1 -1
  113. package/dist/runtime/owner-system-prompt.d.ts.map +1 -1
  114. package/dist/runtime/owner-system-prompt.js +7 -5
  115. package/dist/runtime/owner-system-prompt.js.map +1 -1
  116. package/dist/runtime/rotating-log.d.ts +44 -0
  117. package/dist/runtime/rotating-log.d.ts.map +1 -0
  118. package/dist/runtime/rotating-log.js +124 -0
  119. package/dist/runtime/rotating-log.js.map +1 -0
  120. package/dist/tools/document-toolkit.d.ts +2 -0
  121. package/dist/tools/document-toolkit.d.ts.map +1 -1
  122. package/dist/tools/document-toolkit.js +2 -0
  123. package/dist/tools/document-toolkit.js.map +1 -1
  124. package/package.json +4 -3
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SERVICE_STOP_SECONDS = exports.CRASH_LOG_CAP_BYTES = exports.CRASH_LOG_NAME = exports.TOOL_DIRECTORIES = exports.START_SCRIPT_MARKER = void 0;
3
4
  exports.findExecutable = findExecutable;
5
+ exports.stableNodePath = stableNodePath;
6
+ exports.versionedNodePath = versionedNodePath;
4
7
  exports.startScript = startScript;
8
+ exports.startPathEntries = startPathEntries;
5
9
  exports.launchAgent = launchAgent;
10
+ exports.systemdUnit = systemdUnit;
11
+ exports.shellWords = shellWords;
12
+ exports.startPathValue = startPathValue;
13
+ exports.startExports = startExports;
14
+ exports.readStartScript = readStartScript;
6
15
  const node_fs_1 = require("node:fs");
7
16
  const node_path_1 = require("node:path");
8
17
  const secrets_js_1 = require("./secrets.js");
@@ -21,32 +30,69 @@ function findExecutable(name) {
21
30
  }
22
31
  return undefined;
23
32
  }
33
+ /**
34
+ * A Node path that survives an upgrade. Homebrew removes a version's Cellar folder when it
35
+ * upgrades, but keeps `<prefix>/opt/<formula>` (and `<prefix>/bin/node` for `node`) pointing at
36
+ * the current one, so the launch files use those when the running Node lives in the Cellar.
37
+ */
38
+ function stableNodePath(execPath, exists = node_fs_1.existsSync) {
39
+ const brew = /^(.*)\/Cellar\/(node(?:@\d+)?)\/[^/]+\/bin\/node$/.exec(execPath);
40
+ if (!brew)
41
+ return execPath;
42
+ const [, prefix, formula] = brew;
43
+ const candidates = [
44
+ (0, node_path_1.join)(prefix, 'opt', formula, 'bin', 'node'),
45
+ ...(formula === 'node' ? [(0, node_path_1.join)(prefix, 'bin', 'node')] : []),
46
+ ];
47
+ return candidates.find((candidate) => exists(candidate)) ?? execPath;
48
+ }
49
+ /** A Node path that a version manager or an upgrade removes (I6). */
50
+ function versionedNodePath(path) {
51
+ return /\/Cellar\/node(@\d+)?\/|\/\.nvm\/versions\/node\/|\/\.volta\/tools\/image\/node\/|\/fnm\/node-versions\//.test(path);
52
+ }
53
+ /** The first comment line of every start.sh that mama writes. */
54
+ exports.START_SCRIPT_MARKER = '# Written by mama init or mama service install; mama service install rewrites it.';
24
55
  function startScript(options) {
25
56
  const root = (0, node_path_1.join)(options.home, '.mama');
26
- const path = [
27
- ...new Set([
28
- (0, node_path_1.dirname)(options.nodePath),
29
- ...options.executablePaths.map(node_path_1.dirname),
30
- '/usr/bin',
31
- '/bin',
32
- '/usr/sbin',
33
- '/sbin',
34
- ]),
35
- ].join(':');
36
57
  return [
37
58
  '#!/bin/sh',
59
+ exports.START_SCRIPT_MARKER,
38
60
  'set -eu',
39
61
  'umask 077',
40
- `export PATH=${(0, secrets_js_1.shellQuote)(path)}`,
62
+ `export PATH=${(0, secrets_js_1.shellQuote)(startPathEntries(options).join(':'))}`,
41
63
  `cd ${(0, secrets_js_1.shellQuote)(root)}`,
42
64
  'set -a',
43
65
  `. ${(0, secrets_js_1.shellQuote)((0, node_path_1.join)(root, 'auth.env'))}`,
44
66
  'set +a',
67
+ `export MAMA_LOG_LEVEL=${(0, secrets_js_1.shellQuote)(options.logLevel.toUpperCase())}`,
45
68
  ...Object.entries(options.viewer).map(([name, value]) => `export ${name}=${(0, secrets_js_1.shellQuote)(value)}`),
46
- `exec ${(0, secrets_js_1.shellQuote)(options.nodePath)} ${(0, secrets_js_1.shellQuote)(options.cliPath)} daemon >> ${(0, secrets_js_1.shellQuote)((0, node_path_1.join)(root, 'logs', 'daemon.log'))} 2>&1`,
69
+ ...(options.carried ?? []),
70
+ ...crashLogLines(root),
71
+ `exec ${(0, secrets_js_1.shellQuote)(options.nodePath)} ${(0, secrets_js_1.shellQuote)(options.cliPath)} daemon >> "$crash" 2>&1`,
47
72
  '',
48
73
  ].join('\n');
49
74
  }
75
+ /**
76
+ * Where a package manager installs the owner's command-line tools: Homebrew on Apple silicon
77
+ * (/opt/homebrew) and on Intel Macs and most Linux installs (/usr/local). The agent's shell runs
78
+ * those tools (python3 with its packages, sqlite3) and expects them ahead of the system's own, as
79
+ * in the owner's terminal.
80
+ */
81
+ exports.TOOL_DIRECTORIES = ['/opt/homebrew/bin', '/usr/local/bin'];
82
+ /**
83
+ * The PATH a generated start.sh sets: Node's folder, the backend's and gws's, the package
84
+ * manager's folders that exist on this machine, then the system's.
85
+ */
86
+ function startPathEntries(options) {
87
+ const exists = options.exists ?? node_fs_1.existsSync;
88
+ const system = ['/usr/bin', '/bin', '/usr/sbin', '/sbin'];
89
+ // A Node or backend in a system folder (/usr/bin/node on Linux) keeps the system's place, after
90
+ // the tool folders; start.sh runs Node by its full path either way.
91
+ const own = [(0, node_path_1.dirname)(options.nodePath), ...options.executablePaths.map(node_path_1.dirname)].filter((directory) => !system.includes(directory));
92
+ return [
93
+ ...new Set([...own, ...exports.TOOL_DIRECTORIES.filter((directory) => exists(directory)), ...system]),
94
+ ];
95
+ }
50
96
  function xml(value) {
51
97
  return value
52
98
  .replace(/&/g, '&amp;')
@@ -55,6 +101,31 @@ function xml(value) {
55
101
  .replace(/"/g, '&quot;')
56
102
  .replace(/'/g, '&apos;');
57
103
  }
104
+ /**
105
+ * What the service manager captures before the daemon writes its own rotated log (daemon.log):
106
+ * start.sh's own messages, a crash while Node loads, a fatal error, a native library's writes.
107
+ */
108
+ exports.CRASH_LOG_NAME = 'crash.log';
109
+ /** start.sh empties the crash log at start once it is past this size. */
110
+ exports.CRASH_LOG_CAP_BYTES = 1024 * 1024;
111
+ /**
112
+ * start.sh's crash log: only what comes before the daemon takes over its own output lands there;
113
+ * it is made owner-only and emptied at start once past the cap.
114
+ */
115
+ function crashLogLines(root) {
116
+ return [
117
+ `crash=${(0, secrets_js_1.shellQuote)((0, node_path_1.join)(root, 'logs', exports.CRASH_LOG_NAME))}`,
118
+ // launchd creates the file it redirects to before this script's umask applies.
119
+ `if [ -f "$crash" ]; then chmod 600 "$crash"; fi`,
120
+ `if [ -f "$crash" ] && [ "$(wc -c < "$crash")" -gt ${exports.CRASH_LOG_CAP_BYTES} ]; then : > "$crash"; fi`,
121
+ ];
122
+ }
123
+ /** Seconds a service manager waits for a stopping daemon before it kills it. */
124
+ exports.SERVICE_STOP_SECONDS = 60;
125
+ /**
126
+ * The LaunchAgent restarts the daemon only after a failure: a clean exit (a stop, or a refusal
127
+ * because another process holds the install) leaves it stopped.
128
+ */
58
129
  function launchAgent(home) {
59
130
  const root = (0, node_path_1.join)(home, '.mama');
60
131
  return `<?xml version="1.0" encoding="UTF-8"?>
@@ -65,10 +136,155 @@ function launchAgent(home) {
65
136
  <key>WorkingDirectory</key><string>${xml(root)}</string>
66
137
  <key>EnvironmentVariables</key><dict><key>HOME</key><string>${xml(home)}</string></dict>
67
138
  <key>RunAtLoad</key><true/>
68
- <key>KeepAlive</key><true/>
69
- <key>StandardOutPath</key><string>${xml((0, node_path_1.join)(root, 'logs', 'daemon.log'))}</string>
70
- <key>StandardErrorPath</key><string>${xml((0, node_path_1.join)(root, 'logs', 'daemon.log'))}</string>
139
+ <key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict>
140
+ <key>ExitTimeOut</key><integer>${exports.SERVICE_STOP_SECONDS}</integer>
141
+ <key>StandardOutPath</key><string>${xml((0, node_path_1.join)(root, 'logs', exports.CRASH_LOG_NAME))}</string>
142
+ <key>StandardErrorPath</key><string>${xml((0, node_path_1.join)(root, 'logs', exports.CRASH_LOG_NAME))}</string>
71
143
  </dict></plist>
72
144
  `;
73
145
  }
146
+ /**
147
+ * The systemd user unit, with the same restart policy as the LaunchAgent. `%h` is the home folder,
148
+ * expanded by systemd per argument, so a path with spaces stays one argument. KillMode=mixed sends
149
+ * the stop signal to the daemon alone, which stops its children in order; anything left is killed
150
+ * when the stop times out.
151
+ */
152
+ function systemdUnit() {
153
+ return [
154
+ '[Unit]',
155
+ 'Description=MAMA OS daemon',
156
+ '',
157
+ '[Service]',
158
+ 'Type=simple',
159
+ 'WorkingDirectory=%h/.mama',
160
+ 'ExecStart="%h/.mama/start.sh"',
161
+ 'Restart=on-failure',
162
+ 'RestartSec=10',
163
+ `TimeoutStopSec=${exports.SERVICE_STOP_SECONDS}`,
164
+ 'KillMode=mixed',
165
+ '',
166
+ '[Install]',
167
+ 'WantedBy=default.target',
168
+ '',
169
+ ].join('\n');
170
+ }
171
+ /**
172
+ * Split a start.sh line into words as sh does before expansion: a `#` starting a word ends the
173
+ * line, single quotes are literal, double
174
+ * quotes keep their text (a backslash escapes `"`, `\\`, `$` and a backtick), and a backslash
175
+ * outside quotes escapes the next character. Variables stay as written.
176
+ */
177
+ function shellWords(line) {
178
+ const words = [];
179
+ let word = null;
180
+ for (let index = 0; index < line.length; index += 1) {
181
+ const char = line[index];
182
+ if (char === "'") {
183
+ const end = line.indexOf("'", index + 1);
184
+ if (end < 0)
185
+ throw new Error('unterminated single quote');
186
+ word = (word ?? '') + line.slice(index + 1, end);
187
+ index = end;
188
+ }
189
+ else if (char === '"') {
190
+ let text = '';
191
+ index += 1;
192
+ while (index < line.length && line[index] !== '"') {
193
+ if (line[index] === '\\' && '"\\$`'.includes(line[index + 1] ?? ''))
194
+ index += 1;
195
+ text += line[index];
196
+ index += 1;
197
+ }
198
+ if (index >= line.length)
199
+ throw new Error('unterminated double quote');
200
+ word = (word ?? '') + text;
201
+ }
202
+ else if (char === '\\') {
203
+ word = (word ?? '') + (line[index + 1] ?? '');
204
+ index += 1;
205
+ }
206
+ else if (/\s/.test(char)) {
207
+ if (word !== null)
208
+ words.push(word);
209
+ word = null;
210
+ }
211
+ else if (char === '#' && word === null) {
212
+ // A # that starts a word starts a comment.
213
+ break;
214
+ }
215
+ else {
216
+ word = (word ?? '') + char;
217
+ }
218
+ }
219
+ if (word !== null)
220
+ words.push(word);
221
+ return words;
222
+ }
223
+ /** The PATH entries an `export PATH=` value names, with `$HOME` and `~` read as `home`. */
224
+ function startPathValue(value, home) {
225
+ return (shellWords(value)[0] ?? '')
226
+ .split(':')
227
+ .map((entry) => entry.replace(/^(\$HOME|\$\{HOME\}|~)(?=\/|$)/, home))
228
+ .filter((entry) => entry !== '' && entry !== '$PATH' && entry !== '${PATH}');
229
+ }
230
+ /** The values a start.sh's carried `export` lines set, unquoted. */
231
+ function startExports(reading) {
232
+ return Object.fromEntries(reading.carried.flatMap((line) => {
233
+ const match = /^export\s+([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
234
+ return match ? [[match[1], shellWords(match[2])[0] ?? '']] : [];
235
+ }));
236
+ }
237
+ /**
238
+ * Read a start.sh against what this install's generated one holds. Only exact generated lines
239
+ * count as reproduced: a changed `cd` or a different sourced file is reported, not dropped.
240
+ */
241
+ function readStartScript(script, home) {
242
+ const root = (0, node_path_1.join)(home, '.mama');
243
+ const generatedLines = new Set([
244
+ 'set -eu',
245
+ 'set -a',
246
+ 'set +a',
247
+ 'umask 077',
248
+ `cd ${(0, secrets_js_1.shellQuote)(root)}`,
249
+ `. ${(0, secrets_js_1.shellQuote)((0, node_path_1.join)(root, 'auth.env'))}`,
250
+ ...crashLogLines(root),
251
+ ]);
252
+ const carried = [];
253
+ const notReproduced = [];
254
+ let path = null;
255
+ let logLevel = null;
256
+ let exec = null;
257
+ for (const raw of script.split('\n')) {
258
+ const line = raw.trim();
259
+ if (line === '')
260
+ continue;
261
+ const exported = /^export\s+([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
262
+ if (exported) {
263
+ if (exported[1] === 'PATH')
264
+ path = exported[2];
265
+ else if (exported[1] === 'MAMA_LOG_LEVEL')
266
+ logLevel = exported[2];
267
+ else
268
+ carried.push(line);
269
+ continue;
270
+ }
271
+ if (/^exec\s/.test(line)) {
272
+ exec = line;
273
+ continue;
274
+ }
275
+ if (line.startsWith('#') || generatedLines.has(line))
276
+ continue;
277
+ notReproduced.push(line);
278
+ }
279
+ const authLine = `. ${(0, secrets_js_1.shellQuote)((0, node_path_1.join)(root, 'auth.env'))}`;
280
+ return {
281
+ generated: script.includes(exports.START_SCRIPT_MARKER),
282
+ loadsAuthEnv: script.split('\n').some((line) => line.trim() === authLine),
283
+ carried,
284
+ path,
285
+ logLevel,
286
+ exec,
287
+ notReproduced,
288
+ };
289
+ }
74
290
  //# sourceMappingURL=launch-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"launch-files.js","sourceRoot":"","sources":["../../src/cli/launch-files.ts"],"names":[],"mappings":";;AAIA,wCAYC;AAED,kCA+BC;AAWD,kCAeC;AA3ED,qCAAgD;AAChD,yCAAiE;AACjE,6CAA0C;AAE1C,SAAgB,cAAc,CAAC,IAAY;IACzC,KAAK,MAAM,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAS,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC,IAAA,sBAAU,EAAC,SAAS,CAAC;YAAE,SAAS;QACrC,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC;YACH,IAAA,oBAAU,EAAC,IAAI,EAAE,mBAAS,CAAC,IAAI,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,WAAW,CAAC,OAM3B;IACC,MAAM,IAAI,GAAG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CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,QAAQ,CAAC;QACzE,OAAO;QACP,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,aAAa;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type SpawnSyncReturns } from 'node:child_process';
2
+ /**
3
+ * The oldest backend CLI versions a MAMA release was verified on. MAMA depends on their sandbox,
4
+ * hook, settings and permission behaviour, so an older CLI is refused; raise these only after
5
+ * verifying a newer one.
6
+ */
7
+ export declare const MINIMUM_BACKEND_VERSIONS: {
8
+ readonly claude: "2.1.299";
9
+ readonly codex: "0.160.1";
10
+ };
11
+ export type BackendName = keyof typeof MINIMUM_BACKEND_VERSIONS;
12
+ export type ProbeRun = (command: string, args: string[], env?: NodeJS.ProcessEnv) => SpawnSyncReturns<string>;
13
+ export declare function defaultProbeRun(command: string, args: string[], env?: NodeJS.ProcessEnv): SpawnSyncReturns<string>;
14
+ /** Compare dotted numeric versions; a missing part counts as 0. */
15
+ export declare function compareVersions(left: string, right: string): number;
16
+ export interface BackendProbe {
17
+ readonly version: string | null;
18
+ readonly minimum: string;
19
+ readonly versionOk: boolean;
20
+ readonly loggedIn: boolean;
21
+ /** Why the version or the login could not be read; never a credential. */
22
+ readonly problem: string | null;
23
+ }
24
+ /**
25
+ * Read a backend CLI's version and whether it is signed in, without printing anything the CLI
26
+ * says about the account. `env` is the environment the daemon gives the backend, so a login that
27
+ * only this shell's variables provide does not count; Codex is asked about the managed home.
28
+ */
29
+ export declare function probeBackend(backend: BackendName, executable: string, options?: {
30
+ codexHome?: string;
31
+ run?: ProbeRun;
32
+ env?: NodeJS.ProcessEnv;
33
+ }): BackendProbe;
34
+ //# sourceMappingURL=backend-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-probe.d.ts","sourceRoot":"","sources":["../../../src/cli/runtime/backend-probe.ts"],"names":[],"mappings":"AAAA,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0;
4
+ exports.defaultProbeRun = defaultProbeRun;
5
+ exports.compareVersions = compareVersions;
6
+ exports.probeBackend = probeBackend;
7
+ const node_child_process_1 = require("node:child_process");
8
+ /**
9
+ * The oldest backend CLI versions a MAMA release was verified on. MAMA depends on their sandbox,
10
+ * hook, settings and permission behaviour, so an older CLI is refused; raise these only after
11
+ * verifying a newer one.
12
+ */
13
+ exports.MINIMUM_BACKEND_VERSIONS = {
14
+ claude: '2.1.299',
15
+ codex: '0.160.1',
16
+ };
17
+ function defaultProbeRun(command, args, env) {
18
+ return (0, node_child_process_1.spawnSync)(command, args, { encoding: 'utf8', timeout: 20_000, env: env ?? process.env });
19
+ }
20
+ /** Compare dotted numeric versions; a missing part counts as 0. */
21
+ function compareVersions(left, right) {
22
+ const a = left.split('.').map((part) => Number.parseInt(part, 10) || 0);
23
+ const b = right.split('.').map((part) => Number.parseInt(part, 10) || 0);
24
+ for (let index = 0; index < Math.max(a.length, b.length); index += 1) {
25
+ const difference = (a[index] ?? 0) - (b[index] ?? 0);
26
+ if (difference !== 0)
27
+ return difference;
28
+ }
29
+ return 0;
30
+ }
31
+ /**
32
+ * Read a backend CLI's version and whether it is signed in, without printing anything the CLI
33
+ * says about the account. `env` is the environment the daemon gives the backend, so a login that
34
+ * only this shell's variables provide does not count; Codex is asked about the managed home.
35
+ */
36
+ function probeBackend(backend, executable, options = {}) {
37
+ const run = options.run ?? defaultProbeRun;
38
+ const env = options.env ?? process.env;
39
+ const minimum = exports.MINIMUM_BACKEND_VERSIONS[backend];
40
+ const versionRun = run(executable, ['--version'], env);
41
+ const version = versionRun.error
42
+ ? null
43
+ : (/(\d+\.\d+\.\d+)/.exec(`${versionRun.stdout ?? ''}`)?.[1] ?? null);
44
+ if (version === null) {
45
+ return {
46
+ version: null,
47
+ minimum,
48
+ versionOk: false,
49
+ loggedIn: false,
50
+ problem: `${backend} --version printed no version`,
51
+ };
52
+ }
53
+ const versionOk = compareVersions(version, minimum) >= 0;
54
+ if (backend === 'claude') {
55
+ const status = run(executable, ['auth', 'status', '--json'], env);
56
+ let loggedIn = false;
57
+ try {
58
+ loggedIn = JSON.parse(`${status.stdout ?? ''}`).loggedIn === true;
59
+ }
60
+ catch {
61
+ return {
62
+ version,
63
+ minimum,
64
+ versionOk,
65
+ loggedIn: false,
66
+ problem: 'claude auth status did not answer in JSON',
67
+ };
68
+ }
69
+ return { version, minimum, versionOk, loggedIn, problem: null };
70
+ }
71
+ const status = run(executable, ['login', 'status'], {
72
+ ...env,
73
+ ...(options.codexHome ? { CODEX_HOME: options.codexHome } : {}),
74
+ });
75
+ return {
76
+ version,
77
+ minimum,
78
+ versionOk,
79
+ loggedIn: !status.error && status.status === 0,
80
+ problem: null,
81
+ };
82
+ }
83
+ //# sourceMappingURL=backend-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-probe.js","sourceRoot":"","sources":["../../../src/cli/runtime/backend-probe.ts"],"names":[],"mappings":";;;AAoBA,0CAMC;AAGD,0CAQC;AAgBD,oCAiDC;AAtGD,2DAAsE;AAEtE;;;;GAIG;AACU,QAAA,wBAAwB,GAAG;IACtC,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;CACR,CAAC;AAUX,SAAgB,eAAe,CAC7B,OAAe,EACf,IAAc,EACd,GAAuB;IAEvB,OAAO,IAAA,8BAAS,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,mEAAmE;AACnE,SAAgB,eAAe,CAAC,IAAY,EAAE,KAAa;IACzD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,MAA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ats } from 'node:fs';
2
+ import type { W1Config } from '../../runtime/config.js';
3
+ /** One path in a backup, named by its place in the archive. */
4
+ export interface BackupEntry {
5
+ readonly path: string;
6
+ readonly type: 'file' | 'dir' | 'symlink';
7
+ /** Permission bits as they were. */
8
+ readonly mode: number;
9
+ readonly size?: number;
10
+ readonly sha256?: string;
11
+ /** A symlink's target, as stored. */
12
+ readonly target?: string;
13
+ }
14
+ export interface BackupManifest {
15
+ readonly format: 'mama-backup';
16
+ readonly version: 1;
17
+ readonly createdAt: string;
18
+ readonly mama: string;
19
+ readonly platform: string;
20
+ /** The highest migration applied to the database, or null when it has none. */
21
+ readonly schemaVersion: number | null;
22
+ readonly includesSecrets: boolean;
23
+ readonly includesLogs: boolean;
24
+ /** Each archive prefix and the physical path it came from. */
25
+ readonly roots: Record<string, string>;
26
+ /** Every path the install was configured with, as written and as it really is. */
27
+ readonly configured: Record<string, ConfiguredPath | null>;
28
+ /** MAMA's own databases in the archive, each checked with integrity_check. */
29
+ readonly databases: string[];
30
+ readonly entries: BackupEntry[];
31
+ }
32
+ /** A tree or file archived under `prefix`, and which of its paths to keep. */
33
+ export interface BackupSource {
34
+ readonly prefix: string;
35
+ /** Physical path. */
36
+ readonly path: string;
37
+ readonly keep: (relativePath: string, stat: Stats) => boolean;
38
+ }
39
+ export interface BackupPlan {
40
+ readonly sources: BackupSource[];
41
+ /** The database file boot opens; the archive holds a copy taken with SQLite's backup. */
42
+ readonly database: string;
43
+ readonly configured: Record<string, ConfiguredPath | null>;
44
+ /** Top-level names in the MAMA root that this version does not read. */
45
+ readonly leftOut: string[];
46
+ /** Credentials that exist and were left out because they were not asked for. */
47
+ readonly secretsLeftOut: string[];
48
+ }
49
+ /** runtime/ files the current code reads back; the rest of runtime/ is per boot or per run. */
50
+ /** Files directly in the MAMA root that a backup keeps; restore accepts no other root files. */
51
+ export declare const ROOT_FILES: readonly ["config.yaml", "connectors.json", "owner-policy.md", "report-slots.json", "start.sh"];
52
+ /** Folders in the MAMA root that a backup keeps (logs only when asked), besides the workspace. */
53
+ export declare const ROOT_DIRS: readonly ["connectors", "downloads", "runtime", "logs"];
54
+ /** Folders in runtime/ that a backup keeps. */
55
+ export declare const RUNTIME_DIRS: readonly ["backfill"];
56
+ export declare const RUNTIME_FILES: Set<string>;
57
+ /** Setting paths whose string value sits under a credential name. Values are never read out. */
58
+ export declare function secretShapedKeys(value: unknown): string[];
59
+ /** A configured path as written and as it really is; restore rewrites both. */
60
+ export interface ConfiguredPath {
61
+ readonly configured: string;
62
+ readonly physical: string;
63
+ }
64
+ /**
65
+ * What a backup holds, from what the current code reads and writes (not from what a root happens
66
+ * to contain): the MAMA root's state, the database, the workspace, every person's tree under
67
+ * member_root, the published common skills, the wiki MAMA writes and Jev's vocabulary.
68
+ * Credentials, and any file that can hold one, come only with `includeSecrets`; logs only with
69
+ * `includeLogs`.
70
+ */
71
+ export declare function planBackup(config: W1Config, configPath: string, options: {
72
+ includeSecrets: boolean;
73
+ includeLogs: boolean;
74
+ home: string;
75
+ }): BackupPlan;
76
+ export interface CollectedEntries {
77
+ readonly entries: BackupEntry[];
78
+ /** Each entry's physical path, in archive order. */
79
+ readonly absolutes: string[];
80
+ }
81
+ /**
82
+ * The entries each source keeps, in the order tar will write them. A path reached twice (through
83
+ * overlapping sources) is kept once, under the first source that reached it.
84
+ */
85
+ export declare function collectEntries(sources: readonly BackupSource[]): Promise<CollectedEntries>;
86
+ /** Copy a SQLite database with its backup API and confirm the copy with integrity_check. */
87
+ export declare function copyDatabase(source: string, destination: string): Promise<{
88
+ schemaVersion: number | null;
89
+ }>;
90
+ /**
91
+ * integrity_check must answer ok. For MAMA's main database, also read the highest applied
92
+ * migration; another database's tables are its own.
93
+ */
94
+ export declare function checkDatabase(path: string, options?: {
95
+ schema: boolean;
96
+ }): {
97
+ schemaVersion: number | null;
98
+ };
99
+ /** The raw stores under connectors/: MAMA's own databases besides the main one. */
100
+ export declare function rawStores(root: string): string[];
101
+ /**
102
+ * Write exactly the collected entries, manifest first, each under its archive name, with modes
103
+ * and symlinks as they are. The file is created 0600 and flushed to disk before it returns.
104
+ */
105
+ export declare function writeArchive(file: string, manifestPath: string, collected: CollectedEntries): Promise<void>;
106
+ /** Flush a file or a folder's entries to disk. */
107
+ export declare function syncPath(path: string): void;
108
+ /**
109
+ * Read the archive back: the manifest comes first, every entry it lists is there once with its
110
+ * type and link target, nothing else is, and every file hashes to what the manifest recorded.
111
+ */
112
+ export declare function verifyArchive(file: string, manifest: BackupManifest): Promise<void>;
113
+ export declare function archiveName(now: Date): string;
114
+ //# sourceMappingURL=backup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../../src/cli/runtime/backup.ts"],"names":[],"mappings":"AACA,OAAO,EAWL,KAAK,KAAK,EACX,MAAM,SAAS,CAAC;AAKjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;IAC1C,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,qCAAqC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CA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