@larktask/aamp-feishu-task-agent 0.1.1-dev.3 → 0.1.1-dev.4

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 CHANGED
@@ -5,8 +5,10 @@ user-owned Feishu Bots and running the corresponding Task bridges.
5
5
 
6
6
  ## Install and bind
7
7
 
8
- Run the standalone one-click command. Its existing Node.js/npm dependency
9
- installation flow is unchanged:
8
+ Run the standalone one-click command. The launcher checks for Node.js and npm
9
+ before setup. When either is unavailable, it stops before authorization and
10
+ links to the official Node.js LTS download page; it does not install or modify
11
+ the user's package managers automatically:
10
12
 
11
13
  ```bash
12
14
  npx -y --package @larktask/aamp-feishu-task-agent@dev \
@@ -112,7 +112,7 @@ AAMP_TASK_DEFAULT_FEISHU_BRIDGE_PKG="$FEISHU_BRIDGE_PKG"
112
112
  AAMP_TASK_DEFAULT_AIME_ACP_PKG="$AIME_ACP_PKG"
113
113
  AAMP_TASK_AGENT_NAME="${AAMP_TASK_AGENT_NAME:-@larktask/aamp-feishu-task-agent}"
114
114
  AAMP_TASK_AGENT_LEGACY_NAME="${AAMP_TASK_AGENT_LEGACY_NAME:-@zengxingyuan/aamp-feishu-task-agent}"
115
- AAMP_TASK_AGENT_VERSION="0.1.1-dev.3"
115
+ AAMP_TASK_AGENT_VERSION="0.1.1-dev.4"
116
116
  AAMP_TASK_AGENT_CHANNEL="${AAMP_TASK_AGENT_CHANNEL:-dev}"
117
117
  AAMP_STALE_PROCESS_CLEANUP="${AAMP_STALE_PROCESS_CLEANUP:-false}"
118
118
  AAMP_STALE_PROCESS_SECONDS="${AAMP_STALE_PROCESS_SECONDS:-86400}"
@@ -683,98 +683,57 @@ path_prepend() {
683
683
  esac
684
684
  }
685
685
 
686
- run_brew() {
687
- # Feed one "yes" for Homebrew prompts such as dependency installation confirmation.
688
- printf 'y\n' | HOMEBREW_NO_ENV_HINTS=1 brew "$@"
689
- }
690
-
691
686
  refresh_node_toolchain_bins() {
692
687
  NPM_BIN="$(command -v npm || true)"
693
688
  NPX_BIN="$(command -v npx || true)"
694
689
  }
695
690
 
696
- print_node_toolchain_help() {
691
+ print_missing_node_help() {
697
692
  cat >&2 <<'HELP'
698
693
 
699
- Automatic Node.js/npm installation did not complete.
700
- Install it manually with one of these commands, then reopen the terminal or fix PATH:
701
- Homebrew: brew install node
702
- Volta: volta install node npm
703
- fnm: fnm install --lts
704
- nvm: nvm install --lts
694
+ 未检测到 Node.js 环境。
695
+
696
+ 请安装 Node.js LTS:
697
+ https://nodejs.org/en/download
698
+
699
+ 安装完成后:
700
+ 1. 重新打开终端
701
+ 2. 执行 node -v && npm -v 验证
702
+ 3. 重新运行本安装命令
705
703
 
706
704
  HELP
707
705
  }
708
706
 
709
- try_install_node_toolchain() {
710
- local node_path
711
- node_path="$(command -v node || true)"
712
-
713
- if command -v volta >/dev/null 2>&1 && { [ -z "$node_path" ] || [[ "$node_path" == *"/.volta/"* ]]; }; then
714
- agent_log "installing Node.js/npm with Volta"
715
- volta install node npm
716
- return $?
717
- fi
707
+ print_incomplete_node_help() {
708
+ cat >&2 <<'HELP'
718
709
 
719
- if command -v fnm >/dev/null 2>&1 && { [ -z "$node_path" ] || [[ "$node_path" == *"/.fnm/"* ]]; }; then
720
- agent_log "installing Node.js/npm with fnm"
721
- fnm install --lts
722
- eval "$(fnm env --shell bash)"
723
- return 0
724
- fi
710
+ Node.js 环境不完整,缺少 npm。
725
711
 
726
- local nvm_dir="${NVM_DIR:-$HOME/.nvm}"
727
- if [ -s "$nvm_dir/nvm.sh" ] && { [ -z "$node_path" ] || [[ "$node_path" == *"/.nvm/"* ]]; }; then
728
- agent_log "installing Node.js/npm with nvm"
729
- # shellcheck disable=SC1090
730
- source "$nvm_dir/nvm.sh"
731
- nvm install --lts
732
- nvm use --lts
733
- return 0
734
- fi
712
+ 请重新安装 Node.js LTS:
713
+ https://nodejs.org/en/download
735
714
 
736
- if command -v brew >/dev/null 2>&1; then
737
- local formula="node"
738
- if brew list --versions node@22 >/dev/null 2>&1; then
739
- formula="node@22"
740
- elif brew list --versions node >/dev/null 2>&1; then
741
- formula="node"
742
- fi
715
+ 安装完成后:
716
+ 1. 重新打开终端
717
+ 2. 执行 node -v && npm -v 验证
718
+ 3. 重新运行本安装命令
743
719
 
744
- if brew list --versions "$formula" >/dev/null 2>&1; then
745
- agent_log "reinstalling $formula with Homebrew to restore npm/npx"
746
- run_brew reinstall "$formula"
747
- else
748
- agent_log "installing Node.js/npm with Homebrew"
749
- run_brew install "$formula"
750
- fi
751
- return $?
752
- fi
753
-
754
- agent_log "no supported Node.js installer found; tried Volta, fnm, nvm, and Homebrew"
755
- return 1
720
+ HELP
756
721
  }
757
722
 
758
723
  ensure_node_toolchain() {
724
+ if ! command -v node >/dev/null 2>&1; then
725
+ print_missing_node_help
726
+ agent_fail "未检测到 Node.js,请先安装 Node.js LTS"
727
+ fi
728
+
759
729
  refresh_node_toolchain_bins
760
- if [ -n "$NPM_BIN" ] && [ -n "$NPX_BIN" ]; then
730
+ if [ -n "$NPM_BIN" ]; then
761
731
  configure_npm_registry
762
732
  return 0
763
733
  fi
764
734
 
765
- agent_log "npm/npx not found; installing Node.js/npm automatically"
766
- if ! try_install_node_toolchain; then
767
- print_node_toolchain_help
768
- agent_fail "failed to install Node.js/npm automatically"
769
- fi
770
-
771
- hash -r 2>/dev/null || true
772
- refresh_node_toolchain_bins
773
- [ -n "$NPM_BIN" ] && [ -n "$NPX_BIN" ] || {
774
- print_node_toolchain_help
775
- agent_fail "npm/npx is still unavailable after installation"
776
- }
777
- configure_npm_registry
735
+ print_incomplete_node_help
736
+ agent_fail "Node.js 环境不完整,请重新安装 Node.js LTS"
778
737
  }
779
738
 
780
739
  configure_npm_registry() {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "README.md"
7
7
  ],
8
8
  "license": "MIT",
9
- "version": "0.1.1-dev.3",
9
+ "version": "0.1.1-dev.4",
10
10
  "description": "One-click manager for local Agent and Feishu Bot bindings.",
11
11
  "type": "module",
12
12
  "bin": {