@humanu/orchestra 0.5.37 → 0.5.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/resources/api/tmux.sh +9 -16
- package/resources/prebuilt/linux-x64/orchestra +0 -0
- package/resources/prebuilt/macos-arm64/orchestra +0 -0
- package/resources/prebuilt/macos-intel/orchestra +0 -0
- package/resources/scripts/gw-bridge.sh +2 -0
- package/resources/scripts/shell/git/bridge_enhanced_git_status.sh +10 -6
package/package.json
CHANGED
package/resources/api/tmux.sh
CHANGED
|
@@ -681,27 +681,28 @@ tmux_session_preview() {
|
|
|
681
681
|
return 0
|
|
682
682
|
fi
|
|
683
683
|
|
|
684
|
-
# Capture
|
|
684
|
+
# Optimized: Capture only visible lines instead of entire buffer
|
|
685
685
|
# -e flag preserves escape sequences for colors and formatting
|
|
686
|
-
# -S - means start from the current position (
|
|
686
|
+
# -S - means start from the current position (visible area)
|
|
687
687
|
# -E - means end at the current position
|
|
688
|
-
# This captures
|
|
688
|
+
# This captures only what's visible on screen, making it much faster
|
|
689
689
|
local txt
|
|
690
|
-
txt="$(tmux capture-pane -e -p -
|
|
690
|
+
txt="$(tmux capture-pane -e -p -t "$pane" 2>/dev/null)"
|
|
691
691
|
|
|
692
692
|
if [[ -z "$txt" ]]; then
|
|
693
693
|
echo "(no output yet)"
|
|
694
694
|
return 0
|
|
695
695
|
fi
|
|
696
696
|
|
|
697
|
-
#
|
|
698
|
-
local term_info
|
|
697
|
+
# Optimized: Get terminal info in a single command instead of multiple calls
|
|
698
|
+
local term_info has_rgb
|
|
699
699
|
term_info="$(tmux show-environment -t "$s" TERM 2>/dev/null | cut -d= -f2 || echo "unknown")"
|
|
700
700
|
|
|
701
|
-
#
|
|
702
|
-
local has_rgb="false"
|
|
701
|
+
# Fast check for RGB support without full grep
|
|
703
702
|
if tmux show-options -t "$s" -s terminal-overrides 2>/dev/null | grep -q "RGB"; then
|
|
704
703
|
has_rgb="true"
|
|
704
|
+
else
|
|
705
|
+
has_rgb="false"
|
|
705
706
|
fi
|
|
706
707
|
|
|
707
708
|
# For ANSI-preserved preview with color mode info
|
|
@@ -714,14 +715,6 @@ tmux_session_preview() {
|
|
|
714
715
|
echo "<<<COLORMODE:16>>>"
|
|
715
716
|
fi
|
|
716
717
|
echo "$txt"
|
|
717
|
-
|
|
718
|
-
# If no content after processing, show placeholder
|
|
719
|
-
if [[ -z "$txt" ]]; then
|
|
720
|
-
echo "(session active, no visible output)"
|
|
721
|
-
return 0
|
|
722
|
-
fi
|
|
723
|
-
|
|
724
|
-
echo "$txt"
|
|
725
718
|
}
|
|
726
719
|
|
|
727
720
|
# --------------------------- Advanced Operations ----------------------------
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,6 +29,8 @@ source "$SCRIPT_DIR/shell/bridge/copy_env.sh"
|
|
|
29
29
|
source "$SCRIPT_DIR/shell/git/bridge_worktree.sh"
|
|
30
30
|
source "$SCRIPT_DIR/shell/git/bridge_repo.sh"
|
|
31
31
|
source "$SCRIPT_DIR/shell/git/bridge_merge.sh"
|
|
32
|
+
source "$SCRIPT_DIR/shell/git/bridge_enhanced_git_status.sh"
|
|
33
|
+
source "$SCRIPT_DIR/shell/git/bridge_git_status.sh"
|
|
32
34
|
|
|
33
35
|
# Define utilities we need
|
|
34
36
|
err() { printf '❌ %s\n' "$*" >&2; }
|
|
@@ -29,9 +29,13 @@ bridge_enhanced_git_status() {
|
|
|
29
29
|
ahead="$(echo "$ahead_behind" | cut -f1)"
|
|
30
30
|
behind="$(echo "$ahead_behind" | cut -f2)"
|
|
31
31
|
|
|
32
|
+
# Get all diff stats in bulk for performance
|
|
33
|
+
staged_stats="$(git diff --cached --numstat 2>/dev/null)"
|
|
34
|
+
unstaged_stats="$(git diff --numstat 2>/dev/null)"
|
|
35
|
+
|
|
32
36
|
# Process each file and get diff stats
|
|
33
37
|
files_payload=""
|
|
34
|
-
|
|
38
|
+
while IFS= read -r line; do
|
|
35
39
|
if [[ -n "$line" ]]; then
|
|
36
40
|
index_status="${line:0:1}"
|
|
37
41
|
workdir_status="${line:1:1}"
|
|
@@ -43,8 +47,8 @@ bridge_enhanced_git_status() {
|
|
|
43
47
|
|
|
44
48
|
# Check for staged changes first
|
|
45
49
|
if [[ "$index_status" != " " && "$index_status" != "?" ]]; then
|
|
46
|
-
#
|
|
47
|
-
stats="$(
|
|
50
|
+
# Look up stats in bulk staged diff
|
|
51
|
+
stats="$(echo "$staged_stats" | grep -F " $filepath" | head -1)"
|
|
48
52
|
if [[ -n "$stats" && "$stats" != "- -"* ]]; then
|
|
49
53
|
added="$(echo "$stats" | cut -f1)"
|
|
50
54
|
deleted="$(echo "$stats" | cut -f2)"
|
|
@@ -56,8 +60,8 @@ bridge_enhanced_git_status() {
|
|
|
56
60
|
|
|
57
61
|
# Check for working directory changes if no staged stats or if workdir is also modified
|
|
58
62
|
if [[ "$workdir_status" != " " && "$workdir_status" != "?" ]] && [[ $added -eq 0 && $deleted -eq 0 ]]; then
|
|
59
|
-
#
|
|
60
|
-
stats="$(
|
|
63
|
+
# Look up stats in bulk unstaged diff
|
|
64
|
+
stats="$(echo "$unstaged_stats" | grep -F " $filepath" | head -1)"
|
|
61
65
|
if [[ -n "$stats" && "$stats" != "- -"* ]]; then
|
|
62
66
|
added="$(echo "$stats" | cut -f1)"
|
|
63
67
|
deleted="$(echo "$stats" | cut -f2)"
|
|
@@ -86,7 +90,7 @@ bridge_enhanced_git_status() {
|
|
|
86
90
|
"lines_deleted:n=$deleted")"
|
|
87
91
|
files_payload+="$file_json"$'\n'
|
|
88
92
|
fi
|
|
89
|
-
done
|
|
93
|
+
done <<< "$status_lines"
|
|
90
94
|
|
|
91
95
|
if [[ -n "$files_payload" ]]; then
|
|
92
96
|
files_json="$(json_array_from_json_lines "$files_payload")"
|