44set -euo pipefail
55
66ROOT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.." && pwd) "
7- SOURCE_ROOT=" $( cd " ${OPENCLAW_NPM_ONBOARD_SOURCE_ROOT:- ${OPENCLAW_LIVE_DOCKER_REPO_ROOT:- $ROOT_DIR } } " && pwd) "
87source " $ROOT_DIR /scripts/lib/docker-e2e-image.sh"
98source " $ROOT_DIR /scripts/lib/docker-e2e-package.sh"
109source " $ROOT_DIR /scripts/e2e/lib/prepublish-plugin-registry.sh"
@@ -22,8 +21,6 @@ STATUS_TEXT_MAX_BYTES="$(
2221 docker_e2e_read_positive_int_env OPENCLAW_NPM_ONBOARD_STATUS_TEXT_MAX_BYTES 1048576
2322) "
2423run_log=" "
25- plugin_pack_dir=" "
26- plugin_package_args=()
2724OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS=()
2825
2926cleanup () {
@@ -33,9 +30,6 @@ cleanup() {
3330 if [ -n " ${run_log:- } " ]; then
3431 rm -f " $run_log "
3532 fi
36- if [ -n " ${plugin_pack_dir:- } " ]; then
37- rm -rf " $plugin_pack_dir "
38- fi
3933}
4034trap cleanup EXIT
4135
@@ -63,42 +57,6 @@ prepare_package_tgz() {
6357
6458prepare_package_tgz
6559
66- prepare_source_plugin_package () {
67- if [ " $USE_SOURCE_PLUGIN_PACKAGE " != " 1" ] || [ " $CHANNEL " = " telegram" ]; then
68- return 0
69- fi
70- if [ -z " ${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:- } " ]; then
71- echo " Source plugin package mode requires the mounted prerelease plugin registry." >&2
72- exit 1
73- fi
74-
75- local package_dir=" extensions/$CHANNEL "
76- if [ ! -f " $SOURCE_ROOT /$package_dir /package.json" ]; then
77- echo " Missing source plugin package for $CHANNEL : $package_dir " >&2
78- exit 1
79- fi
80-
81- plugin_pack_dir=" $( mktemp -d " ${TMPDIR:-/ tmp} /openclaw-npm-onboard-plugin.XXXXXX" ) "
82- (
83- cd " $SOURCE_ROOT "
84- OPENCLAW_PLUGIN_NPM_PACK_OUTPUT_DIR=" $plugin_pack_dir " \
85- bash scripts/plugin-npm-publish.sh --pack " $package_dir "
86- )
87-
88- local archives=(" $plugin_pack_dir " /* .tgz)
89- if [ " ${# archives[@]} " -ne 1 ] || [ ! -f " ${archives[0]} " ]; then
90- echo " Expected exactly one packed source plugin for $CHANNEL " >&2
91- exit 1
92- fi
93-
94- local container_package=" /tmp/openclaw-channel-plugin.tgz"
95- plugin_package_args=(
96- -v " ${archives[0]} :$container_package :ro"
97- )
98- }
99-
100- prepare_source_plugin_package
101-
10260if [ -n " ${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:- } " ]; then
10361 openclaw_prepublish_plugin_registry_configure_docker_args \
10462 " $OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR "
@@ -117,7 +75,6 @@ if ! docker_e2e_run_with_harness \
11775 -e " OPENCLAW_NPM_ONBOARD_STATUS_TEXT_MAX_BYTES=$STATUS_TEXT_MAX_BYTES " \
11876 -e " OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64 " \
11977 " ${DOCKER_E2E_PACKAGE_ARGS[@]} " \
120- " ${plugin_package_args[@]} " \
12178 " ${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS[@]} " \
12279 -i " $IMAGE_NAME " bash -s > " $run_log " 2>&1 << 'EOF '; then
12380set -Eeuo pipefail
@@ -196,18 +153,17 @@ dump_debug_logs() {
196153}
197154trap 'status=$?; dump_debug_logs "$status"; exit "$status"' ERR
198155
199- if [ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
200- if [ "${OPENCLAW_NPM_ONBOARD_USE_SOURCE_PLUGIN_PACKAGE:-0}" = "1" ] && [ "$CHANNEL" != "telegram" ]; then
201- candidate_version="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:?missing candidate version}"
202- openclaw_prepublish_plugin_registry_start_mounted \
203- /tmp/openclaw-npm-onboard-plugin-registry plugin_registry_pid '["@openclaw/codex"]' \
204- "@openclaw/$CHANNEL" \
205- "$candidate_version" \
206- /tmp/openclaw-channel-plugin.tgz
207- else
208- openclaw_prepublish_plugin_registry_start_mounted \
209- /tmp/openclaw-npm-onboard-plugin-registry plugin_registry_pid '["@openclaw/codex"]'
156+ required_plugins='["@openclaw/codex"]'
157+ if [ "${OPENCLAW_NPM_ONBOARD_USE_SOURCE_PLUGIN_PACKAGE:-0}" = "1" ] && [ "$CHANNEL" != "telegram" ]; then
158+ if [ -z "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
159+ echo "source channel fixture requires OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR with the matching candidate companion" >&2
160+ exit 1
210161 fi
162+ required_plugins="[\"@openclaw/codex\",\"@openclaw/$CHANNEL\"]"
163+ fi
164+ if [ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
165+ openclaw_prepublish_plugin_registry_start_mounted \
166+ /tmp/openclaw-npm-onboard-plugin-registry plugin_registry_pid "$required_plugins"
211167fi
212168
213169openclaw_e2e_install_package /tmp/openclaw-install.log
@@ -261,7 +217,8 @@ openclaw_e2e_assert_dep_absent "$DEP_SENTINEL" "$HOME/.openclaw"
261217if [ "$CHANNEL_PACKAGE_MODE" = "external" ] && [ -n "$fixture_consent" ]; then
262218 channel_install_args=("$CHANNEL")
263219 if [ "${OPENCLAW_NPM_ONBOARD_USE_SOURCE_PLUGIN_PACKAGE:-0}" = "1" ] && [ "$CHANNEL" != "telegram" ]; then
264- candidate_version="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:?missing candidate version}"
220+ # The verified registry preserves candidate bytes through the official npm
221+ # installer; a local archive would not establish official plugin provenance.
265222 channel_install_args=("npm:@openclaw/$CHANNEL@$candidate_version" --pin)
266223 fi
267224 openclaw_e2e_fixture_plugin_command openclaw -- plugins install "${channel_install_args[@]}" \
0 commit comments