fix: 通过主工作区契约委派 tran

This commit is contained in:
root
2026-07-13 04:04:50 +02:00
parent da4b3c0d62
commit da4b9ff8ae
7 changed files with 57 additions and 8 deletions
+13 -4
View File
@@ -1,11 +1,20 @@
#!/bin/sh
set -eu
self_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
primary_workspace=$(CDPATH= cd -- "$self_dir/../../.." && pwd)
shared_tran="$primary_workspace/scripts/tran"
primary_workspace=${AGENTRUN_WORKSPACE_PATH:-}
if [ ! -x "$shared_tran" ]; then
case "$primary_workspace" in
/*) ;;
*)
printf '%s\n' '{"ok":false,"failureKind":"tool-unavailable","message":"runner did not provide an absolute primary workspace path","source":"primary-workspace","valuesPrinted":false}' >&2
exit 2
;;
esac
shared_tran="$primary_workspace/scripts/tran"
shared_cli="$primary_workspace/scripts/ssh-cli.ts"
if [ ! -x "$shared_tran" ] || [ ! -f "$shared_cli" ]; then
printf '%s\n' '{"ok":false,"failureKind":"tool-unavailable","message":"primary UniDesk workspace does not provide executable scripts/tran","source":"primary-workspace","valuesPrinted":false}' >&2
exit 2
fi