@jungjaehoon/mama-os 0.78.0 → 0.79.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.
- package/CHANGELOG.md +311 -0
- package/README.md +38 -24
- package/db/migrations/002-model-runs-parent-index.sql +11 -0
- package/db/migrations/003-upkeep-settled.sql +15 -0
- package/dist/api/google-read-actions.d.ts +30 -0
- package/dist/api/google-read-actions.d.ts.map +1 -0
- package/dist/api/google-read-actions.js +256 -0
- package/dist/api/google-read-actions.js.map +1 -0
- package/dist/api/record-actions.d.ts.map +1 -1
- package/dist/api/record-actions.js +23 -5
- package/dist/api/record-actions.js.map +1 -1
- package/dist/api/report-handler.d.ts +0 -6
- package/dist/api/report-handler.d.ts.map +1 -1
- package/dist/api/report-handler.js +0 -54
- package/dist/api/report-handler.js.map +1 -1
- package/dist/api/security-events.d.ts +1 -1
- package/dist/api/security-events.d.ts.map +1 -1
- package/dist/api/security-events.js.map +1 -1
- package/dist/api/source-actions.d.ts +9 -0
- package/dist/api/source-actions.d.ts.map +1 -1
- package/dist/api/source-actions.js +49 -0
- package/dist/api/source-actions.js.map +1 -1
- package/dist/api/viewer-request-security.d.ts +14 -1
- package/dist/api/viewer-request-security.d.ts.map +1 -1
- package/dist/api/viewer-request-security.js +26 -3
- package/dist/api/viewer-request-security.js.map +1 -1
- package/dist/api/viewer-server.d.ts +7 -0
- package/dist/api/viewer-server.d.ts.map +1 -1
- package/dist/api/viewer-server.js +32 -0
- package/dist/api/viewer-server.js.map +1 -1
- package/dist/api/work-actions.d.ts +19 -2
- package/dist/api/work-actions.d.ts.map +1 -1
- package/dist/api/work-actions.js +15 -0
- package/dist/api/work-actions.js.map +1 -1
- package/dist/cli/commands/backup.d.ts +7 -6
- package/dist/cli/commands/backup.d.ts.map +1 -1
- package/dist/cli/commands/backup.js +44 -7
- package/dist/cli/commands/backup.js.map +1 -1
- package/dist/cli/commands/control.d.ts +22 -4
- package/dist/cli/commands/control.d.ts.map +1 -1
- package/dist/cli/commands/control.js +172 -11
- package/dist/cli/commands/control.js.map +1 -1
- package/dist/cli/commands/daemon.d.ts +13 -2
- package/dist/cli/commands/daemon.d.ts.map +1 -1
- package/dist/cli/commands/daemon.js +211 -5
- package/dist/cli/commands/daemon.js.map +1 -1
- package/dist/cli/commands/init-questions.d.ts +98 -0
- package/dist/cli/commands/init-questions.d.ts.map +1 -0
- package/dist/cli/commands/init-questions.js +420 -0
- package/dist/cli/commands/init-questions.js.map +1 -0
- package/dist/cli/commands/init-section.d.ts +13 -0
- package/dist/cli/commands/init-section.d.ts.map +1 -0
- package/dist/cli/commands/init-section.js +375 -0
- package/dist/cli/commands/init-section.js.map +1 -0
- package/dist/cli/commands/init.d.ts +56 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +562 -351
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/node-move.d.ts +20 -0
- package/dist/cli/commands/node-move.d.ts.map +1 -0
- package/dist/cli/commands/node-move.js +289 -0
- package/dist/cli/commands/node-move.js.map +1 -0
- package/dist/cli/commands/register-owner.d.ts +3 -0
- package/dist/cli/commands/register-owner.d.ts.map +1 -1
- package/dist/cli/commands/register-owner.js +2 -0
- package/dist/cli/commands/register-owner.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +2 -0
- package/dist/cli/commands/restore.d.ts.map +1 -1
- package/dist/cli/commands/restore.js +7 -0
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/service.d.ts +16 -0
- package/dist/cli/commands/service.d.ts.map +1 -1
- package/dist/cli/commands/service.js +36 -8
- package/dist/cli/commands/service.js.map +1 -1
- package/dist/cli/commands/tools.d.ts +1 -1
- package/dist/cli/commands/tools.d.ts.map +1 -1
- package/dist/cli/commands/tools.js +8 -3
- package/dist/cli/commands/tools.js.map +1 -1
- package/dist/cli/commands/uninstall.d.ts.map +1 -1
- package/dist/cli/commands/uninstall.js +78 -5
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/commands/update.d.ts +59 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +948 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.js +8 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/launch-files.d.ts +36 -0
- package/dist/cli/launch-files.d.ts.map +1 -1
- package/dist/cli/launch-files.js +94 -1
- package/dist/cli/launch-files.js.map +1 -1
- package/dist/cli/prompt.d.ts +2 -1
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/prompt.js +5 -2
- package/dist/cli/prompt.js.map +1 -1
- package/dist/cli/runtime/backup.d.ts +17 -1
- package/dist/cli/runtime/backup.d.ts.map +1 -1
- package/dist/cli/runtime/backup.js +32 -4
- package/dist/cli/runtime/backup.js.map +1 -1
- package/dist/cli/runtime/daemon-control.d.ts +92 -7
- package/dist/cli/runtime/daemon-control.d.ts.map +1 -1
- package/dist/cli/runtime/daemon-control.js +183 -8
- package/dist/cli/runtime/daemon-control.js.map +1 -1
- package/dist/cli/runtime/default-roots.d.ts +27 -0
- package/dist/cli/runtime/default-roots.d.ts.map +1 -0
- package/dist/cli/runtime/default-roots.js +61 -0
- package/dist/cli/runtime/default-roots.js.map +1 -0
- package/dist/cli/runtime/diagnostics.d.ts +25 -0
- package/dist/cli/runtime/diagnostics.d.ts.map +1 -1
- package/dist/cli/runtime/diagnostics.js +249 -63
- package/dist/cli/runtime/diagnostics.js.map +1 -1
- package/dist/cli/runtime/init-state.d.ts +20 -0
- package/dist/cli/runtime/init-state.d.ts.map +1 -0
- package/dist/cli/runtime/init-state.js +51 -0
- package/dist/cli/runtime/init-state.js.map +1 -0
- package/dist/cli/runtime/install-kind.d.ts +54 -0
- package/dist/cli/runtime/install-kind.d.ts.map +1 -0
- package/dist/cli/runtime/install-kind.js +164 -0
- package/dist/cli/runtime/install-kind.js.map +1 -0
- package/dist/cli/runtime/node-move-journal.d.ts +44 -0
- package/dist/cli/runtime/node-move-journal.d.ts.map +1 -0
- package/dist/cli/runtime/node-move-journal.js +48 -0
- package/dist/cli/runtime/node-move-journal.js.map +1 -0
- package/dist/cli/runtime/release-check.d.ts +94 -0
- package/dist/cli/runtime/release-check.d.ts.map +1 -0
- package/dist/cli/runtime/release-check.js +316 -0
- package/dist/cli/runtime/release-check.js.map +1 -0
- package/dist/cli/runtime/setup-page.d.ts +57 -0
- package/dist/cli/runtime/setup-page.d.ts.map +1 -0
- package/dist/cli/runtime/setup-page.js +266 -0
- package/dist/cli/runtime/setup-page.js.map +1 -0
- package/dist/cli/runtime/source-tools.d.ts +60 -0
- package/dist/cli/runtime/source-tools.d.ts.map +1 -0
- package/dist/cli/runtime/source-tools.js +170 -0
- package/dist/cli/runtime/source-tools.js.map +1 -0
- package/dist/cli/runtime/telegram-pairing.d.ts +73 -0
- package/dist/cli/runtime/telegram-pairing.d.ts.map +1 -0
- package/dist/cli/runtime/telegram-pairing.js +184 -0
- package/dist/cli/runtime/telegram-pairing.js.map +1 -0
- package/dist/cli/runtime/update-journal.d.ts +135 -0
- package/dist/cli/runtime/update-journal.d.ts.map +1 -0
- package/dist/cli/runtime/update-journal.js +144 -0
- package/dist/cli/runtime/update-journal.js.map +1 -0
- package/dist/cli/runtime/update-progress.d.ts +95 -0
- package/dist/cli/runtime/update-progress.d.ts.map +1 -0
- package/dist/cli/runtime/update-progress.js +154 -0
- package/dist/cli/runtime/update-progress.js.map +1 -0
- package/dist/cli/runtime/update-request.d.ts +58 -0
- package/dist/cli/runtime/update-request.d.ts.map +1 -0
- package/dist/cli/runtime/update-request.js +172 -0
- package/dist/cli/runtime/update-request.js.map +1 -0
- package/dist/connectors/calendar/index.d.ts +5 -1
- package/dist/connectors/calendar/index.d.ts.map +1 -1
- package/dist/connectors/calendar/index.js +19 -28
- package/dist/connectors/calendar/index.js.map +1 -1
- package/dist/connectors/chatwork/index.d.ts.map +1 -1
- package/dist/connectors/chatwork/index.js +7 -3
- package/dist/connectors/chatwork/index.js.map +1 -1
- package/dist/connectors/config-loader.d.ts +5 -0
- package/dist/connectors/config-loader.d.ts.map +1 -1
- package/dist/connectors/config-loader.js +8 -0
- package/dist/connectors/config-loader.js.map +1 -1
- package/dist/connectors/discord/index.d.ts.map +1 -1
- package/dist/connectors/discord/index.js +4 -3
- package/dist/connectors/discord/index.js.map +1 -1
- package/dist/connectors/drive/index.d.ts.map +1 -1
- package/dist/connectors/drive/index.js +15 -13
- package/dist/connectors/drive/index.js.map +1 -1
- package/dist/connectors/framework/gws-utils.d.ts +62 -0
- package/dist/connectors/framework/gws-utils.d.ts.map +1 -1
- package/dist/connectors/framework/gws-utils.js +133 -3
- package/dist/connectors/framework/gws-utils.js.map +1 -1
- package/dist/connectors/framework/types.d.ts +24 -0
- package/dist/connectors/framework/types.d.ts.map +1 -1
- package/dist/connectors/framework/types.js +9 -0
- package/dist/connectors/framework/types.js.map +1 -1
- package/dist/connectors/gmail/index.d.ts.map +1 -1
- package/dist/connectors/gmail/index.js +14 -13
- package/dist/connectors/gmail/index.js.map +1 -1
- package/dist/connectors/index.d.ts +4 -4
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +4 -10
- package/dist/connectors/index.js.map +1 -1
- package/dist/connectors/notion/index.d.ts.map +1 -1
- package/dist/connectors/notion/index.js +5 -3
- package/dist/connectors/notion/index.js.map +1 -1
- package/dist/connectors/sheets/index.d.ts.map +1 -1
- package/dist/connectors/sheets/index.js +17 -12
- package/dist/connectors/sheets/index.js.map +1 -1
- package/dist/connectors/slack/index.d.ts.map +1 -1
- package/dist/connectors/slack/index.js +9 -3
- package/dist/connectors/slack/index.js.map +1 -1
- package/dist/connectors/telegram/index.d.ts.map +1 -1
- package/dist/connectors/telegram/index.js +4 -3
- package/dist/connectors/telegram/index.js.map +1 -1
- package/dist/connectors/trello/index.d.ts +1 -1
- package/dist/connectors/trello/index.d.ts.map +1 -1
- package/dist/connectors/trello/index.js +10 -5
- package/dist/connectors/trello/index.js.map +1 -1
- package/dist/gateways/discord.d.ts +6 -0
- package/dist/gateways/discord.d.ts.map +1 -1
- package/dist/gateways/discord.js +38 -27
- package/dist/gateways/discord.js.map +1 -1
- package/dist/gateways/slack.d.ts +6 -0
- package/dist/gateways/slack.d.ts.map +1 -1
- package/dist/gateways/slack.js +38 -27
- package/dist/gateways/slack.js.map +1 -1
- package/dist/gateways/telegram-commands.d.ts +124 -0
- package/dist/gateways/telegram-commands.d.ts.map +1 -0
- package/dist/gateways/telegram-commands.js +131 -0
- package/dist/gateways/telegram-commands.js.map +1 -0
- package/dist/gateways/telegram.d.ts +20 -0
- package/dist/gateways/telegram.d.ts.map +1 -1
- package/dist/gateways/telegram.js +138 -34
- package/dist/gateways/telegram.js.map +1 -1
- package/dist/gateways/turn-contract.d.ts +11 -0
- package/dist/gateways/turn-contract.d.ts.map +1 -1
- package/dist/runtime/action-surface.d.ts +1 -1
- package/dist/runtime/action-surface.d.ts.map +1 -1
- package/dist/runtime/action-surface.js +10 -0
- package/dist/runtime/action-surface.js.map +1 -1
- package/dist/runtime/backend-security.d.ts +23 -2
- package/dist/runtime/backend-security.d.ts.map +1 -1
- package/dist/runtime/backend-security.js +50 -5
- package/dist/runtime/backend-security.js.map +1 -1
- package/dist/runtime/member-paths.d.ts +15 -7
- package/dist/runtime/member-paths.d.ts.map +1 -1
- package/dist/runtime/member-paths.js +64 -12
- package/dist/runtime/member-paths.js.map +1 -1
- package/dist/runtime/member-session.d.ts +4 -0
- package/dist/runtime/member-session.d.ts.map +1 -1
- package/dist/runtime/member-session.js +23 -2
- package/dist/runtime/member-session.js.map +1 -1
- package/dist/runtime/native-session.d.ts +2 -0
- package/dist/runtime/native-session.d.ts.map +1 -1
- package/dist/runtime/native-session.js +1 -0
- package/dist/runtime/native-session.js.map +1 -1
- package/dist/runtime/owner-runtime.d.ts +63 -1
- package/dist/runtime/owner-runtime.d.ts.map +1 -1
- package/dist/runtime/owner-runtime.js +180 -3
- package/dist/runtime/owner-runtime.js.map +1 -1
- package/dist/runtime/owner-system-prompt.d.ts.map +1 -1
- package/dist/runtime/owner-system-prompt.js +0 -1
- package/dist/runtime/owner-system-prompt.js.map +1 -1
- package/dist/runtime/principal-access.d.ts +2 -0
- package/dist/runtime/principal-access.d.ts.map +1 -1
- package/dist/runtime/principal-access.js +7 -0
- package/dist/runtime/principal-access.js.map +1 -1
- package/dist/runtime/principal-sessions.d.ts.map +1 -1
- package/dist/runtime/principal-sessions.js +8 -1
- package/dist/runtime/principal-sessions.js.map +1 -1
- package/dist/runtime/record-orders.d.ts.map +1 -1
- package/dist/runtime/record-orders.js +3 -29
- package/dist/runtime/record-orders.js.map +1 -1
- package/dist/runtime/report-scheduler.d.ts +9 -2
- package/dist/runtime/report-scheduler.d.ts.map +1 -1
- package/dist/runtime/report-scheduler.js +37 -10
- package/dist/runtime/report-scheduler.js.map +1 -1
- package/dist/runtime/stimulus-delivery.d.ts +3 -0
- package/dist/runtime/stimulus-delivery.d.ts.map +1 -1
- package/dist/runtime/stimulus-delivery.js +19 -3
- package/dist/runtime/stimulus-delivery.js.map +1 -1
- package/dist/runtime/tools-paths.d.ts +7 -0
- package/dist/runtime/tools-paths.d.ts.map +1 -1
- package/dist/runtime/tools-paths.js +11 -5
- package/dist/runtime/tools-paths.js.map +1 -1
- package/dist/runtime/upkeep-close.d.ts +17 -0
- package/dist/runtime/upkeep-close.d.ts.map +1 -0
- package/dist/runtime/upkeep-close.js +127 -0
- package/dist/runtime/upkeep-close.js.map +1 -0
- package/dist/runtime/upkeep-orders.d.ts +124 -0
- package/dist/runtime/upkeep-orders.d.ts.map +1 -0
- package/dist/runtime/upkeep-orders.js +310 -0
- package/dist/runtime/upkeep-orders.js.map +1 -0
- package/dist/runtime/upkeep-reconcile.d.ts +25 -0
- package/dist/runtime/upkeep-reconcile.d.ts.map +1 -0
- package/dist/runtime/upkeep-reconcile.js +231 -0
- package/dist/runtime/upkeep-reconcile.js.map +1 -0
- package/dist/runtime/upkeep-writeback.d.ts +22 -0
- package/dist/runtime/upkeep-writeback.d.ts.map +1 -0
- package/dist/runtime/upkeep-writeback.js +203 -0
- package/dist/runtime/upkeep-writeback.js.map +1 -0
- package/dist/utils/untrusted-content.d.ts.map +1 -1
- package/dist/utils/untrusted-content.js +8 -1
- package/dist/utils/untrusted-content.js.map +1 -1
- package/install/install.sh +457 -0
- package/install/node.json +9 -0
- package/package.json +3 -4
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# MAMA OS installer (docs/development/work/install.md).
|
|
3
|
+
#
|
|
4
|
+
# curl -fsSL https://github.com/jungjaehoon-lifegamez/MAMA/releases/latest/download/install.sh | sh -s -- --backend claude --non-interactive
|
|
5
|
+
#
|
|
6
|
+
# It asks nothing: the person's agent runs it from a shell without a terminal. It installs a pinned
|
|
7
|
+
# Node.js into ~/.mama/node, MAMA OS into ~/.mama/npm, the `mama` command into ~/.mama/bin, the
|
|
8
|
+
# backend CLI with its vendor's installer when none that runs is found, and a marked PATH block in
|
|
9
|
+
# the login shell's startup file; then it runs `mama init --non-interactive`, which opens the setup
|
|
10
|
+
# page for the bot token and the pairing code.
|
|
11
|
+
#
|
|
12
|
+
# The whole body is one function, called on the last line, so a download cut off midway runs
|
|
13
|
+
# nothing. scripts/sync-versions.js writes the version lines from package.json and
|
|
14
|
+
# install/node.json.
|
|
15
|
+
|
|
16
|
+
mama_install() {
|
|
17
|
+
set -eu
|
|
18
|
+
# mama init makes ~/.mama 0700 only when it creates it; this script may create it first.
|
|
19
|
+
umask 077
|
|
20
|
+
|
|
21
|
+
MAMA_OS_VERSION=0.79.0
|
|
22
|
+
NODE_VERSION=22.23.4
|
|
23
|
+
NODE_SHA256_DARWIN_ARM64=c9e1dbc748b33ed2d14f42445191ecaf14c56259c7a9a26d0042c49ec2b66428
|
|
24
|
+
NODE_SHA256_DARWIN_X64=efcc2b0db6f94bf53eddb038fe2b370277a042bd29e4f19b8f8e23598795b819
|
|
25
|
+
NODE_SHA256_LINUX_X64=b8492284c76a54baf58d61668dd0e41ee0fc98adabf9503d30f05d08f55b4406
|
|
26
|
+
NODE_SHA256_LINUX_ARM64=f7a1e486dbc8b286847815b477d4fb5e9fb963ed4489c3e1588853d685f589f9
|
|
27
|
+
|
|
28
|
+
say() { printf '%s\n' "$*"; }
|
|
29
|
+
fail() {
|
|
30
|
+
printf 'mama install: %s\n' "$*" >&2
|
|
31
|
+
exit 1
|
|
32
|
+
}
|
|
33
|
+
# One shell word, single-quoted.
|
|
34
|
+
quote() { printf "'%s'" "$(printf '%s' "$1" | sed "s/'/'\\\\''/g")"; }
|
|
35
|
+
|
|
36
|
+
usage() {
|
|
37
|
+
say 'Usage: install.sh [--backend claude|codex] [--non-interactive | --no-init]'
|
|
38
|
+
say ' --backend the backend CLI MAMA runs; a new install needs it'
|
|
39
|
+
say ' --non-interactive run mama init --non-interactive: it reads MAMA_INIT_* variables and'
|
|
40
|
+
say ' opens the setup page; a new install needs it or --no-init'
|
|
41
|
+
say ' --no-init install only, and print the init command'
|
|
42
|
+
say 'An install already set up needs no option: it runs mama init --non-interactive.'
|
|
43
|
+
say 'Piped from curl: curl -fsSL <url> | sh -s -- --backend claude --non-interactive'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
backend=''
|
|
47
|
+
init_mode=''
|
|
48
|
+
while [ $# -gt 0 ]; do
|
|
49
|
+
case $1 in
|
|
50
|
+
--backend)
|
|
51
|
+
[ $# -ge 2 ] || fail '--backend needs claude or codex'
|
|
52
|
+
backend=$2
|
|
53
|
+
shift 2
|
|
54
|
+
;;
|
|
55
|
+
--backend=*)
|
|
56
|
+
backend=${1#--backend=}
|
|
57
|
+
shift
|
|
58
|
+
;;
|
|
59
|
+
--non-interactive | --no-init)
|
|
60
|
+
[ -z "$init_mode" ] || fail 'choose one of --non-interactive and --no-init'
|
|
61
|
+
init_mode=${1#--}
|
|
62
|
+
shift
|
|
63
|
+
;;
|
|
64
|
+
-h | --help)
|
|
65
|
+
usage
|
|
66
|
+
return 0
|
|
67
|
+
;;
|
|
68
|
+
*)
|
|
69
|
+
usage >&2
|
|
70
|
+
fail "unknown option: $1"
|
|
71
|
+
;;
|
|
72
|
+
esac
|
|
73
|
+
done
|
|
74
|
+
case $backend in
|
|
75
|
+
'' | claude | codex) ;;
|
|
76
|
+
*) fail "--backend must be claude or codex, not $backend" ;;
|
|
77
|
+
esac
|
|
78
|
+
|
|
79
|
+
[ -n "${HOME:-}" ] && [ -d "$HOME" ] || fail 'HOME is not set to a folder'
|
|
80
|
+
root=$HOME/.mama
|
|
81
|
+
node_dir=$root/node
|
|
82
|
+
prefix=$root/npm
|
|
83
|
+
package=$prefix/lib/node_modules/@jungjaehoon/mama-os
|
|
84
|
+
cli=$package/dist/cli/index.js
|
|
85
|
+
wrapper=$root/bin/mama
|
|
86
|
+
|
|
87
|
+
# A move of the managed Node that did not finish (`mama update --node`, install.md, "Moving the
|
|
88
|
+
# managed Node"), before anything else and in plain sh: ~/.mama/npm may be missing now. At
|
|
89
|
+
# `committed` the new Node runs, and its old folders go; otherwise each folder set aside goes back
|
|
90
|
+
# over whatever is in its place, and the service starts on it. The journal has one field per line
|
|
91
|
+
# (src/cli/runtime/node-move-journal.ts); each step below can be run again after a cut.
|
|
92
|
+
move_journal=$root/runtime/node-move.json
|
|
93
|
+
if [ -e "$move_journal" ]; then
|
|
94
|
+
holder=$root/runtime/update.holder.json
|
|
95
|
+
holder_pid=''
|
|
96
|
+
[ -f "$holder" ] && holder_pid=$(sed -n 's/^{"pid":\([0-9][0-9]*\),.*/\1/p' "$holder")
|
|
97
|
+
if [ -n "$holder_pid" ] && kill -0 "$holder_pid" 2>/dev/null; then
|
|
98
|
+
fail "a move of the managed Node or an update runs now (pid $holder_pid, $holder); run this again once it ends. If that pid is not MAMA's, remove $holder first."
|
|
99
|
+
fi
|
|
100
|
+
move_from=$(sed -n 's/^ "from": "\(.*\)",$/\1/p' "$move_journal")
|
|
101
|
+
move_to=$(sed -n 's/^ "to": "\(.*\)",$/\1/p' "$move_journal")
|
|
102
|
+
if grep -q '^ "phase": "committed",$' "$move_journal"; then
|
|
103
|
+
rm -rf "$root/node.old" "$root/npm.old"
|
|
104
|
+
rm -f "$move_journal"
|
|
105
|
+
say "The managed Node's move to $move_to had taken effect; its old folders are removed."
|
|
106
|
+
else
|
|
107
|
+
# The hold is the recovery's invariant: with it, start.sh runs nothing and the folders may be
|
|
108
|
+
# half renamed; without it every rename was done (the move and this recovery write and sync it
|
|
109
|
+
# before their first rename, and sync the renames before they remove it).
|
|
110
|
+
hold=$root/runtime/update.hold
|
|
111
|
+
if [ ! -e "$hold" ] && { [ -d "$root/node.old" ] || [ -d "$root/npm.old" ]; }; then
|
|
112
|
+
# Every rename done: the new Node runs on its own prefix, and may run MAMA (a move killed
|
|
113
|
+
# while it waited for the boot), which stops before its folders move back.
|
|
114
|
+
[ -x "$node_dir/bin/node" ] && [ -f "$cli" ] ||
|
|
115
|
+
fail "the move of the managed Node to $move_to is unfinished, with no hold file and no runnable $node_dir/bin/node or $cli; nothing was changed. Stop MAMA, create $hold, then run this installer again."
|
|
116
|
+
"$node_dir/bin/node" "$cli" stop </dev/null ||
|
|
117
|
+
fail "the move of the managed Node to $move_to is unfinished, and MAMA on it did not stop (above); nothing was changed. Run $wrapper stop --now, then this installer again."
|
|
118
|
+
fi
|
|
119
|
+
# Held before the first rename, so a cut midway leaves the hold: the next run stops nothing,
|
|
120
|
+
# and a start meanwhile (a reboot) runs nothing on a half-renamed pair.
|
|
121
|
+
: >"$hold"
|
|
122
|
+
sync
|
|
123
|
+
for folder in node npm; do
|
|
124
|
+
if [ -d "$root/$folder.old" ]; then
|
|
125
|
+
rm -rf "${root:?}/$folder"
|
|
126
|
+
mv "$root/$folder.old" "$root/$folder"
|
|
127
|
+
fi
|
|
128
|
+
done
|
|
129
|
+
rm -rf "$root/node.new" "$root/npm.new"
|
|
130
|
+
sync
|
|
131
|
+
rm -f "$hold"
|
|
132
|
+
"$node_dir/bin/node" "$cli" service start </dev/null ||
|
|
133
|
+
fail "Node.js $move_from is back in $node_dir, but MAMA did not start on it (above); run this installer again"
|
|
134
|
+
# Last: a run cut before here does all of this again.
|
|
135
|
+
rm -f "$move_journal"
|
|
136
|
+
fail "the move of the managed Node from $move_from to $move_to was cut off, and is undone: MAMA runs on Node.js $move_from again. Run this installer again to move it."
|
|
137
|
+
fi
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
# Another install owns this account: a setup with no MAMA in the managed prefix.
|
|
141
|
+
holds_mama=no
|
|
142
|
+
[ -f "$package/package.json" ] && holds_mama=yes
|
|
143
|
+
set_up=no
|
|
144
|
+
[ -f "$root/config.yaml" ] && set_up=yes
|
|
145
|
+
if [ "$holds_mama" = no ] && { [ "$set_up" = yes ] || [ -f "$root/start.sh" ]; }; then
|
|
146
|
+
fail "$root is set up by another MAMA install (not in $prefix); this installer will not take it over. Nothing was changed. mama update --dry-run shows how that install updates."
|
|
147
|
+
fi
|
|
148
|
+
# Nothing reads a terminal. A new install is told its backend and how to set up; one already set
|
|
149
|
+
# up runs as it was installed, so the bare command mama update and doctor print runs as is.
|
|
150
|
+
if [ "$set_up" = no ]; then
|
|
151
|
+
[ -n "$backend" ] || fail 'a new install needs --backend claude or --backend codex'
|
|
152
|
+
[ -n "$init_mode" ] ||
|
|
153
|
+
fail 'a new install needs --non-interactive (mama init reads MAMA_INIT_* variables and opens the setup page) or --no-init'
|
|
154
|
+
fi
|
|
155
|
+
[ -n "$init_mode" ] || init_mode=non-interactive
|
|
156
|
+
|
|
157
|
+
case $(uname -s) in
|
|
158
|
+
Darwin) os=darwin ;;
|
|
159
|
+
Linux) os=linux ;;
|
|
160
|
+
*) fail "MAMA OS installs on macOS and Linux; this is $(uname -s)" ;;
|
|
161
|
+
esac
|
|
162
|
+
case $(uname -m) in
|
|
163
|
+
x86_64 | amd64) arch=x64 ;;
|
|
164
|
+
arm64 | aarch64) arch=arm64 ;;
|
|
165
|
+
*) fail "MAMA OS installs on x64 and arm64; this is $(uname -m)" ;;
|
|
166
|
+
esac
|
|
167
|
+
case $os-$arch in
|
|
168
|
+
darwin-arm64) node_sha256=$NODE_SHA256_DARWIN_ARM64 ;;
|
|
169
|
+
darwin-x64) node_sha256=$NODE_SHA256_DARWIN_X64 ;;
|
|
170
|
+
linux-x64) node_sha256=$NODE_SHA256_LINUX_X64 ;;
|
|
171
|
+
linux-arm64) node_sha256=$NODE_SHA256_LINUX_ARM64 ;;
|
|
172
|
+
esac
|
|
173
|
+
|
|
174
|
+
# ~/.local/bin is where the vendor installers put the backend.
|
|
175
|
+
PATH=$HOME/.local/bin:$PATH
|
|
176
|
+
export PATH
|
|
177
|
+
|
|
178
|
+
# Linux: the parent of member_root and tools_root, and linger, in one sudo call. sudo keeps the
|
|
179
|
+
# umask 077 above; 022 inside, or the parent would be 0700 and init's folder check would fail.
|
|
180
|
+
if [ "$os" = linux ]; then
|
|
181
|
+
user=$(id -un)
|
|
182
|
+
# default-roots.ts's pattern, ^[A-Za-z0-9][A-Za-z0-9._-]*$, spelled out: a range in a
|
|
183
|
+
# bracket expression follows the locale.
|
|
184
|
+
alnum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
|
|
185
|
+
case $user in
|
|
186
|
+
'' | [!$alnum]* | *[!$alnum._-]*) user_ok=no ;;
|
|
187
|
+
*) user_ok=yes ;;
|
|
188
|
+
esac
|
|
189
|
+
if [ "$user_ok" = no ]; then
|
|
190
|
+
say "The user name $user has characters MAMA's default folders do not take, so nothing is run with sudo; set MAMA_INIT_MEMBER_ROOT and MAMA_INIT_TOOLS_ROOT to two folders outside your home instead."
|
|
191
|
+
elif [ -n "$(find /var/lib/mama -prune -type d -user 0 -perm 0755 2>/dev/null)" ] &&
|
|
192
|
+
[ -n "$(find "/var/lib/mama/$user" -prune -type d -user "$(id -u)" -perm 0700 2>/dev/null)" ] &&
|
|
193
|
+
[ -e "/var/lib/systemd/linger/$user" ]; then
|
|
194
|
+
say "/var/lib/mama/$user is in place and linger is on."
|
|
195
|
+
else
|
|
196
|
+
privileged="umask 022; install -d -m 0755 /var/lib/mama; install -d -o $user -m 0700 /var/lib/mama/$user; loginctl enable-linger $user"
|
|
197
|
+
say "MAMA keeps member workspaces and document tools under /var/lib/mama/$user, and linger keeps it running after you log out. This needs sudo once:"
|
|
198
|
+
say " sudo sh -c '$privileged'"
|
|
199
|
+
if command -v sudo >/dev/null 2>&1 && sudo sh -c "$privileged" </dev/null; then
|
|
200
|
+
say "Done."
|
|
201
|
+
else
|
|
202
|
+
say "That did not run. Run it later, or set MAMA_INIT_MEMBER_ROOT and MAMA_INIT_TOOLS_ROOT to two folders outside your home."
|
|
203
|
+
fi
|
|
204
|
+
fi
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
mkdir -p "$root"
|
|
208
|
+
download=$root/node.$$.tar.gz
|
|
209
|
+
unpack=$root/node.$$.tmp
|
|
210
|
+
vendor_script=$root/backend-install.$$.sh
|
|
211
|
+
write_tmp=''
|
|
212
|
+
trap 'rm -rf "$download" "$unpack" "$vendor_script" ${write_tmp:+"$write_tmp"}' EXIT
|
|
213
|
+
trap 'exit 129' HUP
|
|
214
|
+
trap 'exit 130' INT
|
|
215
|
+
trap 'exit 143' TERM
|
|
216
|
+
# What a run killed outright (SIGKILL, a power cut) left behind.
|
|
217
|
+
rm -rf "$root"/node.*.tmp "$root"/node.*.tar.gz "$root"/backend-install.*.sh
|
|
218
|
+
|
|
219
|
+
# Node.js: the pinned release, checked against the pinned SHA-256, unpacked beside its place and
|
|
220
|
+
# renamed into $1.
|
|
221
|
+
fetch_node() {
|
|
222
|
+
command -v curl >/dev/null 2>&1 || fail 'curl is needed to download Node.js'
|
|
223
|
+
if command -v shasum >/dev/null 2>&1; then
|
|
224
|
+
sha256() { shasum -a 256 "$1" | cut -d ' ' -f 1; }
|
|
225
|
+
elif command -v sha256sum >/dev/null 2>&1; then
|
|
226
|
+
sha256() { sha256sum "$1" | cut -d ' ' -f 1; }
|
|
227
|
+
else
|
|
228
|
+
fail 'shasum or sha256sum is needed to check the Node.js download'
|
|
229
|
+
fi
|
|
230
|
+
node_file=node-v$NODE_VERSION-$os-$arch.tar.gz
|
|
231
|
+
node_url=https://nodejs.org/dist/v$NODE_VERSION/$node_file
|
|
232
|
+
say "Downloading Node.js $NODE_VERSION: $node_url"
|
|
233
|
+
curl -fsSL -o "$download" "$node_url" </dev/null || fail "could not download $node_url"
|
|
234
|
+
actual=$(sha256 "$download")
|
|
235
|
+
if [ "$actual" != "$node_sha256" ]; then
|
|
236
|
+
rm -f "$download"
|
|
237
|
+
fail "$node_file has SHA-256 $actual, not $node_sha256, which this installer pins; the download was deleted and nothing was unpacked."
|
|
238
|
+
fi
|
|
239
|
+
rm -rf "$unpack"
|
|
240
|
+
mkdir "$unpack"
|
|
241
|
+
tar -xzf "$download" -C "$unpack" --strip-components 1 </dev/null
|
|
242
|
+
rm -f "$download"
|
|
243
|
+
[ "$("$unpack/bin/node" --version </dev/null)" = "v$NODE_VERSION" ] ||
|
|
244
|
+
fail "the unpacked $node_file does not run as Node.js $NODE_VERSION"
|
|
245
|
+
rm -rf "$1"
|
|
246
|
+
mv "$unpack" "$1"
|
|
247
|
+
}
|
|
248
|
+
node_now=''
|
|
249
|
+
if [ -x "$node_dir/bin/node" ]; then
|
|
250
|
+
node_now=$("$node_dir/bin/node" --version </dev/null 2>/dev/null || true)
|
|
251
|
+
fi
|
|
252
|
+
if [ "$node_now" = "v$NODE_VERSION" ]; then
|
|
253
|
+
say "Node.js $NODE_VERSION is in place: $node_dir"
|
|
254
|
+
elif [ -f "$root/start.sh" ] && [ -n "$node_now" ]; then
|
|
255
|
+
# The service runs this Node: mama update --node moves it with the service stopped, boots
|
|
256
|
+
# MAMA on the new one and checks it, and puts the old one back on a failure. It runs on the
|
|
257
|
+
# Node it moves away from.
|
|
258
|
+
say "MAMA runs Node.js ${node_now#v} from $node_dir; this installer pins $NODE_VERSION, so it moves MAMA to it."
|
|
259
|
+
fetch_node "$root/node.new"
|
|
260
|
+
PATH="$node_dir/bin:$PATH" "$node_dir/bin/node" "$cli" update --node "$root/node.new" </dev/null ||
|
|
261
|
+
fail "moving MAMA to Node.js $NODE_VERSION did not finish (mama update --node's report is above)"
|
|
262
|
+
else
|
|
263
|
+
fetch_node "$node_dir"
|
|
264
|
+
say "Node.js $NODE_VERSION installed: $node_dir"
|
|
265
|
+
fi
|
|
266
|
+
|
|
267
|
+
# MAMA OS, with the managed Node's own npm and that Node first on PATH, as mama update runs it.
|
|
268
|
+
installed=''
|
|
269
|
+
if [ -d "$prefix" ]; then
|
|
270
|
+
installed=$(PATH="$node_dir/bin:$PATH" "$node_dir/bin/npm" ls -g --prefix "$prefix" \
|
|
271
|
+
--depth=0 --parseable --long @jungjaehoon/mama-os </dev/null 2>/dev/null |
|
|
272
|
+
sed -n 's|.*:@jungjaehoon/mama-os@\([^:]*\).*|\1|p' || true)
|
|
273
|
+
fi
|
|
274
|
+
if [ "$set_up" = yes ]; then
|
|
275
|
+
say "MAMA OS ${installed:-(unreadable)} is installed in $prefix; mama update updates it."
|
|
276
|
+
elif [ "$installed" = "$MAMA_OS_VERSION" ]; then
|
|
277
|
+
say "MAMA OS $MAMA_OS_VERSION is in place: $prefix"
|
|
278
|
+
else
|
|
279
|
+
say "Installing @jungjaehoon/mama-os@$MAMA_OS_VERSION into $prefix"
|
|
280
|
+
PATH="$node_dir/bin:$PATH" "$node_dir/bin/npm" install -g --prefix "$prefix" \
|
|
281
|
+
--no-audit --no-fund "@jungjaehoon/mama-os@$MAMA_OS_VERSION" </dev/null ||
|
|
282
|
+
fail "npm could not install @jungjaehoon/mama-os@$MAMA_OS_VERSION (its error is above). $prefix is left for the next run of this installer, which installs it again."
|
|
283
|
+
fi
|
|
284
|
+
[ -f "$cli" ] || fail "$cli is missing; run this installer again to reinstall MAMA OS"
|
|
285
|
+
|
|
286
|
+
# `mama`: the managed Node on the package's CLI by full paths. The bin's own `#!/usr/bin/env node`
|
|
287
|
+
# would run whichever Node comes first, or none on a clean account.
|
|
288
|
+
# write_file writes $2 to $1 when it differs, and returns 1 when it does not. It writes a
|
|
289
|
+
# temporary file beside the real one (a link is followed to its target, so the link stays) and
|
|
290
|
+
# renames it into place, so a failed write, a full disk included, leaves the old file whole. The
|
|
291
|
+
# temporary file starts as a copy of the old one, mode included, so a read-only file is refused.
|
|
292
|
+
write_file() {
|
|
293
|
+
write_target=$1
|
|
294
|
+
while [ -L "$write_target" ]; do
|
|
295
|
+
write_link=$(readlink "$write_target") || fail "could not read the link $write_target"
|
|
296
|
+
case $write_link in
|
|
297
|
+
/*) write_target=$write_link ;;
|
|
298
|
+
*) write_target=$(dirname "$write_target")/$write_link ;;
|
|
299
|
+
esac
|
|
300
|
+
done
|
|
301
|
+
if [ -f "$write_target" ] && printf '%s\n' "$2" | cmp -s - "$write_target"; then return 1; fi
|
|
302
|
+
mkdir -p "$(dirname "$write_target")" || fail "could not create $(dirname "$write_target")"
|
|
303
|
+
write_tmp=$write_target.mama.$$
|
|
304
|
+
if [ -e "$write_target" ]; then
|
|
305
|
+
cp -p "$write_target" "$write_tmp" || fail "could not write $1"
|
|
306
|
+
fi
|
|
307
|
+
printf '%s\n' "$2" >"$write_tmp" || fail "could not write $1"
|
|
308
|
+
mv -f "$write_tmp" "$write_target" || fail "could not write $1"
|
|
309
|
+
write_tmp=''
|
|
310
|
+
}
|
|
311
|
+
if write_file "$wrapper" "#!/bin/sh
|
|
312
|
+
exec $(quote "$node_dir/bin/node") $(quote "$cli") \"\$@\""; then
|
|
313
|
+
chmod 700 "$wrapper" || fail "could not make $wrapper executable"
|
|
314
|
+
say "mama command written: $wrapper"
|
|
315
|
+
fi
|
|
316
|
+
other=$(command -v mama 2>/dev/null || true)
|
|
317
|
+
if [ -n "$other" ] && [ "$other" != "$wrapper" ]; then
|
|
318
|
+
say "Another mama comes first on this PATH: $other. The startup block below puts $wrapper ahead of it in new terminals."
|
|
319
|
+
fi
|
|
320
|
+
|
|
321
|
+
# The backend CLI: kept when the one on PATH runs (mama init checks its version and sign-in),
|
|
322
|
+
# else the vendor's documented installer, into ~/.local/bin. A found command counts only when
|
|
323
|
+
# `--version` exits 0 and prints a version, as backend-probe.ts reads it: a shim with no real CLI
|
|
324
|
+
# behind it (cmux's exits 127) is no backend. A set-up install run without --backend keeps its own.
|
|
325
|
+
backend_runs() {
|
|
326
|
+
backend_version=$("$1" --version </dev/null 2>/dev/null) &&
|
|
327
|
+
printf '%s\n' "$backend_version" | grep -Eq '[[:digit:]]+[.][[:digit:]]+[.][[:digit:]]+'
|
|
328
|
+
}
|
|
329
|
+
backend_path=''
|
|
330
|
+
[ -z "$backend" ] || backend_path=$(command -v "$backend" 2>/dev/null || true)
|
|
331
|
+
if [ -z "$backend" ]; then
|
|
332
|
+
:
|
|
333
|
+
elif [ -n "$backend_path" ] && backend_runs "$backend_path"; then
|
|
334
|
+
say "$backend is installed: $backend_path"
|
|
335
|
+
else
|
|
336
|
+
[ -z "$backend_path" ] ||
|
|
337
|
+
say "$backend_path does not run (its --version exited non-zero or printed no version), so it does not count."
|
|
338
|
+
case $backend in
|
|
339
|
+
claude)
|
|
340
|
+
vendor_url=https://claude.ai/install.sh
|
|
341
|
+
vendor_page=https://code.claude.com/docs/en/setup
|
|
342
|
+
vendor_shell='bash'
|
|
343
|
+
;;
|
|
344
|
+
codex)
|
|
345
|
+
vendor_url=https://chatgpt.com/codex/install.sh
|
|
346
|
+
vendor_page=https://learn.chatgpt.com/docs/codex/cli
|
|
347
|
+
vendor_shell='sh'
|
|
348
|
+
;;
|
|
349
|
+
esac
|
|
350
|
+
say "Installing $backend with its vendor's installer: curl -fsSL $vendor_url | $vendor_shell"
|
|
351
|
+
command -v curl >/dev/null 2>&1 || fail "curl is needed to install $backend; see $vendor_page"
|
|
352
|
+
# Fetched first, so a failed download is not an installer that ran on nothing.
|
|
353
|
+
curl -fsSL -o "$vendor_script" "$vendor_url" </dev/null ||
|
|
354
|
+
fail "could not download $vendor_url; see $vendor_page"
|
|
355
|
+
if [ "$backend" = codex ]; then
|
|
356
|
+
# On a terminal Codex's installer offers to start Codex on ~/.codex, not the home MAMA gives
|
|
357
|
+
# it; its install folder stays ~/.local/bin, which the startup block names.
|
|
358
|
+
(
|
|
359
|
+
unset CODEX_HOME CODEX_INSTALL_DIR
|
|
360
|
+
CODEX_NON_INTERACTIVE=1 sh "$vendor_script"
|
|
361
|
+
) </dev/null || fail "the codex installer failed (its output is above); see $vendor_page"
|
|
362
|
+
else
|
|
363
|
+
bash "$vendor_script" </dev/null ||
|
|
364
|
+
fail "the claude installer failed (its output is above); see $vendor_page"
|
|
365
|
+
fi
|
|
366
|
+
rm -f "$vendor_script"
|
|
367
|
+
backend_path=$(command -v "$backend" 2>/dev/null || true)
|
|
368
|
+
[ -n "$backend_path" ] ||
|
|
369
|
+
fail "$backend's installer finished, but $backend is not on PATH or in $HOME/.local/bin; see $vendor_page"
|
|
370
|
+
backend_runs "$backend_path" ||
|
|
371
|
+
fail "$backend's installer finished, but $backend_path does not run (its --version exited non-zero or printed no version); see $vendor_page"
|
|
372
|
+
say "$backend installed: $backend_path"
|
|
373
|
+
fi
|
|
374
|
+
|
|
375
|
+
# The login shell's startup file: the text between the markers is rewritten on each run.
|
|
376
|
+
path_line="export PATH=\"\$HOME/.mama/bin:\$PATH\""
|
|
377
|
+
fish_dirs="$root/bin"
|
|
378
|
+
# The backend named, or without --backend either one the vendor installers put there.
|
|
379
|
+
local_backend=no
|
|
380
|
+
for name in ${backend:-claude codex}; do
|
|
381
|
+
if [ -x "$HOME/.local/bin/$name" ]; then local_backend=yes; fi
|
|
382
|
+
done
|
|
383
|
+
if [ "$local_backend" = yes ]; then
|
|
384
|
+
path_line="export PATH=\"\$HOME/.mama/bin:\$HOME/.local/bin:\$PATH\""
|
|
385
|
+
fish_dirs="$fish_dirs $HOME/.local/bin"
|
|
386
|
+
fi
|
|
387
|
+
startup=''
|
|
388
|
+
reopen='Open a new terminal'
|
|
389
|
+
case $(basename "${SHELL:-sh}") in
|
|
390
|
+
zsh) startup=${ZDOTDIR:-$HOME}/.zshrc ;;
|
|
391
|
+
bash)
|
|
392
|
+
if [ "$os" = linux ]; then
|
|
393
|
+
startup=$HOME/.bashrc
|
|
394
|
+
elif [ ! -f "$HOME/.bash_profile" ] && [ -f "$HOME/.profile" ]; then
|
|
395
|
+
startup=$HOME/.profile
|
|
396
|
+
else
|
|
397
|
+
startup=$HOME/.bash_profile
|
|
398
|
+
fi
|
|
399
|
+
;;
|
|
400
|
+
fish)
|
|
401
|
+
reopen="In fish, run once: fish_add_path $fish_dirs"
|
|
402
|
+
say "fish: no startup file is written. $reopen"
|
|
403
|
+
;;
|
|
404
|
+
*) startup=$HOME/.profile ;;
|
|
405
|
+
esac
|
|
406
|
+
if [ -n "$startup" ]; then
|
|
407
|
+
block="# >>> mama >>>
|
|
408
|
+
# Written by the MAMA OS installer; each run rewrites the lines between these markers.
|
|
409
|
+
$path_line
|
|
410
|
+
# <<< mama <<<"
|
|
411
|
+
current=''
|
|
412
|
+
if [ -e "$startup" ]; then
|
|
413
|
+
current=$(cat "$startup") || fail "could not read $startup"
|
|
414
|
+
fi
|
|
415
|
+
# Markers match with a trailing carriage return too (a file saved with CRLF line ends). Unequal
|
|
416
|
+
# counts exit 3: a block without its end line would otherwise swallow the rest of the file.
|
|
417
|
+
updated=$(printf '%s\n' "$current" | MAMA_BLOCK=$block awk '
|
|
418
|
+
{ line = $0; sub(/\r$/, "", line) }
|
|
419
|
+
line == "# >>> mama >>>" { opened++; if (!done) print ENVIRON["MAMA_BLOCK"]; done = 1; skip = 1; next }
|
|
420
|
+
line == "# <<< mama <<<" { closed++; if (skip) { skip = 0; next } }
|
|
421
|
+
skip { next }
|
|
422
|
+
{ print; last = line }
|
|
423
|
+
END {
|
|
424
|
+
if (opened != closed) exit 3
|
|
425
|
+
if (!done) {
|
|
426
|
+
if (NR > 0 && last != "") print ""
|
|
427
|
+
print ENVIRON["MAMA_BLOCK"]
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
') || fail "$startup has a '# >>> mama >>>' line without its '# <<< mama <<<' line, or the other way round; fix it, then run this installer again"
|
|
431
|
+
# An absent or empty file gets the block alone.
|
|
432
|
+
[ -n "$current" ] || updated=$block
|
|
433
|
+
if write_file "$startup" "$updated"; then
|
|
434
|
+
say "PATH block written in $startup"
|
|
435
|
+
fi
|
|
436
|
+
fi
|
|
437
|
+
|
|
438
|
+
# mama init: npm and init run by full path with the managed Node first on PATH. Init reads the
|
|
439
|
+
# backend this script installed; a set-up install run without --backend has its own.
|
|
440
|
+
if [ -n "$backend" ]; then
|
|
441
|
+
MAMA_INIT_BACKEND=$backend
|
|
442
|
+
export MAMA_INIT_BACKEND
|
|
443
|
+
fi
|
|
444
|
+
case $init_mode in
|
|
445
|
+
no-init)
|
|
446
|
+
say "Installed. $reopen to have mama on PATH."
|
|
447
|
+
# ~/.local/bin first, as here: init looks for the backend on PATH, and a new shell may not
|
|
448
|
+
# read the startup block yet.
|
|
449
|
+
say "Set up with: PATH=\"\$HOME/.local/bin:\$PATH\" ${backend:+MAMA_INIT_BACKEND=$backend }MAMA_INIT_MODEL=<model> $(quote "$wrapper") init --non-interactive"
|
|
450
|
+
;;
|
|
451
|
+
non-interactive)
|
|
452
|
+
PATH="$node_dir/bin:$PATH" "$wrapper" init --non-interactive </dev/null
|
|
453
|
+
;;
|
|
454
|
+
esac
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
mama_install "$@"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "22.23.4",
|
|
3
|
+
"sha256": {
|
|
4
|
+
"darwin-arm64": "c9e1dbc748b33ed2d14f42445191ecaf14c56259c7a9a26d0042c49ec2b66428",
|
|
5
|
+
"darwin-x64": "efcc2b0db6f94bf53eddb038fe2b370277a042bd29e4f19b8f8e23598795b819",
|
|
6
|
+
"linux-x64": "b8492284c76a54baf58d61668dd0e41ee0fc98adabf9503d30f05d08f55b4406",
|
|
7
|
+
"linux-arm64": "f7a1e486dbc8b286847815b477d4fb5e9fb963ed4489c3e1588853d685f589f9"
|
|
8
|
+
}
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jungjaehoon/mama-os",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "MAMA OS - The local work agent behind your messenger.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"public",
|
|
44
44
|
"db",
|
|
45
45
|
"toolkit",
|
|
46
|
+
"install",
|
|
46
47
|
"README.md",
|
|
47
48
|
"CHANGELOG.md"
|
|
48
49
|
],
|
|
@@ -50,12 +51,11 @@
|
|
|
50
51
|
"access": "public"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@jungjaehoon/mama-core": "^8.
|
|
54
|
+
"@jungjaehoon/mama-core": "^8.9.0",
|
|
54
55
|
"@slack/socket-mode": "^2.0.5",
|
|
55
56
|
"@slack/web-api": "^7.13.0",
|
|
56
57
|
"better-sqlite3": "^12.8.0",
|
|
57
58
|
"discord.js": "^14.25.1",
|
|
58
|
-
"express": "^5.2.1",
|
|
59
59
|
"fflate": "0.8.3",
|
|
60
60
|
"grammy": "^1.42.0",
|
|
61
61
|
"htmlparser2": "12.0.0",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/better-sqlite3": "^7.6.13",
|
|
67
|
-
"@types/express": "^5.0.6",
|
|
68
67
|
"@types/js-yaml": "^4.0.9",
|
|
69
68
|
"@types/node": "^22.0.0",
|
|
70
69
|
"typescript": "^5.4.0",
|