Complete agent monitoring and Galaxy Control integration

- expose command-monitor conversations and preserve visible agent transcripts
- add bounded polling and a dedicated shell interrupt tool
- improve direct-provider images, skills, tool history, and usage handling
- package and brand Galaxy Control across releases, installers, persistence, and docs
This commit is contained in:
2026-07-29 15:04:58 -05:00
parent 100f1eff1c
commit dbfa8bcd48
172 changed files with 6357 additions and 3825 deletions
+49 -50
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Builds a Warp binary and bundles it up for distribution.
# Builds a Galaxy binary and bundles it up for distribution.
set -e
@@ -19,7 +19,7 @@ trap cleanup EXIT
# By default we build dev bundles.
RELEASE_CHANNEL="dev"
FEATURES="release_bundle,crash_reporting"
FEATURES="release_bundle"
EXTRA_FEATURES=""
PACKAGES=( appimage )
BUILD="true"
@@ -85,8 +85,8 @@ while (( "$#" )); do
;;
--artifact)
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
if [[ "$2" != "app" && "$2" != "cli" && "$2" != "warpctrl" ]]; then
echo "Error: --artifact must be 'app', 'cli', or 'warpctrl', got '$2'" >&2
if [[ "$2" != "app" && "$2" != "cli" && "$2" != "galaxyctrl" ]]; then
echo "Error: --artifact must be 'app', 'cli', or 'galaxyctrl', got '$2'" >&2
exit 1
fi
ARTIFACT="$2"
@@ -120,8 +120,8 @@ done
# set positional arguments in their proper place
eval set -- "$PARAMS"
# Statically compile the CLI and warpctrl artifacts so they can run on older Linux distros.
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "warpctrl" ]]; then
# Statically compile the CLI and galaxyctrl artifacts so they can run on older Linux distros.
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "galaxyctrl" ]]; then
TARGET_TRIPLE="${BUILD_ARCH}-unknown-linux-musl"
# Only configure the musl toolchain when we are actually compiling. Packaging-only
# runs (--skip-build) just need TARGET_TRIPLE to locate the prebuilt binary, and
@@ -144,13 +144,13 @@ elif [[ $RELEASE_CHANNEL = "local" || $RELEASE_CHANNEL = "dev" ]]; then
# For dev bundles, we want to enable debug assertions to
# catch violations that would otherwise silently pass in
# a normal release build (e.g. in stable).
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "warpctrl" ]]; then
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "galaxyctrl" ]]; then
CARGO_PROFILE="release-cli-debug_assertions"
else
CARGO_PROFILE="release-lto-debug_assertions"
fi
else
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "warpctrl" ]]; then
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "galaxyctrl" ]]; then
CARGO_PROFILE="release-cli"
else
CARGO_PROFILE="release-lto"
@@ -173,71 +173,70 @@ mkdir -p "$OUT_DIR"
# APP_NAME here must match the value used in Rust as the
# application name; see app/src/channel.rs.
#
# WARP_BIN is the name of the binary produced by cargo;
# GALAXY_BIN is the name of the binary produced by cargo;
# BINARY_NAME is the desired name of the binary in the final package.
if [[ $RELEASE_CHANNEL = "local" ]]; then
WARP_BIN="warp"
BINARY_NAME="warp-local"
GALAXY_BIN="galaxy-local"
BINARY_NAME="galaxy-local"
APP_NAME="GalaxyLocal"
FEATURES="$FEATURES,agent_mode_debug"
export HANDLE_MARKDOWN=1
elif [[ $RELEASE_CHANNEL = "dev" ]]; then
WARP_BIN="dev"
BINARY_NAME="warp-dev"
GALAXY_BIN="galaxy-dev"
BINARY_NAME="galaxy-dev"
APP_NAME="GalaxyDev"
FEATURES="$FEATURES,agent_mode_debug"
# Enable heap usage tracking & profiling using jemalloc through pprof.
FEATURES="$FEATURES,jemalloc_pprof,heap_usage_tracking"
export HANDLE_MARKDOWN=1
elif [[ $RELEASE_CHANNEL = "preview" ]]; then
WARP_BIN="preview"
BINARY_NAME="warp-preview"
GALAXY_BIN="galaxy-preview"
BINARY_NAME="galaxy-preview"
APP_NAME="GalaxyPreview"
FEATURES="$FEATURES,preview_channel"
# Enable heap usage tracking & profiling using jemalloc through pprof.
FEATURES="$FEATURES,jemalloc_pprof,heap_usage_tracking"
elif [[ $RELEASE_CHANNEL = "stable" ]]; then
WARP_BIN="stable"
BINARY_NAME="warp"
GALAXY_BIN="stable"
BINARY_NAME="galaxy"
APP_NAME="Galaxy"
elif [[ $RELEASE_CHANNEL = "oss" ]]; then
WARP_BIN="warp-oss"
BINARY_NAME="warp-oss"
GALAXY_BIN="galaxy-oss"
BINARY_NAME="galaxy-oss"
APP_NAME="GalaxyOss"
# The OSS channel does not ship Sentry, so drop the crash_reporting feature
# (which would otherwise pull in the Sentry SDK as a dependency).
FEATURES="release_bundle"
fi
# Artifact-specific binary naming
if [[ "$ARTIFACT" == "cli" ]]; then
# For CLI artifacts, use oz instead of warp as the binary name. The OSS
# channel is an exception: its CLI command name is `warp-oss`, matching
# `Channel::cli_command_name` in the Rust source.
if [[ $RELEASE_CHANNEL != "oss" ]]; then
BINARY_NAME="${BINARY_NAME/warp/oz}"
fi
elif [[ "$ARTIFACT" == "warpctrl" ]]; then
BINARY_NAME="warpctrl"
# Keep packaged CLI names aligned with `Channel::cli_command_name`.
case "$RELEASE_CHANNEL" in
stable) BINARY_NAME="galaxy-ai" ;;
preview) BINARY_NAME="galaxy-ai-preview" ;;
dev) BINARY_NAME="galaxy-ai-dev" ;;
local) BINARY_NAME="galaxy-ai-local" ;;
oss) BINARY_NAME="galaxy-ai-oss" ;;
esac
elif [[ "$ARTIFACT" == "galaxyctrl" ]]; then
BINARY_NAME="galaxyctrl"
PACKAGES=()
fi
# Artifact-specific configuration
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "warpctrl" ]]; then
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "galaxyctrl" ]]; then
FEATURES="$FEATURES,standalone"
if [[ "$ARTIFACT" == "warpctrl" ]]; then
FEATURES="$FEATURES,warp_control_cli"
if [[ "$ARTIFACT" == "galaxyctrl" ]]; then
FEATURES="$FEATURES,galaxy_control_cli"
fi
elif [[ "$ARTIFACT" == "app" ]]; then
# All channels ship the v3 classifier and v2 heuristic.
FEATURES="$FEATURES,gui,nld_classifier_v3,nld_heuristic_v2"
FEATURES="$FEATURES,gui,nld_classifier_v3,nld_heuristic_v2,galaxy_control_cli"
fi
if [[ -n "$EXTRA_FEATURES" ]]; then
FEATURES="$FEATURES,$EXTRA_FEATURES"
fi
BUNDLE_ID="dev.warp.$APP_NAME"
EXECUTABLE_PATH="$CARGO_TARGET_OUTPUT_DIR/$WARP_BIN"
BUNDLE_ID="dev.galaxy.$APP_NAME"
EXECUTABLE_PATH="$CARGO_TARGET_OUTPUT_DIR/$GALAXY_BIN"
DEBUG_EXECUTABLE_PATH="$EXECUTABLE_PATH.debug"
# Note that this variable must be set (and exported!) before we compile the
@@ -249,14 +248,14 @@ export APPIMAGE_NAME="$APP_NAME-$BUILD_ARCH.AppImage"
# then exit. We use this script to invoke `cargo check` to ensure that we are
# using the same feature flags and profile that we would be using in production.
if [[ "$CHECK_ONLY" == "true" ]]; then
cargo check -p warp --profile "$CARGO_PROFILE" --bin "$WARP_BIN" --features "$FEATURES" ${TARGET_TRIPLE:+--target $TARGET_TRIPLE}
cargo check -p galaxy --profile "$CARGO_PROFILE" --bin "$GALAXY_BIN" --features "$FEATURES" ${TARGET_TRIPLE:+--target $TARGET_TRIPLE}
exit 0
fi
# Build the binary.
if [[ "$BUILD" == "true" ]]; then
echo "Building and bundling Warp for channel $RELEASE_CHANNEL and bundle id $BUNDLE_ID"
cargo build -p warp --profile "$CARGO_PROFILE" --bin "$WARP_BIN" --features "$FEATURES" ${TARGET_TRIPLE:+--target $TARGET_TRIPLE}
echo "Building and bundling Galaxy for channel $RELEASE_CHANNEL and bundle id $BUNDLE_ID"
cargo build -p galaxy --profile "$CARGO_PROFILE" --bin "$GALAXY_BIN" --features "$FEATURES" ${TARGET_TRIPLE:+--target $TARGET_TRIPLE}
echo "Making debug copy of '$EXECUTABLE_PATH' at '$DEBUG_EXECUTABLE_PATH'"
cp "$EXECUTABLE_PATH" "$DEBUG_EXECUTABLE_PATH"
@@ -275,25 +274,25 @@ else
echo 'Skipping `cargo build` step due to --skip-build argument'
fi
if [[ "$ARTIFACT" == "warpctrl" ]]; then
echo "Copying control-mode binary into $OUT_DIR/$WARP_BIN"
cp "$EXECUTABLE_PATH" "$OUT_DIR/$WARP_BIN"
WARPCTRL_SCRIPT_PATH="$OUT_DIR/warpctrl"
echo "Creating warpctrl wrapper script at $WARPCTRL_SCRIPT_PATH"
cat > "$WARPCTRL_SCRIPT_PATH" << EOF
if [[ "$ARTIFACT" == "galaxyctrl" ]]; then
echo "Copying control-mode binary into $OUT_DIR/$GALAXY_BIN"
cp "$EXECUTABLE_PATH" "$OUT_DIR/$GALAXY_BIN"
GALAXYCTRL_SCRIPT_PATH="$OUT_DIR/galaxyctrl"
echo "Creating galaxyctrl wrapper script at $GALAXYCTRL_SCRIPT_PATH"
cat > "$GALAXYCTRL_SCRIPT_PATH" << EOF
#!/usr/bin/env bash
script_dir="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
exec "\$script_dir/$WARP_BIN" --warpctrl "\$@"
exec -a "\$0" "\$script_dir/$GALAXY_BIN" --galaxyctrl "\$@"
EOF
chmod +x "$WARPCTRL_SCRIPT_PATH"
chmod +x "$GALAXYCTRL_SCRIPT_PATH"
fi
BINARY_PATH="$EXECUTABLE_PATH"
if [[ "$ARTIFACT" == "warpctrl" ]]; then
BINARY_PATH="$WARPCTRL_SCRIPT_PATH"
if [[ "$ARTIFACT" == "galaxyctrl" ]]; then
BINARY_PATH="$GALAXYCTRL_SCRIPT_PATH"
fi
# Prepare bundled resources for CLI builds.
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "warpctrl" ]]; then
if [[ "$ARTIFACT" == "cli" || "$ARTIFACT" == "galaxyctrl" ]]; then
echo "Preparing CLI resources directory"
BUNDLED_RESOURCES_DIR="$OUT_DIR/resources"
"$WORKSPACE_ROOT_DIR/script/prepare_bundled_resources" "$BUNDLED_RESOURCES_DIR" "$RELEASE_CHANNEL" "$CARGO_PROFILE"
+9 -12
View File
@@ -8,7 +8,7 @@
# - OUT_DIR: The directory into which we should place the final package.
# - CARGO_TARGET_OUTPUT_DIR: The cargo target directory containing build output.
# - RELEASE_CHANNEL: The release channel we're bundling (e.g.: "dev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.warp.WarpDev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.galaxy.GalaxyDev").
# - EXECUTABLE_PATH: The path to the compiled executable we want to install.
# - BINARY_NAME: The name that the compiled executable should have on the target machine.
# - APPIMAGE_NAME: The name of the AppImage file to produce.
@@ -16,14 +16,11 @@
STAGE_DIR="$DIST_DIR/appimagepkg"
APP_DIR="$DIST_DIR/AppDir"
# Extract channel suffix from BINARY_NAME
if [ "$ARTIFACT" = "cli" ]; then
CHANNEL_SUFFIX="${BINARY_NAME#oz}"
else
CHANNEL_SUFFIX="${BINARY_NAME#warp}"
if [[ "$ARTIFACT" != "app" ]]; then
echo "::error ::AppImage packaging only supports the app artifact" >&2
exit 1
fi
PACKAGE_NAME="warp-terminal$CHANNEL_SUFFIX"
source "$WORKSPACE_ROOT_DIR/script/linux/package_metadata"
# Adding NO_STRIP to stop linuxdeploy from attempting to strip symbols
# from binaries built on a different arch than the current symbol.
@@ -55,9 +52,9 @@ mkdir -p "$STAGE_DIR"
OPT_DIR="/opt/warpdotdev/$PACKAGE_NAME"
source "$WORKSPACE_ROOT_DIR/script/linux/bundle_install" "$STAGE_DIR"
# Modify the "Exec=" line in the .desktop file to use the name of the installed
# binary and not our /usr/bin symlink (which doesn't exist in an AppImage).
sed -i -E 's/Exec=warp-terminal/Exec=warp/' "$STAGE_DIR/usr/share/applications/$BUNDLE_ID.desktop"
# The AppImage exposes the staged Cargo binary rather than the package
# launcher's /usr/bin symlink, so point the desktop entry at that binary.
sed -i -E "s#^Exec=[^ ]+#Exec=$BINARY_NAME#" "$STAGE_DIR/usr/share/applications/$BUNDLE_ID.desktop"
# Find all icon files from inside the package staging directory.
ICON_FILES=( $(find "$STAGE_DIR/usr/share/icons" -name "*.png") )
@@ -68,7 +65,7 @@ rm -rf "$APP_DIR"
# Run linuxdeploy to create an appropriately-structured AppDir and turn it into
# an AppImage, located in OUT_DIR.
#
# We use a custom input plugin (bundled-resources) to copy Warp's bundled
# We use a custom input plugin (bundled-resources) to copy Galaxy's bundled
# resources into the AppDir alongside the executable, since linuxdeploy only
# deploys the binary, desktop file, and icons by default.
cd "$OUT_DIR"
+4 -24
View File
@@ -8,34 +8,14 @@
# - OUT_DIR: The directory into which we should place the final package.
# - CARGO_TARGET_OUTPUT_DIR: The cargo target directory containing build output.
# - RELEASE_CHANNEL: The release channel we're bundling (e.g.: "dev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.warp.WarpDev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.galaxy.GalaxyDev").
# - EXECUTABLE_PATH: The path to the compiled executable we want to install.
# - BINARY_NAME: The name that the compiled executable should have on the target machine.
# - ARTIFACT: Which artifact to build: app or cli.
set -e
# Extract channel suffix from BINARY_NAME
if [ "$ARTIFACT" = "cli" ]; then
CHANNEL_SUFFIX="${BINARY_NAME#oz}"
else
CHANNEL_SUFFIX="${BINARY_NAME#warp}"
fi
# On Linux, we keep the `-stable` suffix for stable to avoid package conflicts.
# The binary name is still `oz`, and the repo name is still `warpdotdev`.
if [ "$ARTIFACT" = "cli" -a "$RELEASE_CHANNEL" = "stable" ]; then
CHANNEL_SUFFIX="-stable"
fi
if [ "$ARTIFACT" = "app" ]; then
PACKAGE_NAME="warp-terminal$CHANNEL_SUFFIX"
elif [ "$ARTIFACT" = "cli" ]; then
PACKAGE_NAME="oz$CHANNEL_SUFFIX"
else
echo "::error ::Unknown ARTIFACT: $ARTIFACT (expected 'app' or 'cli')"
exit 1
fi
source "$WORKSPACE_ROOT_DIR/script/linux/package_metadata"
BUILD_ARCH="${BUILD_ARCH:-$(uname -m)}"
if [ "$BUILD_ARCH" = "aarch64" ]; then
@@ -71,14 +51,14 @@ tar cvf "$PKGDIR/data.tar" -C "$PKGDIR/stage" .
VERSION="$GIT_RELEASE_TAG"
RELEASE=1
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@VERSION@@#$VERSION#g; s#@@RELEASE@@#$RELEASE#g; s#@@ARCH@@#$ARCH#g; s#@@OUTDIR@@#$OUT_DIR#g; s#@@BINARY_NAME@@#$BINARY_NAME#g" \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@VERSION@@#$VERSION#g; s#@@RELEASE@@#$RELEASE#g; s#@@ARCH@@#$ARCH#g; s#@@OUTDIR@@#$OUT_DIR#g; s#@@BINARY_NAME@@#$BINARY_NAME#g" \
< "$WORKSPACE_ROOT_DIR/resources/linux/arch/$ARTIFACT/PKGBUILD.template" \
> "$PKGDIR/PKGBUILD"
# Only create wrapper script for app artifact
if [ "$ARTIFACT" = "app" ]; then
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@BINARY_NAME@@#$BINARY_NAME#g" \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@BINARY_NAME@@#$BINARY_NAME#g" \
< "$WORKSPACE_ROOT_DIR/resources/linux/arch/$ARTIFACT/warp.sh.template" \
> "$PKGDIR/$PACKAGE_NAME.sh"
fi
+5 -30
View File
@@ -8,39 +8,14 @@
# - OUT_DIR: The directory into which we should place the final package.
# - CARGO_TARGET_OUTPUT_DIR: The cargo target directory containing build output.
# - RELEASE_CHANNEL: The release channel we're bundling (e.g.: "dev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.warp.WarpDev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.galaxy.GalaxyDev").
# - EXECUTABLE_PATH: The path to the compiled executable we want to install.
# - BINARY_NAME: The name that the compiled executable should have on the target machine.
# - ARTIFACT: Which artifact to build: app or cli.
set -e
# Extract channel suffix from BINARY_NAME
if [ "$ARTIFACT" = "cli" ]; then
CHANNEL_SUFFIX="${BINARY_NAME#oz}"
else
CHANNEL_SUFFIX="${BINARY_NAME#warp}"
fi
REPO_NAME="warpdotdev$CHANNEL_SUFFIX"
# On Linux, we keep the `-stable` suffix for stable to avoid package conflicts.
# The binary name is still `oz`, and the repo name is still `warpdotdev`.
if [ "$ARTIFACT" = "cli" -a "$RELEASE_CHANNEL" = "stable" ]; then
CHANNEL_SUFFIX="-stable"
fi
case "$ARTIFACT" in
app)
PACKAGE_NAME="warp-terminal$CHANNEL_SUFFIX"
;;
cli)
PACKAGE_NAME="oz$CHANNEL_SUFFIX"
;;
*)
echo "::error ::Unknown ARTIFACT: $ARTIFACT (expected 'app' or 'cli')"
exit 1
;;
esac
source "$WORKSPACE_ROOT_DIR/script/linux/package_metadata"
TEMPLATE_DIR="$WORKSPACE_ROOT_DIR/resources/linux/debian/$ARTIFACT"
# Add a simple test to make sure we're generating the appropriate repository
@@ -87,11 +62,11 @@ DEBIAN_DIR="$PKGDIR/DEBIAN"
VERSION="$(echo "$GIT_RELEASE_TAG" | sed -E "s/^v//; s/([a-z]+)_/\1./")"
mkdir "$DEBIAN_DIR"
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@VERSION@@#$VERSION#g; s#@@ARCH@@#$ARCH#g" \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@VERSION@@#$VERSION#g; s#@@ARCH@@#$ARCH#g" \
< "$TEMPLATE_DIR/control.template" \
> "$DEBIAN_DIR/control"
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@BINARY_NAME@@#$BINARY_NAME#g; s#@@OPTDIR@@#$OPT_DIR#g; s#@@REPO_NAME@@#$REPO_NAME#g; s#@@CHANNEL@@#$RELEASE_CHANNEL#g; s#@@ARCH@@#$ARCH#g" \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@BINARY_NAME@@#$BINARY_NAME#g; s#@@OPTDIR@@#$OPT_DIR#g; s#@@REPO_NAME@@#$REPO_NAME#g; s#@@CHANNEL@@#$RELEASE_CHANNEL#g; s#@@ARCH@@#$ARCH#g" \
< "$TEMPLATE_DIR/postinst.template" \
> "$DEBIAN_DIR/postinst"
sed \
@@ -99,7 +74,7 @@ sed \
< "$WORKSPACE_ROOT_DIR/resources/linux/debian/common/postinst.repo.template" \
>> "$DEBIAN_DIR/postinst"
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@OPTDIR@@#$OPT_DIR#g; s#@@REPO_NAME@@#$REPO_NAME#g" \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; s#@@BINARY_NAME@@#$BINARY_NAME#g; s#@@OPTDIR@@#$OPT_DIR#g; s#@@REPO_NAME@@#$REPO_NAME#g" \
< "$TEMPLATE_DIR/postrm.template" \
> "$DEBIAN_DIR/postrm"
sed \
+19 -1
View File
@@ -9,7 +9,7 @@
# - CARGO_TARGET_OUTPUT_DIR: The cargo target directory containing build output.
# - OPT_DIR: The absolute path to our install directory (under /opt) on the target machine.
# - RELEASE_CHANNEL: The release channel we're bundling (e.g.: "dev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.warp.WarpDev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.galaxy.GalaxyDev").
# - EXECUTABLE_PATH: The path to the compiled executable we want to install.
# - BINARY_NAME: The name that the compiled executable should have on the target machine.
# - ARTIFACT: Which artifact to build: app or cli.
@@ -34,6 +34,24 @@ fi
install -D "$EXECUTABLE_PATH" "${TARGET_DIR}${OPT_DIR}/$BINARY_NAME"
# Only install desktop file and icons if the artifact is "app"
if [[ "$ARTIFACT" == "app" ]]; then
# Normal app packages expose both command-line entrypoints through the same
# channel-specific Galaxy executable. The Galaxy AI wrapper preserves its
# invocation name, while Galaxy Control also selects the isolated control
# parser before normal app startup.
source "$WORKSPACE_ROOT_DIR/script/linux/package_metadata"
mkdir -p "${TARGET_DIR}/usr/bin"
cat > "${TARGET_DIR}/usr/bin/$GALAXY_AI_COMMAND_NAME" << EOF
#!/usr/bin/env bash
exec -a "\$0" "$OPT_DIR/$BINARY_NAME" "\$@"
EOF
cat > "${TARGET_DIR}/usr/bin/$GALAXY_CONTROL_COMMAND_NAME" << EOF
#!/usr/bin/env bash
exec -a "\$0" "$OPT_DIR/$BINARY_NAME" --galaxyctrl "\$@"
EOF
chmod 755 \
"${TARGET_DIR}/usr/bin/$GALAXY_AI_COMMAND_NAME" \
"${TARGET_DIR}/usr/bin/$GALAXY_CONTROL_COMMAND_NAME"
install -Dm644 "$WORKSPACE_ROOT_DIR/app/channels/$RELEASE_CHANNEL/$BUNDLE_ID.desktop" "${TARGET_DIR}/usr/share/applications/$BUNDLE_ID.desktop"
for size in 16x16 32x32 64x64 128x128 256x256 512x512; do
src_path="$WORKSPACE_ROOT_DIR/app/channels/$RELEASE_CHANNEL/icon/no-padding/$size.png"
+6 -24
View File
@@ -8,36 +8,15 @@
# - OUT_DIR: The directory into which we should place the final package.
# - CARGO_TARGET_OUTPUT_DIR: The cargo target directory containing build output.
# - RELEASE_CHANNEL: The release channel we're bundling (e.g.: "dev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.warp.WarpDev").
# - BUNDLE_ID: The app ID for the bundle (e.g.: "dev.galaxy.GalaxyDev").
# - EXECUTABLE_PATH: The path to the compiled executable we want to install.
# - BINARY_NAME: The name that the compiled executable should have on the target machine.
# - ARTIFACT: Which artifact to build: app or cli.
set -e
# Extract channel suffix from BINARY_NAME
if [ "$ARTIFACT" = "cli" ]; then
CHANNEL_SUFFIX="${BINARY_NAME#oz}"
else
CHANNEL_SUFFIX="${BINARY_NAME#warp}"
fi
REPO_NAME="warpdotdev$CHANNEL_SUFFIX"
# On Linux, we keep the `-stable` suffix for stable to avoid package conflicts.
# The binary name is still `oz`, and the repo name is still `warpdotdev`.
if [ "$ARTIFACT" = "cli" -a "$RELEASE_CHANNEL" = "stable" ]; then
CHANNEL_SUFFIX="-stable"
fi
ARTIFACT="${ARTIFACT:-app}"
if [ "$ARTIFACT" = "app" ]; then
PACKAGE_NAME="warp-terminal$CHANNEL_SUFFIX"
elif [ "$ARTIFACT" = "cli" ]; then
PACKAGE_NAME="oz$CHANNEL_SUFFIX"
else
echo "::error ::Unknown ARTIFACT: $ARTIFACT (expected 'app' or 'cli')"
exit 1
fi
source "$WORKSPACE_ROOT_DIR/script/linux/package_metadata"
BUILD_ARCH="${BUILD_ARCH:-$(uname -m)}"
if [ "$BUILD_ARCH" = "aarch64" ]; then
@@ -69,8 +48,11 @@ mkdir -p "$RPMBUILD_DIR"/{SPEC,RPMS}
VERSION="$GIT_RELEASE_TAG"
RELEASE="1"
sed \
"s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; \
"s#@@PACKAGE_NAME@@#$PACKAGE_NAME#g; \
s#@@CHANNEL_SUFFIX@@#$CHANNEL_SUFFIX#g; \
s#@@BINARY_NAME@@#$BINARY_NAME#g; \
s#@@GALAXY_AI_COMMAND_NAME@@#$GALAXY_AI_COMMAND_NAME#g; \
s#@@GALAXY_CONTROL_COMMAND_NAME@@#$GALAXY_CONTROL_COMMAND_NAME#g; \
s#@@VERSION@@#$VERSION#g; \
s#@@RELEASE@@#$RELEASE#g; \
s#@@ARCH@@#$ARCH#g; \
+4 -4
View File
@@ -1,6 +1,6 @@
#!/bin/bash
#
# linuxdeploy input plugin for restructuring the AppDir to match Warp's
# linuxdeploy input plugin for restructuring the AppDir to match Galaxy's
# standard Linux install layout.
#
# By default, linuxdeploy places the executable at usr/bin/ inside the AppDir.
@@ -12,8 +12,8 @@
# as installing a .deb or .rpm package.
#
# Required environment variables:
# WARP_BINARY_NAME: Name of the binary (e.g. "warp-dev").
# WARP_PACKAGE_NAME: Package directory name (e.g. "warp-terminal-dev").
# WARP_BINARY_NAME: Name of the binary (e.g. "galaxy-dev").
# WARP_PACKAGE_NAME: Package directory name (e.g. "galaxy-terminal-dev").
# WARP_BUNDLED_RESOURCES_DIR: Path to the staged resources directory to copy.
set -e
@@ -76,4 +76,4 @@ echo "Copying bundled resources to $DEST_RESOURCES"
mkdir -p "$DEST_RESOURCES"
cp -R "$WARP_BUNDLED_RESOURCES_DIR/." "$DEST_RESOURCES/"
echo "Successfully restructured AppDir for Warp"
echo "Successfully restructured AppDir for Galaxy"
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
#
# Derives Linux package metadata from Galaxy's release channel and artifact.
# This file is sourced by the individual package builders.
case "$RELEASE_CHANNEL" in
stable)
CHANNEL_SUFFIX=""
;;
local|dev|preview|oss)
CHANNEL_SUFFIX="-$RELEASE_CHANNEL"
;;
*)
echo "::error ::Unknown RELEASE_CHANNEL: $RELEASE_CHANNEL" >&2
return 1
;;
esac
GALAXY_AI_COMMAND_NAME="galaxy-ai$CHANNEL_SUFFIX"
GALAXY_CONTROL_COMMAND_NAME="galaxyctrl$CHANNEL_SUFFIX"
case "$ARTIFACT" in
app)
# The OSS desktop entry invokes the Cargo binary directly. Other channels
# expose the traditional `*-terminal` launcher independently of the Cargo
# binary name.
if [[ "$RELEASE_CHANNEL" == "oss" ]]; then
PACKAGE_NAME="galaxy-oss"
else
PACKAGE_NAME="galaxy-terminal$CHANNEL_SUFFIX"
fi
;;
cli)
PACKAGE_NAME="galaxy-ai$CHANNEL_SUFFIX"
;;
*)
echo "::error ::Unknown ARTIFACT: $ARTIFACT (expected 'app' or 'cli')" >&2
return 1
;;
esac
# Repository provisioning still uses the existing release infrastructure and
# templates. This name is intentionally independent of Galaxy package names.
REPO_NAME="warpdotdev$CHANNEL_SUFFIX"
@@ -43,20 +43,22 @@ PATH="$temp_dir/bin:$PATH" \
CARGO_TARGET_DIR="$temp_dir/target" \
"$workspace_root/script/linux/bundle" \
--check-only \
--artifact warpctrl \
--artifact galaxyctrl \
--arch "$arch" \
--features smoke_feature
grep -qx -- '--features' "$temp_dir/cargo-args"
grep -qx -- 'release_bundle,crash_reporting,agent_mode_debug,jemalloc_pprof,heap_usage_tracking,standalone,warp_control_cli,smoke_feature' "$temp_dir/cargo-args"
grep -qx -- 'galaxy' "$temp_dir/cargo-args"
grep -qx -- 'galaxy-dev' "$temp_dir/cargo-args"
grep -qx -- 'release_bundle,agent_mode_debug,jemalloc_pprof,heap_usage_tracking,standalone,galaxy_control_cli,smoke_feature' "$temp_dir/cargo-args"
profile_dir="$temp_dir/target/$target/release-cli-debug_assertions"
mkdir -p "$profile_dir"
cat > "$profile_dir/dev" <<'EOF'
cat > "$profile_dir/galaxy-dev" <<'EOF'
#!/usr/bin/env bash
printf '%s\n' "$@" > "$FORWARDED_ARGS_FILE"
EOF
chmod +x "$profile_dir/dev"
chmod +x "$profile_dir/galaxy-dev"
PATH="$temp_dir/bin:$PATH" \
CARGO_TARGET_DIR="$temp_dir/target" \
@@ -64,14 +66,16 @@ PATH="$temp_dir/bin:$PATH" \
SKIP_SETTINGS_SCHEMA=1 \
"$workspace_root/script/linux/bundle" \
--skip-build \
--artifact warpctrl \
--artifact galaxyctrl \
--arch "$arch"
grep -Fq 'exec -a "$0"' "$profile_dir/bundle/linux/galaxyctrl"
FORWARDED_ARGS_FILE="$temp_dir/forwarded-args" \
"$profile_dir/bundle/linux/warpctrl" tab create --instance "inst 123"
"$profile_dir/bundle/linux/galaxyctrl" tab create --instance "inst 123"
cat > "$temp_dir/expected-forwarded-args" <<'EOF'
--warpctrl
--galaxyctrl
tab
create
--instance
+118
View File
@@ -0,0 +1,118 @@
#!/usr/bin/env bash
set -e
workspace_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
assert_metadata() {
local artifact="$1"
local channel="$2"
local expected_suffix="$3"
local expected_package="$4"
ARTIFACT="$artifact"
RELEASE_CHANNEL="$channel"
source "$workspace_root/script/linux/package_metadata"
[[ "$CHANNEL_SUFFIX" == "$expected_suffix" ]]
[[ "$PACKAGE_NAME" == "$expected_package" ]]
[[ "$GALAXY_AI_COMMAND_NAME" == "galaxy-ai$expected_suffix" ]]
[[ "$GALAXY_CONTROL_COMMAND_NAME" == "galaxyctrl$expected_suffix" ]]
}
assert_metadata app stable "" galaxy-terminal
assert_metadata app local -local galaxy-terminal-local
assert_metadata app dev -dev galaxy-terminal-dev
assert_metadata app preview -preview galaxy-terminal-preview
assert_metadata app oss -oss galaxy-oss
assert_metadata cli stable "" galaxy-ai
assert_metadata cli local -local galaxy-ai-local
assert_metadata cli dev -dev galaxy-ai-dev
assert_metadata cli preview -preview galaxy-ai-preview
assert_metadata cli oss -oss galaxy-ai-oss
assert_desktop_launcher() {
local channel="$1"
local app_name="$2"
local expected_launcher="$3"
local desktop_file="$workspace_root/app/channels/$channel/dev.galaxy.$app_name.desktop"
[[ -f "$desktop_file" ]]
grep -qx -- "Exec=$expected_launcher %U" "$desktop_file"
}
assert_desktop_launcher stable Galaxy galaxy-terminal
assert_desktop_launcher local GalaxyLocal galaxy-terminal-local
assert_desktop_launcher dev GalaxyDev galaxy-terminal-dev
assert_desktop_launcher preview GalaxyPreview galaxy-terminal-preview
assert_desktop_launcher oss GalaxyOss galaxy-oss
grep -qx -- 'Package: @@PACKAGE_NAME@@' \
"$workspace_root/resources/linux/debian/app/control.template" \
"$workspace_root/resources/linux/debian/cli/control.template"
grep -qx -- 'Name: @@PACKAGE_NAME@@' \
"$workspace_root/resources/linux/rpm/app/warp.spec.template" \
"$workspace_root/resources/linux/rpm/cli/warp.spec.template"
grep -qx -- '%{_bindir}/@@GALAXY_AI_COMMAND_NAME@@' \
"$workspace_root/resources/linux/rpm/app/warp.spec.template"
grep -qx -- '%{_bindir}/@@GALAXY_CONTROL_COMMAND_NAME@@' \
"$workspace_root/resources/linux/rpm/app/warp.spec.template"
grep -qx -- 'pkgname=@@PACKAGE_NAME@@' \
"$workspace_root/resources/linux/arch/app/PKGBUILD.template" \
"$workspace_root/resources/linux/arch/cli/PKGBUILD.template"
temp_dir="$(mktemp -d)"
trap 'rm -rf "$temp_dir"' EXIT
fake_workspace="$temp_dir/workspace"
stage_dir="$temp_dir/stage"
mkdir -p \
"$fake_workspace/bin" \
"$fake_workspace/script/linux" \
"$fake_workspace/app/channels/dev" \
"$stage_dir"
ln -s \
"$workspace_root/script/linux/package_metadata" \
"$fake_workspace/script/linux/package_metadata"
cat > "$fake_workspace/script/prepare_bundled_resources" <<'EOF'
#!/usr/bin/env bash
exit 0
EOF
chmod +x "$fake_workspace/script/prepare_bundled_resources"
cat > "$fake_workspace/bin/install" <<'EOF'
#!/usr/bin/env bash
paths=()
for arg in "$@"; do
if [[ "$arg" != -* ]]; then
paths+=("$arg")
fi
done
mkdir -p "$(dirname "${paths[1]}")"
cp "${paths[0]}" "${paths[1]}"
EOF
chmod +x "$fake_workspace/bin/install"
cat > "$fake_workspace/app/channels/dev/dev.galaxy.GalaxyDev.desktop" <<'EOF'
[Desktop Entry]
Name=Galaxy Dev
Exec=galaxy-terminal-dev %U
EOF
cat > "$temp_dir/galaxy-dev" <<'EOF'
#!/usr/bin/env bash
exit 0
EOF
chmod +x "$temp_dir/galaxy-dev"
PATH="$fake_workspace/bin:$PATH" \
WORKSPACE_ROOT_DIR="$fake_workspace" \
RELEASE_CHANNEL=dev \
ARTIFACT=app \
BUNDLE_ID=dev.galaxy.GalaxyDev \
EXECUTABLE_PATH="$temp_dir/galaxy-dev" \
BINARY_NAME=galaxy-dev \
OPT_DIR=/opt/warpdotdev/galaxy-terminal-dev \
CARGO_PROFILE=dev \
"$workspace_root/script/linux/bundle_install" "$stage_dir"
grep -Fq 'exec -a "$0" "/opt/warpdotdev/galaxy-terminal-dev/galaxy-dev" "$@"' \
"$stage_dir/usr/bin/galaxy-ai-dev"
grep -Fq 'exec -a "$0" "/opt/warpdotdev/galaxy-terminal-dev/galaxy-dev" --galaxyctrl "$@"' \
"$stage_dir/usr/bin/galaxyctrl-dev"