refactor(monorepo): extract inbox and orch runtimes

This commit is contained in:
2026-03-20 13:08:33 +08:00
parent 1938eb8f07
commit 9b8e886289
78 changed files with 10516 additions and 77 deletions
+1 -66
View File
@@ -3,70 +3,5 @@
set -euo pipefail
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
readonly BUILD_DIR="$(mktemp -d "${TMPDIR:-/tmp}/skill-clis.XXXXXX")"
cleanup() {
rm -rf "${BUILD_DIR}"
}
trap cleanup EXIT INT TERM
require_command() {
local cmd="$1"
if ! command -v "${cmd}" >/dev/null 2>&1; then
printf 'missing required command: %s\n' "${cmd}" >&2
exit 1
fi
}
build_binary() {
local name="$1"
local package_path="$2"
local output_path="${BUILD_DIR}/${name}"
printf 'building %s from %s\n' "${name}" "${package_path}" >&2
(
cd "${REPO_ROOT}"
go build -trimpath -o "${output_path}" "${package_path}"
)
printf '%s\n' "${output_path}"
}
install_binary() {
local source_path="$1"
shift
local destination_path
for destination_path in "$@"; do
mkdir -p "$(dirname "${destination_path}")"
install -m 0755 "${source_path}" "${destination_path}"
printf 'installed %s\n' "${destination_path}"
done
}
main() {
require_command go
require_command install
require_command mktemp
local inbox_binary
local orch_binary
inbox_binary="$(build_binary inbox ./cmd/inbox)"
orch_binary="$(build_binary orch ./cmd/orch)"
install_binary \
"${inbox_binary}" \
"${REPO_ROOT}/skills/inbox/assets/inbox"
install_binary \
"${orch_binary}" \
"${REPO_ROOT}/skills/orch/assets/orch" \
"${REPO_ROOT}/skills/council-review/assets/orch"
printf 'skill CLI packaging complete\n'
}
main "$@"
exec bash "${SCRIPT_DIR}/package_skill_runtimes.sh" package "$@"