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:
+49
-50
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user