menmu-agent-room 0.1.2 → 0.1.3
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/README.md +18 -1
- package/package.json +2 -1
- package/scripts/setup.sh +88 -0
package/README.md
CHANGED
|
@@ -4,6 +4,23 @@ A Linux host creates a shared project session. Members on macOS or Linux request
|
|
|
4
4
|
|
|
5
5
|
## Install with npm
|
|
6
6
|
|
|
7
|
+
For a persistent user installation without sudo, run the standalone
|
|
8
|
+
[`scripts/setup.sh`](https://github.com/Doorwood/agent_room/blob/main/scripts/setup.sh)
|
|
9
|
+
from a checkout or extracted binary bundle (Node.js 20+ and npm required):
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
sh scripts/setup.sh
|
|
13
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
14
|
+
agent_room-update --check
|
|
15
|
+
agent_room-update
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Setup configures Bash/Zsh startup files so new terminals and project sessions
|
|
19
|
+
can reuse `agent_room`. The updater checks the public npm registry and installs
|
|
20
|
+
the latest version when invoked; it does not schedule background updates.
|
|
21
|
+
Restart running clients after upgrading. Session data and Codex are preserved.
|
|
22
|
+
|
|
23
|
+
|
|
7
24
|
Requires Node.js 20+ and npm:
|
|
8
25
|
|
|
9
26
|
```sh
|
|
@@ -13,7 +30,7 @@ agent_room help
|
|
|
13
30
|
|
|
14
31
|
This archive includes macOS/Linux x64/arm64 native binaries. It requires no Go compiler, install scripts, or additional download during installation. The launcher selects the platform and checks its SHA-256 before running. `--ignore-scripts` installations also work.
|
|
15
32
|
|
|
16
|
-
The npm package name is `menmu-agent-room`; the installed command is `agent_room`. For offline installation, use `npm install -g ./menmu-agent-room-0.1.
|
|
33
|
+
The npm package name is `menmu-agent-room`; the installed command is `agent_room`. For offline installation, use `npm install -g ./menmu-agent-room-0.1.3.tgz`. To install without administrator access, add `--prefix "$HOME/.local"` and put `$HOME/.local/bin` on PATH.
|
|
17
34
|
|
|
18
35
|
## Host (Linux)
|
|
19
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "menmu-agent-room",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared Codex project sessions with host-approved members, terminal and browser clients",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"bin/agent_room.cjs",
|
|
19
19
|
"native/",
|
|
20
|
+
"scripts/setup.sh",
|
|
20
21
|
"README.md",
|
|
21
22
|
"LICENSE"
|
|
22
23
|
],
|
package/scripts/setup.sh
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Standalone user installation and update entry point (macOS/Linux, Bash/Zsh).
|
|
3
|
+
set -eu
|
|
4
|
+
mode=install
|
|
5
|
+
case "$(basename "$0")" in agent_room-update) mode=update ;; esac
|
|
6
|
+
while [ "$#" -gt 0 ]; do
|
|
7
|
+
case "$1" in
|
|
8
|
+
--update) mode=update ;;
|
|
9
|
+
--check) mode=check ;;
|
|
10
|
+
--help) echo 'Usage: sh setup.sh [--update | --check]'; exit 0 ;;
|
|
11
|
+
*) echo "Unknown option: $1" >&2; exit 2 ;;
|
|
12
|
+
esac
|
|
13
|
+
shift
|
|
14
|
+
done
|
|
15
|
+
case "$(uname -s)/$(uname -m)" in
|
|
16
|
+
Linux/x86_64|Linux/amd64|Linux/aarch64|Linux/arm64|Darwin/x86_64|Darwin/arm64) ;;
|
|
17
|
+
*) echo 'Supported systems: macOS/Linux x64/arm64' >&2; exit 1 ;;
|
|
18
|
+
esac
|
|
19
|
+
command -v node >/dev/null 2>&1 && command -v npm >/dev/null 2>&1 || {
|
|
20
|
+
echo 'Install Node.js 20+ and npm first, then rerun this script.' >&2; exit 1;
|
|
21
|
+
}
|
|
22
|
+
node -e 'if (Number(process.versions.node.split(".")[0]) < 20) process.exit(1)' || {
|
|
23
|
+
echo 'Node.js 20+ is required.' >&2; exit 1;
|
|
24
|
+
}
|
|
25
|
+
install_root="$HOME/.local/share/agent_room/npm"
|
|
26
|
+
user_bin="$HOME/.local/bin"
|
|
27
|
+
registry=https://registry.npmjs.org/
|
|
28
|
+
installed=$(node -e 'try { console.log(require(process.argv[1]).version) } catch { console.log("none") }' "$install_root/node_modules/menmu-agent-room/package.json")
|
|
29
|
+
latest=$(npm view menmu-agent-room dist-tags.latest --registry="$registry" --prefer-online)
|
|
30
|
+
# Validate registry output before using it as a package selector.
|
|
31
|
+
node -e 'if (!/^\d+\.\d+\.\d+$/.test(process.argv[1])) process.exit(1)' "$latest" || {
|
|
32
|
+
echo 'Registry returned an invalid stable version.' >&2; exit 1;
|
|
33
|
+
}
|
|
34
|
+
printf 'Installed: %s\nLatest: %s\n' "$installed" "$latest"
|
|
35
|
+
if [ "$mode" = check ]; then exit 0; fi
|
|
36
|
+
if [ "$mode" = update ] && [ "$installed" = none ]; then
|
|
37
|
+
echo 'Run the setup script first to install agent_room.' >&2; exit 1
|
|
38
|
+
fi
|
|
39
|
+
if [ "$installed" != "$latest" ]; then
|
|
40
|
+
# Never downgrade a newer installation if the registry rolls latest back.
|
|
41
|
+
if [ "$installed" != none ]; then
|
|
42
|
+
node -e 'const a=process.argv[1].split(".").map(Number), b=process.argv[2].split(".").map(Number); for(let i=0;i<3;i++){if(a[i]>b[i])process.exit(1);if(a[i]<b[i])break;}' "$installed" "$latest" || {
|
|
43
|
+
echo 'Installed version is newer than latest; leaving it unchanged.'; exit 0;
|
|
44
|
+
}
|
|
45
|
+
fi
|
|
46
|
+
mkdir -p "$install_root"
|
|
47
|
+
npm install --prefix "$install_root" --registry="$registry" --ignore-scripts --no-audit --no-fund "menmu-agent-room@$latest"
|
|
48
|
+
fi
|
|
49
|
+
node "$install_root/node_modules/menmu-agent-room/bin/agent_room.cjs" help
|
|
50
|
+
if [ "$mode" = install ]; then
|
|
51
|
+
mkdir -p "$user_bin"
|
|
52
|
+
# Both entry points are staged beside their destination for atomic replacement.
|
|
53
|
+
stage=$(mktemp -d "$user_bin/.agent-room-setup.XXXXXX")
|
|
54
|
+
trap 'rm -rf "$stage"' EXIT HUP INT TERM
|
|
55
|
+
cat > "$stage/agent_room" <<'WRAPPER'
|
|
56
|
+
#!/bin/sh
|
|
57
|
+
exec node "$HOME/.local/share/agent_room/npm/node_modules/menmu-agent-room/bin/agent_room.cjs" "$@"
|
|
58
|
+
WRAPPER
|
|
59
|
+
cp "$0" "$stage/agent_room-update"
|
|
60
|
+
chmod 755 "$stage/agent_room" "$stage/agent_room-update"
|
|
61
|
+
mv -f "$stage/agent_room" "$user_bin/agent_room"
|
|
62
|
+
mv -f "$stage/agent_room-update" "$user_bin/agent_room-update"
|
|
63
|
+
# Cover interactive shells and login shells. Respect Zsh's configured directory.
|
|
64
|
+
zsh_root=${ZDOTDIR:-$HOME}
|
|
65
|
+
mkdir -p "$zsh_root"
|
|
66
|
+
bash_login="$HOME/.profile"
|
|
67
|
+
if [ -f "$HOME/.bash_profile" ]; then bash_login="$HOME/.bash_profile"
|
|
68
|
+
elif [ -f "$HOME/.bash_login" ]; then bash_login="$HOME/.bash_login"; fi
|
|
69
|
+
for rc in "$bash_login" "$HOME/.bashrc" "$zsh_root/.zprofile" "$zsh_root/.zshrc"; do
|
|
70
|
+
if ! test -f "$rc" || ! grep -Fq '# agent_room user PATH' "$rc"; then
|
|
71
|
+
cat >> "$rc" <<'PROFILE'
|
|
72
|
+
|
|
73
|
+
# agent_room user PATH
|
|
74
|
+
case ":$PATH:" in
|
|
75
|
+
*":$HOME/.local/bin:"*) ;;
|
|
76
|
+
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
|
77
|
+
esac
|
|
78
|
+
PROFILE
|
|
79
|
+
fi
|
|
80
|
+
done
|
|
81
|
+
fi
|
|
82
|
+
printf '\nagent_room %s is ready. Restart running clients to use the updated version.\n' "$latest"
|
|
83
|
+
if [ "$mode" = install ]; then
|
|
84
|
+
echo 'New Bash/Zsh terminals will find agent_room automatically.'
|
|
85
|
+
echo 'For this terminal, run: export PATH="$HOME/.local/bin:$PATH"'
|
|
86
|
+
echo 'Check updates: agent_room-update --check'
|
|
87
|
+
echo 'Upgrade to latest: agent_room-update'
|
|
88
|
+
fi
|