@technomoron/agent-run 0.99.30 → 0.99.32

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.
@@ -22,15 +22,20 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
22
22
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
23
23
  INSTALL_LIBEXEC_DIR="${INSTALL_LIBEXEC_DIR:-${INSTALL_LIB_DIR:-/usr/local/libexec/agent-run}}"
24
24
  SYSTEMD_DIR="${SYSTEMD_DIR:-/etc/systemd/system}"
25
+ SYSTEMD_USER_DIR="${SYSTEMD_USER_DIR:-/etc/systemd/user}"
25
26
  ORIGINAL_ARGS=("$@")
26
27
 
27
28
  UPDATE_SCRIPT="$ROOT/scripts/update-ai-tools.sh"
28
29
  SERVICE_FILE="$ROOT/ops/systemd/ai-tools-update.service"
29
30
  TIMER_FILE="$ROOT/ops/systemd/ai-tools-update.timer"
31
+ BRAIN_HELPER="$ROOT/scripts/ensure-agent-brain.sh"
32
+ BRAIN_SERVICE="$ROOT/ops/systemd/agent-brain.service"
30
33
  if [ ! -f "$UPDATE_SCRIPT" ]; then
31
34
  UPDATE_SCRIPT="$SCRIPT_DIR/update-ai-tools.sh"
32
35
  SERVICE_FILE="$SCRIPT_DIR/ai-tools-update.service"
33
36
  TIMER_FILE="$SCRIPT_DIR/ai-tools-update.timer"
37
+ BRAIN_HELPER="$SCRIPT_DIR/ensure-agent-brain.sh"
38
+ BRAIN_SERVICE="$SCRIPT_DIR/agent-brain.service"
34
39
  fi
35
40
 
36
41
  INSTALL_AI_TOOLS=0
@@ -81,8 +86,10 @@ run() {
81
86
  "$@"
82
87
  }
83
88
 
84
- run install -d -m 0755 "$INSTALL_LIBEXEC_DIR" "$SYSTEMD_DIR"
89
+ run install -d -m 0755 "$INSTALL_LIBEXEC_DIR" "$SYSTEMD_DIR" "$SYSTEMD_USER_DIR"
85
90
  run install -m 0755 "$UPDATE_SCRIPT" "$INSTALL_LIBEXEC_DIR/update-ai-tools"
91
+ run install -m 0755 "$BRAIN_HELPER" "$INSTALL_LIBEXEC_DIR/ensure-agent-brain"
92
+ run install -m 0644 "$BRAIN_SERVICE" "$SYSTEMD_USER_DIR/agent-brain.service"
86
93
  run install -m 0644 "$SERVICE_FILE" "$SYSTEMD_DIR/ai-tools-update.service"
87
94
  run install -m 0644 "$TIMER_FILE" "$SYSTEMD_DIR/ai-tools-update.timer"
88
95
 
@@ -12,12 +12,21 @@ PNPM_BIN=/usr/local/bin/pnpm
12
12
  APT_GET_BIN=/usr/bin/apt-get
13
13
 
14
14
  AI_TOOLS_APT_PACKAGES="${AI_TOOLS_APT_PACKAGES:-gh}"
15
+ AI_TOOLS_AGENT_RUN_PACKAGE="${AI_TOOLS_AGENT_RUN_PACKAGE:-@technomoron/agent-run@latest}"
16
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
17
+ ensure_brain() {
18
+ local -a accounts=()
19
+ read -r -a accounts <<<"${AI_TOOLS_BRAIN_USERS:-}"
20
+ if [ "${#accounts[@]}" -gt 0 ]; then
21
+ "$SCRIPT_DIR/ensure-agent-brain" "${accounts[@]}"
22
+ fi
23
+ }
15
24
 
16
25
  packages=(
17
26
  npm@latest corepack@latest fallow@latest ripgrep@latest
18
27
  pm2@latest tsx@latest typescript@latest @openai/codex@latest
19
28
  @anthropic-ai/claude-code@latest @google/gemini-cli@latest
20
- @xai-official/grok@latest @technomoron/agent-run@latest
29
+ @xai-official/grok@latest "$AI_TOOLS_AGENT_RUN_PACKAGE"
21
30
  )
22
31
 
23
32
  if [ "$(id -u)" -ne 0 ]; then
@@ -25,16 +34,29 @@ if [ "$(id -u)" -ne 0 ]; then
25
34
  exit 1
26
35
  fi
27
36
 
37
+ "$NODE_BIN" -e 'if (Number(process.versions.node.split(".")[0]) < 24) { console.error("AI tools require Node 24 or newer in /usr/local/bin"); process.exit(1); }'
38
+ if [ "$#" -gt 1 ] || { [ "$#" -eq 1 ] && [ "$1" != --agent-brain ]; }; then
39
+ echo "Usage: update-ai-tools [--agent-brain]" >&2
40
+ exit 2
41
+ fi
42
+
28
43
  if [ "$("$NPM_BIN" prefix -g)" != /usr/local ] || [ "$("$NPM_BIN" root -g)" != /usr/local/lib/node_modules ]; then
29
44
  echo "npm global tooling must use /usr/local" >&2
30
45
  exit 1
31
46
  fi
32
47
 
48
+ if [ "${1:-}" = --agent-brain ]; then
49
+ "$NPM_BIN" install -g --force "$AI_TOOLS_AGENT_RUN_PACKAGE"
50
+ ensure_brain
51
+ exit 0
52
+ fi
53
+
33
54
  "$NPM_BIN" install -g --force "${packages[@]}"
55
+ ensure_brain
34
56
 
35
57
  # corepack and pnpm both own the pnpm/pnpx shims; install pnpm last so npm's
36
58
  # current pnpm package remains the command users execute.
37
- "$NPM_BIN" install -g --force pnpm@latest
59
+ "$NPM_BIN" install -g --force pnpm@latest --allow-scripts=pnpm
38
60
 
39
61
  install -d -o root -g root -m 0755 /usr/local/share/pnpm/global /usr/local/share/pnpm/store /usr/local/bin
40
62
  "$PNPM_BIN" config set --global global-dir /usr/local/share/pnpm/global
@@ -1,23 +0,0 @@
1
- # agent-run Basic Config
2
-
3
- This directory is a small, copyable starter for a repo that wants to keep
4
- agent-run files outside the source tree.
5
-
6
- It contains two pieces:
7
-
8
- - `project/`: a minimal project with `.agent-run.env` pointing at the bundled
9
- config root.
10
- - `agent-config/`: a complete config root with shared manifest defaults, global
11
- templates, snippets, skill templates, a personal memory skill, a sparse
12
- profile manifest, durable project memory, profile-local instructions, and
13
- profile overrides.
14
-
15
- Try it from this repository after building:
16
-
17
- ```sh
18
- pnpm build
19
- node dist/agent-run.js update examples/basic-config/project
20
- node dist/agent-run.js check examples/basic-config/project
21
- ```
22
-
23
- Generated files are written under `examples/basic-config/agent-config/starter/basic-project/`.