@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.
|
|
9
|
-
|
|
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.
|
|
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
|
-
|
|
691
|
+
print_missing_node_help() {
|
|
697
692
|
cat >&2 <<'HELP'
|
|
698
693
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
-
|
|
710
|
-
|
|
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
|
-
|
|
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
|
-
|
|
727
|
-
|
|
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
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
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
|
-
|
|
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" ]
|
|
730
|
+
if [ -n "$NPM_BIN" ]; then
|
|
761
731
|
configure_npm_registry
|
|
762
732
|
return 0
|
|
763
733
|
fi
|
|
764
734
|
|
|
765
|
-
|
|
766
|
-
|
|
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() {
|