3636cat > " $TRANSPORT " << 'SH '
3737#!/bin/bash
3838printf '%s\n' "$@" >> "$WP_TEST_ARGS"
39- case "$3:$4" in
40- core:is-installed) exit 0 ;;
39+ case "$#:$1:$2:$3:$4:$5:$6" in
40+ "6:--identity:secret value with spaces:--user=$WORDPRESS_USER:--path=$WORDPRESS_PATH:core:is-installed") exit 0 ;;
41+ "5:--identity:secret value with spaces:--path=$WORDPRESS_PATH:core:is-installed:") exit 0 ;;
42+ esac
43+ case "$5:$6" in
4144 datamachine:memory)
42- case "$5 " in
45+ case "$7 " in
4346 injectable-files) printf '%s\n' '[{"filename":"SITE.md","layer":"shared","priority":10,"path":"/remote/wp-content/uploads/datamachine-files/shared/SITE.md"},{"filename":"SOUL.md","layer":"agent","priority":20,"path":"/remote/wp-content/uploads/datamachine-files/agents/remote/SOUL.md"}]' ;;
4447 read)
45- case "$6 " in
48+ case "$8 " in
4649 SITE.md) printf '%s\n' 'site context' ;;
4750 SOUL.md) printf '%s\n' 'agent context' ;;
4851 *) exit 7 ;;
@@ -51,10 +54,11 @@ case "$3:$4" in
5154 esac
5255 ;;
5356 eval:*)
54- [ "$#" -eq 6 ] && [ "$5 " = "--user=$WORDPRESS_USER" ] && [ "$6 " = "--path=$WORDPRESS_PATH" ] || {
57+ [ "$#" -eq 6 ] && [ "$3 " = "--user=$WORDPRESS_USER" ] && [ "$4 " = "--path=$WORDPRESS_PATH" ] || {
5558 echo "wp eval received unsupported positional arguments" >&2
5659 exit 9
5760 }
61+ set -- "$1" "$2" "$3" "$6"
5862 case "$4" in
5963 *"require base64_decode"*) echo "decoded PHP source was treated as a filename" >&2; exit 9 ;;
6064 esac
@@ -111,6 +115,7 @@ error() { printf '%s\n' "$*" >&2; return 1; }
111115
112116external_wordpress_prepare_transport
113117external_wordpress_validate
118+ " $RUNTIME_PROJECT_ROOT /.wp-coding-agents/bin/wp-control" core is-installed > /dev/null
114119external_wordpress_project_context
115120runtime_generate_config
116121WITH_AI_GATEWAY=true
@@ -193,6 +198,13 @@ after_wrapper_calls="$(wc -l < "$ARGS" | tr -d ' ')"
193198[ " $( sed -n ' 3p' " $KIMAKI_ENV " ) " = " agent user" ] || { echo " FAIL: Kimaki launcher lost WordPress user" ; exit 1; }
194199export WORDPRESS_PATH=" /remote/site root" WORDPRESS_USER=" agent user"
195200
201+ # Userless profiles retain the transport prefix and emit only the path global.
202+ printf ' %s\n' ' {"wordpress_path":"/remote/site root","wordpress_user":""}' > " $RUNTIME_PROJECT_ROOT /.wp-coding-agents/wordpress.json"
203+ unset WORDPRESS_USER
204+ " $RUNTIME_PROJECT_ROOT /.wp-coding-agents/bin/wp-control" core is-installed > /dev/null
205+ external_wordpress_validate
206+ export WORDPRESS_USER=" agent user"
207+
196208if grep -R -F -- " secret value with spaces" " $RUNTIME_PROJECT_ROOT " > /dev/null 2>&1 ; then
197209 echo " FAIL: transport credential persisted below runtime root"
198210 exit 1
0 commit comments