@humanu/orchestra 0.5.77 → 0.5.79

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.
Files changed (84) hide show
  1. package/bin/{gw.js → orchestra-cli.js} +1 -1
  2. package/bin/orchestra.js +2 -2
  3. package/install.js +41 -42
  4. package/package.json +2 -3
  5. package/resources/api/git.sh +4 -444
  6. package/resources/api/tmux.sh +4 -2804
  7. package/resources/prebuilt/linux-x64/{gw-env-copy → env-copy} +0 -0
  8. package/resources/prebuilt/linux-x64/orchestra +0 -0
  9. package/resources/prebuilt/macos-arm64/{gw-env-copy → env-copy} +0 -0
  10. package/resources/prebuilt/macos-arm64/orchestra +0 -0
  11. package/resources/prebuilt/macos-intel/{gw-env-copy → env-copy} +0 -0
  12. package/resources/prebuilt/macos-intel/orchestra +0 -0
  13. package/resources/scripts/{gw.sh → orchestra-cli.sh} +14 -14
  14. package/resources/scripts/orchestra-local.sh +6 -6
  15. package/resources/scripts/{gwr.sh → orchestra.sh} +11 -55
  16. package/resources/scripts/{shell/bridge → server/services}/ai.sh +4 -4
  17. package/resources/scripts/{gw-bridge.sh → server/services/dispatch.sh} +62 -59
  18. package/resources/scripts/server/services/git/api.sh +447 -0
  19. package/resources/scripts/{shell/git/bridge_check_branch.sh → server/services/git/check_branch_api.sh} +1 -1
  20. package/resources/scripts/{shell/git/bridge_create_worktree.sh → server/services/git/create_worktree_api.sh} +3 -3
  21. package/resources/scripts/{shell/git/bridge_create_worktree_from_existing.sh → server/services/git/create_worktree_from_existing_api.sh} +2 -2
  22. package/resources/scripts/{shell/git/bridge_create_worktree_from_remote.sh → server/services/git/create_worktree_from_remote_api.sh} +2 -2
  23. package/resources/scripts/{shell/git/bridge_delete_branch_only.sh → server/services/git/delete_branch_only_api.sh} +1 -1
  24. package/resources/scripts/{shell/git/bridge_delete_worktree.sh → server/services/git/delete_worktree_api.sh} +2 -2
  25. package/resources/scripts/{shell/git/bridge_delete_worktree_only.sh → server/services/git/delete_worktree_only_api.sh} +1 -1
  26. package/resources/scripts/{shell/git/bridge_enhanced_git_status.sh → server/services/git/enhanced_git_status_api.sh} +3 -3
  27. package/resources/scripts/{shell/git/bridge_git_status.sh → server/services/git/git_status_api.sh} +2 -2
  28. package/resources/scripts/{shell/git/bridge_list_worktrees.sh → server/services/git/list_worktrees_api.sh} +2 -2
  29. package/resources/scripts/server/services/git/merge_api.sh +12 -0
  30. package/resources/scripts/{shell/git/bridge_merge_from_primary.sh → server/services/git/merge_from_primary_api.sh} +1 -1
  31. package/resources/scripts/{shell/git/bridge_merge_into_primary.sh → server/services/git/merge_into_primary_api.sh} +1 -1
  32. package/resources/scripts/{shell/git/bridge_primary_branch.sh → server/services/git/primary_branch_api.sh} +1 -1
  33. package/resources/scripts/{shell/git/bridge_rebase_from_primary.sh → server/services/git/rebase_from_primary_api.sh} +1 -1
  34. package/resources/scripts/server/services/git/repo_api.sh +12 -0
  35. package/resources/scripts/{shell/git/bridge_repo_info.sh → server/services/git/repo_info_api.sh} +1 -1
  36. package/resources/scripts/{shell/git/bridge_squash_into_primary.sh → server/services/git/squash_into_primary_api.sh} +1 -1
  37. package/resources/scripts/{shell/git/bridge_switch_worktree.sh → server/services/git/switch_worktree_api.sh} +2 -2
  38. package/resources/scripts/server/services/git/worktree_api.sh +17 -0
  39. package/resources/scripts/{shell/bridge/utils.sh → server/services/json.sh} +23 -23
  40. package/resources/scripts/{shell/bridge → server/services/session}/tmux.sh +14 -14
  41. package/resources/scripts/server/session/tmux_api.sh +2812 -0
  42. package/resources/scripts/services.sh +6 -0
  43. package/resources/scripts/shell/AGENTS.md +63 -74
  44. package/resources/scripts/shell/build/dependencies.sh +33 -0
  45. package/resources/scripts/shell/build/install.sh +7 -0
  46. package/resources/scripts/shell/build/load.sh +10 -0
  47. package/resources/scripts/shell/build/logging.sh +6 -0
  48. package/resources/scripts/shell/build/rust.sh +18 -0
  49. package/resources/scripts/shell/build/services.sh +17 -0
  50. package/resources/scripts/shell/build/{build_usage.sh → usage.sh} +6 -6
  51. package/resources/scripts/shell/cli_load.sh +9 -0
  52. package/resources/scripts/shell/{gw_env_copy.sh → env_copy.sh} +11 -11
  53. package/resources/scripts/shell/env_copy_command.sh +2 -2
  54. package/resources/scripts/shell/git/checkout_worktree.sh +4 -4
  55. package/resources/scripts/shell/git/create_worktree.sh +2 -2
  56. package/resources/scripts/shell/git/delete_worktree.sh +1 -1
  57. package/resources/scripts/shell/git/merge.sh +1 -1
  58. package/resources/scripts/shell/git/repo.sh +1 -1
  59. package/resources/scripts/shell/git/worktree.sh +1 -1
  60. package/resources/scripts/shell/gwr/check-updates.sh +1 -1
  61. package/resources/scripts/shell/gwr_binary.sh +4 -4
  62. package/resources/scripts/shell/gwr_load.sh +1 -1
  63. package/resources/scripts/shell/gwr_services.sh +10 -0
  64. package/resources/scripts/shell/gwr_usage.sh +10 -10
  65. package/resources/scripts/shell/orchestra-command-hook.sh +15 -15
  66. package/resources/scripts/shell/orchestra-local.sh +6 -6
  67. package/resources/scripts/shell/tmux/new_session_command.sh +1 -1
  68. package/bin/gwr.js +0 -10
  69. package/resources/scripts/shell/build/build_bridge.sh +0 -17
  70. package/resources/scripts/shell/build/build_dependencies.sh +0 -33
  71. package/resources/scripts/shell/build/build_install.sh +0 -7
  72. package/resources/scripts/shell/build/build_load.sh +0 -10
  73. package/resources/scripts/shell/build/build_logging.sh +0 -6
  74. package/resources/scripts/shell/build/build_rust.sh +0 -18
  75. package/resources/scripts/shell/git/bridge_merge.sh +0 -12
  76. package/resources/scripts/shell/git/bridge_repo.sh +0 -12
  77. package/resources/scripts/shell/git/bridge_worktree.sh +0 -17
  78. package/resources/scripts/shell/gw_legacy_wrappers.sh +0 -7
  79. package/resources/scripts/shell/gw_load.sh +0 -10
  80. package/resources/scripts/shell/gwr_bridge.sh +0 -10
  81. /package/resources/scripts/shell/{gw_debug.sh → cli_debug.sh} +0 -0
  82. /package/resources/scripts/shell/{gw_err.sh → cli_err.sh} +0 -0
  83. /package/resources/scripts/shell/{gw_have_cmd.sh → cli_have_cmd.sh} +0 -0
  84. /package/resources/scripts/shell/{gw_info.sh → cli_info.sh} +0 -0
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ exec "$SCRIPT_DIR/server/services/dispatch.sh" "$@"
@@ -6,79 +6,73 @@ This document provides comprehensive context for AI agents and LLMs working with
6
6
 
7
7
  ```
8
8
  shell/
9
- ├── gwr_load.sh # Main loader for gwr (Rust TUI) components
9
+ ├── gwr_load.sh # Main loader for orchestra (Rust TUI) components
10
10
  ├── gwr_colors.sh # Color definitions and terminal styling
11
11
  ├── gwr_logging.sh # Logging utilities and output formatting
12
12
  ├── gwr_git.sh # Git repository validation functions
13
- ├── gwr_bridge.sh # Bridge script validation and setup
13
+ ├── gwr_services.sh # Services script validation and setup
14
14
  ├── gwr_binary.sh # Binary discovery and validation
15
15
  ├── gwr_terminal.sh # Terminal title and environment setup
16
- ├── gwr_usage.sh # Usage/help text for gwr command
17
- ├── gw_load.sh # Main loader for gw (CLI) components
18
- ├── gw_colors.sh # Color definitions for gw CLI
19
- ├── gw_logging.sh # Logging for gw CLI
20
- ├── gw_git.sh # Git operations for gw CLI
21
- ├── gw_worktree.sh # Worktree management for gw CLI
22
- ├── gw_usage.sh # Usage text for gw command
23
- ├── gw_env_copy.sh # Rust env copy helper/wrapper
24
- ├── commands.sh # Shared command utilities
16
+ ├── gwr_usage.sh # Usage/help text for orchestra command
17
+ ├── cli_load.sh # Main loader for orchestra-cli components
18
+ ├── env_copy.sh # Rust env copy helper/wrapper
25
19
  ├── build/ # Build system components
26
- │ ├── build_bridge.sh # Bridge building logic
27
- │ ├── build_dependencies.sh # Dependency checking
28
- │ ├── build_install.sh # Installation procedures
29
- │ ├── build_load.sh # Build system loader
30
- │ ├── build_logging.sh # Build-specific logging
31
- │ ├── build_rust.sh # Rust compilation logic
32
- │ └── build_usage.sh # Build command usage
20
+ │ ├── services.sh # Services testing logic
21
+ │ ├── dependencies.sh # Dependency checking
22
+ │ ├── install.sh # Installation procedures
23
+ │ ├── load.sh # Build system loader
24
+ │ ├── logging.sh # Build-specific logging
25
+ │ ├── rust.sh # Rust compilation logic
26
+ │ └── usage.sh # Build command usage
33
27
  ├── git/ # Git-specific utilities
34
28
  │ └── gwr_worktree_title.sh # Worktree title generation
35
- └── gwr/ # gwr-specific components
29
+ └── gwr/ # TUI launcher components
36
30
  └── check-updates.sh # Update checking functionality
37
31
  ```
38
32
 
39
33
  ## Core System Files
40
34
 
41
35
  ### gwr_load.sh
42
- **Purpose**: Main loader for the gwr (Rust TUI) system
43
- **Usage**: Sourced by gwr.sh to load all necessary components
36
+ **Purpose**: Main loader for the orchestra Rust TUI launcher system
37
+ **Usage**: Sourced by orchestra.sh to load all necessary components
44
38
  **Key Functions**:
45
- - Loads all gwr-specific modules in correct order
39
+ - Loads all TUI launcher modules in correct order
46
40
  - Provides `gwr_load_core()` function
47
41
  **Dependencies**: All gwr_*.sh files in shell/
48
42
 
49
43
  ### gwr_colors.sh
50
- **Purpose**: Color definitions and terminal styling for gwr
51
- **Usage**: Provides consistent color scheme across gwr components
44
+ **Purpose**: Color definitions and terminal styling for the TUI launcher
45
+ **Usage**: Provides consistent color scheme across TUI launcher components
52
46
  **Key Variables**:
53
47
  - `BLUE`, `GREEN`, `YELLOW`, `RED`, `NC` - ANSI color codes
54
48
  - Used for status messages, errors, and UI feedback
55
49
 
56
50
  ### gwr_logging.sh
57
51
  **Purpose**: Logging and output formatting utilities
58
- **Usage**: Standardized logging functions for gwr operations
52
+ **Usage**: Standardized logging functions for TUI launcher operations
59
53
  **Key Functions**:
60
54
  - `gwr_info()`, `gwr_success()`, `gwr_warn()`, `gwr_error()` - Colored logging functions
61
- - Provides consistent output formatting across gwr system
55
+ - Provides consistent output formatting across the TUI launcher system
62
56
 
63
57
  ### gwr_git.sh
64
58
  **Purpose**: Git repository validation and setup
65
- **Usage**: Ensures gwr runs in valid git repositories
59
+ **Usage**: Ensures orchestra runs in valid git repositories
66
60
  **Key Functions**:
67
61
  - `gwr_check_git_repo()` - Validates git repository presence
68
62
  - Provides error messages and guidance for git setup
69
63
 
70
- ### gwr_bridge.sh
71
- **Purpose**: Bridge script validation and setup
72
- **Usage**: Ensures gw-bridge.sh is available and executable
64
+ ### gwr_services.sh
65
+ **Purpose**: Services script validation and setup
66
+ **Usage**: Ensures services.sh is available and executable
73
67
  **Key Functions**:
74
- - `gwr_check_bridge_script()` - Validates bridge script presence
68
+ - `gwr_check_services_script()` - Validates services script presence
75
69
  - Critical for Rust TUI communication with bash APIs
76
70
 
77
71
  ### gwr_binary.sh
78
72
  **Purpose**: Binary discovery and validation for Rust TUI
79
- **Usage**: Finds and validates gw-tui binary location
73
+ **Usage**: Finds and validates tui binary location
80
74
  **Key Functions**:
81
- - `gwr_find_binary()` - Searches for gw-tui binary in multiple locations
75
+ - `gwr_find_binary()` - Searches for tui binary in multiple locations
82
76
  - Supports development, release, and installed binary locations
83
77
  - Handles GW_TUI_BIN environment variable override
84
78
 
@@ -90,51 +84,44 @@ shell/
90
84
  - Provides terminal compatibility and environment setup
91
85
 
92
86
  ### gwr_usage.sh
93
- **Purpose**: Help and usage information for gwr command
87
+ **Purpose**: Help and usage information for the orchestra command
94
88
  **Usage**: Displays comprehensive help text
95
89
  **Key Functions**:
96
90
  - `gwr_show_usage()` - Shows command-line options and navigation help
97
91
  - Includes keyboard shortcuts, examples, and requirements
98
92
 
99
- ## CLI System Files (gw_*)
93
+ ## CLI System Files (cli_*)
100
94
 
101
- ### gw_load.sh
102
- **Purpose**: Main loader for the gw (CLI) system
103
- **Usage**: Sourced by gw.sh to load CLI-specific components
95
+ ### cli_load.sh
96
+ **Purpose**: Main loader for the orchestra-cli system
97
+ **Usage**: Sourced by orchestra-cli.sh to load CLI-specific components
104
98
  **Key Functions**:
105
- - Loads all gw-specific modules in correct order
106
- - Provides `gw_load_core()` function
107
- **Dependencies**: All gw_*.sh files in shell/
99
+ - Loads all CLI-specific modules in correct order
100
+ - Provides `cli_load_core()` function
101
+ **Dependencies**: CLI helper files in shell/
108
102
 
109
- ### gw_colors.sh, gw_logging.sh, gw_git.sh, gw_worktree.sh, gw_usage.sh
110
- **Purpose**: CLI equivalents of gwr modules
103
+ ### cli_info.sh, cli_err.sh, cli_debug.sh, cli_have_cmd.sh
104
+ **Purpose**: CLI equivalents of TUI launcher modules
111
105
  **Usage**: Provide CLI-specific implementations of core functionality
112
106
  **Key Differences**: Optimized for command-line usage rather than TUI interaction
113
107
 
114
108
  ## Shared System Files
115
109
 
116
- ### gw_env_copy.sh
117
- **Purpose**: Rust env copy helper for CLI and bridge flows
118
- **Usage**: Locates and invokes the `gw-env-copy` binary
110
+ ### env_copy.sh
111
+ **Purpose**: Rust env copy helper for CLI and services flows
112
+ **Usage**: Locates and invokes the `env-copy` binary
119
113
  **Key Functions**:
120
- - `gw_env_copy_bin()` - Resolve the env copy binary path
121
- - `gw_env_copy_files()` - Execute env copy with repo config
122
-
123
- ### commands.sh
124
- **Purpose**: Shared command utilities
125
- **Usage**: Common command-line operations used across systems
126
- **Key Functions**:
127
- - `have_command()` - Command availability checking
128
- - Shared utility functions for both gwr and gw systems
114
+ - `env_copy_bin()` - Resolve the env copy binary path
115
+ - `env_copy_files()` - Execute env copy with repo config
129
116
 
130
117
  ## Build System (build/)
131
118
 
132
- ### build_load.sh
119
+ ### load.sh
133
120
  **Purpose**: Loader for build system components
134
121
  **Usage**: Loads all build-related modules
135
- **Key Functions**: `build_load_core()` - Loads build system modules
122
+ **Key Functions**: `load_core()` - Loads build system modules
136
123
 
137
- ### build_rust.sh
124
+ ### rust.sh
138
125
  **Purpose**: Rust compilation and binary management
139
126
  **Usage**: Handles Rust TUI compilation and installation
140
127
  **Key Functions**:
@@ -142,14 +129,14 @@ shell/
142
129
  - Binary installation and management
143
130
  - Cross-platform binary handling
144
131
 
145
- ### build_bridge.sh, build_dependencies.sh, build_install.sh, build_logging.sh, build_usage.sh
132
+ ### services.sh, dependencies.sh, install.sh, logging.sh, usage.sh
146
133
  **Purpose**: Specialized build system components
147
134
  **Usage**: Handle specific aspects of the build process
148
135
  **Key Functions**: Each focuses on a specific build operation
149
136
 
150
137
  ## Rust Env Copy
151
138
 
152
- Environment file copying is implemented in Rust via the `gw-env-copy` binary.
139
+ Environment file copying is implemented in Rust via the `env-copy` binary.
153
140
  Shell wrappers invoke the binary and read `.orchestra/options.json` for
154
141
  `copy_locations` when needed.
155
142
 
@@ -160,7 +147,7 @@ Shell wrappers invoke the binary and read `.orchestra/options.json` for
160
147
  **Usage**: Creates descriptive titles for worktree-based tmux sessions
161
148
  **Key Functions**: `gwr_worktree_title()` - Generates formatted worktree titles
162
149
 
163
- ## Update System (gwr/)
150
+ ## Update System (shell/gwr/)
164
151
 
165
152
  ### check-updates.sh
166
153
  **Purpose**: Update checking functionality
@@ -173,24 +160,26 @@ Shell wrappers invoke the binary and read `.orchestra/options.json` for
173
160
 
174
161
  ## Integration Points
175
162
 
176
- ### gwr.sh Integration
177
- - Sources `gwr_load.sh` to load all gwr components
163
+ ### orchestra.sh Integration
164
+ - Sources `gwr_load.sh` to load all TUI launcher components
178
165
  - Uses `--check-updates` flag to trigger update checking
179
- - Passes bridge path to Rust TUI binary
166
+ - Passes services path to Rust TUI binary
180
167
 
181
- ### gw.sh Integration
182
- - Sources `gw_load.sh` to load all gw components
183
- - Uses `gw_env_copy.sh` to invoke the Rust env copy binary
168
+ ### orchestra-cli.sh Integration
169
+ - Sources `cli_load.sh` to load all CLI components
170
+ - Uses `env_copy.sh` to invoke the Rust env copy binary
184
171
  - Provides CLI interface to same underlying functionality
185
172
 
186
- ### Bridge System Integration
187
- - `gwr_bridge.sh` validates bridge script availability
188
- - Bridge script enables Rust TUI to communicate with bash APIs
173
+ ### Services System Integration
174
+ - `gwr_services.sh` validates services script availability
175
+ - Root `services.sh` delegates to `server/services/dispatch.sh`
176
+ - Server services modules live under `server/services/`; keep shell modules focused on CLI/TUI launchers and shared command helpers.
177
+ - Services script enables Rust TUI to communicate with bash APIs
189
178
  - Critical for the hybrid Rust/bash architecture
190
179
 
191
180
  ## Key Architectural Patterns
192
181
 
193
- 1. **Modular Loading**: Each system (gwr/gw) has its own loader that sources components in dependency order
182
+ 1. **Modular Loading**: The TUI and CLI systems each have a loader that sources components in dependency order
194
183
  2. **Color Consistency**: Separate color files ensure consistent theming across components
195
184
  3. **Logging Standardization**: Standardized logging functions provide consistent output
196
185
  4. **Environment Isolation**: Rust env copy binary handles .env file replication across worktrees
@@ -199,7 +188,7 @@ Shell wrappers invoke the binary and read `.orchestra/options.json` for
199
188
 
200
189
  ## Usage Examples for AI Agents
201
190
 
202
- ### Adding New gwr Functionality
191
+ ### Adding New TUI Launcher Functionality
203
192
  1. Create new function in appropriate module (e.g., `gwr_new_feature.sh`)
204
193
  2. Add to `gwr_load.sh` loading sequence
205
194
  3. Update `gwr_usage.sh` if adding user-facing features
@@ -213,8 +202,8 @@ Shell wrappers invoke the binary and read `.orchestra/options.json` for
213
202
 
214
203
  ### Adding Build System Features
215
204
  1. Create new module in `shell/build/`
216
- 2. Add to `build_load.sh` if needed
205
+ 2. Add to `load.sh` if needed
217
206
  3. Follow existing build system patterns
218
- 4. Update `build_usage.sh` for new build options
207
+ 4. Update `usage.sh` for new build options
219
208
 
220
209
  This documentation provides the foundation for AI agents to understand and work effectively with the Orchestrator shell system.
@@ -0,0 +1,33 @@
1
+ # shellcheck shell=bash
2
+
3
+ check_dependencies() {
4
+ info "Checking dependencies..."
5
+
6
+ if ! command -v cargo >/dev/null 2>&1; then
7
+ error "Rust/Cargo not found. Please install Rust: https://rustup.rs/"
8
+ exit 1
9
+ fi
10
+
11
+ if ! command -v cc >/dev/null 2>&1 && \
12
+ ! command -v clang >/dev/null 2>&1 && \
13
+ ! command -v gcc >/dev/null 2>&1; then
14
+ error "C compiler not found. Bundled SQLite requires a native C toolchain."
15
+ error " macOS: xcode-select --install"
16
+ error " Ubuntu/Debian: sudo apt install build-essential"
17
+ error " RHEL/CentOS: sudo yum groupinstall 'Development Tools'"
18
+ exit 1
19
+ fi
20
+
21
+ if ! command -v jq >/dev/null 2>&1; then
22
+ warn "jq not found. Installing via package manager is recommended."
23
+ warn " macOS: brew install jq"
24
+ warn " Ubuntu/Debian: sudo apt install jq"
25
+ warn " RHEL/CentOS: sudo yum install jq"
26
+ fi
27
+
28
+ if ! command -v tty >/dev/null 2>&1; then
29
+ warn "tty command not found. Terminal title updates will be skipped."
30
+ fi
31
+
32
+ success "Dependencies check passed"
33
+ }
@@ -0,0 +1,7 @@
1
+ # shellcheck shell=bash
2
+
3
+ install_global() {
4
+ info "Installing tui globally..."
5
+ ( cd "$SCRIPT_DIR/tui" && cargo install --path . )
6
+ success "tui installed globally"
7
+ }
@@ -0,0 +1,10 @@
1
+ # shellcheck shell=bash
2
+
3
+ load() {
4
+ source "$SCRIPT_DIR/shell/build/logging.sh"
5
+ source "$SCRIPT_DIR/shell/build/dependencies.sh"
6
+ source "$SCRIPT_DIR/shell/build/rust.sh"
7
+ source "$SCRIPT_DIR/shell/build/services.sh"
8
+ source "$SCRIPT_DIR/shell/build/install.sh"
9
+ source "$SCRIPT_DIR/shell/build/usage.sh"
10
+ }
@@ -0,0 +1,6 @@
1
+ # shellcheck shell=bash
2
+
3
+ info() { printf "${BLUE:-}[INFO]${NC:-} %s\n" "$*"; }
4
+ success() { printf "${GREEN:-}[SUCCESS]${NC:-} %s\n" "$*"; }
5
+ warn() { printf "${YELLOW:-}[WARN]${NC:-} %s\n" "$*"; }
6
+ error() { printf "${RED:-}[ERROR]${NC:-} %s\n" "$*"; }
@@ -0,0 +1,18 @@
1
+ # shellcheck shell=bash
2
+
3
+ rust_tui() {
4
+ local build_type="${1:-release}"
5
+
6
+ info "Building tui (${build_type})..."
7
+
8
+ ( cd "$SCRIPT_DIR/tui" && {
9
+ if [[ "$build_type" == "release" ]]; then
10
+ cargo build --release
11
+ success "Built tui in release mode: ./tui/target/release/tui"
12
+ else
13
+ cargo build
14
+ success "Built tui in debug mode: ./tui/target/debug/tui"
15
+ fi
16
+ }
17
+ )
18
+ }
@@ -0,0 +1,17 @@
1
+ # shellcheck shell=bash
2
+
3
+ test_services() {
4
+ info "Testing services.sh..."
5
+
6
+ if [[ ! -x "$SCRIPT_DIR/services.sh" ]]; then
7
+ error "services.sh not found or not executable"
8
+ exit 1
9
+ fi
10
+
11
+ if "$SCRIPT_DIR/services.sh" help >/dev/null 2>&1; then
12
+ success "services.sh basic test passed"
13
+ else
14
+ error "services.sh test failed"
15
+ exit 1
16
+ fi
17
+ }
@@ -1,14 +1,14 @@
1
1
  # shellcheck shell=bash
2
2
 
3
- build_usage() {
3
+ usage() {
4
4
  cat << EOF
5
5
  Usage: $0 [options]
6
6
 
7
- Build script for gw.sh and gw-tui components.
7
+ Build script for orchestra-cli.sh and tui components.
8
8
 
9
9
  Options:
10
10
  -d, --debug Build in debug mode (default: release)
11
- -i, --install Install gw-tui globally after building
11
+ -i, --install Install tui globally after building
12
12
  -t, --test-only Only run tests, don't build
13
13
  -h, --help Show this help
14
14
 
@@ -19,9 +19,9 @@ Examples:
19
19
  $0 --test-only # Just run tests
20
20
 
21
21
  The built binary will be available at:
22
- - Release: ./gw-tui/target/release/gw-tui
23
- - Debug: ./gw-tui/target/debug/gw-tui
22
+ - Release: ./tui/target/release/tui
23
+ - Debug: ./tui/target/debug/tui
24
24
 
25
- The gw.sh script will automatically detect and use the built binary.
25
+ The orchestra-cli.sh script will automatically detect and use the built binary.
26
26
  EOF
27
27
  }
@@ -0,0 +1,9 @@
1
+ # shellcheck shell=bash
2
+
3
+ cli_load_core() {
4
+ source "$SCRIPT_DIR/shell/cli_err.sh"
5
+ source "$SCRIPT_DIR/shell/cli_info.sh"
6
+ source "$SCRIPT_DIR/shell/cli_debug.sh"
7
+ source "$SCRIPT_DIR/shell/cli_have_cmd.sh"
8
+ source "$SCRIPT_DIR/shell/env_copy.sh"
9
+ }
@@ -1,6 +1,6 @@
1
1
  # shellcheck shell=bash
2
2
 
3
- gw_env_copy_bin() {
3
+ env_copy_bin() {
4
4
  local candidate=""
5
5
 
6
6
  if [[ -n "${GW_ENV_COPY_BIN:-}" && -x "$GW_ENV_COPY_BIN" ]]; then
@@ -9,17 +9,17 @@ gw_env_copy_bin() {
9
9
  fi
10
10
 
11
11
  if [[ -n "${SCRIPT_DIR:-}" ]]; then
12
- candidate="$SCRIPT_DIR/gw-env-copy"
12
+ candidate="$SCRIPT_DIR/env-copy"
13
13
  if [[ -x "$candidate" ]]; then
14
14
  printf '%s\n' "$candidate"
15
15
  return 0
16
16
  fi
17
- candidate="$SCRIPT_DIR/gw-tui/target/release/gw-env-copy"
17
+ candidate="$SCRIPT_DIR/tui/target/release/env-copy"
18
18
  if [[ -x "$candidate" ]]; then
19
19
  printf '%s\n' "$candidate"
20
20
  return 0
21
21
  fi
22
- candidate="$SCRIPT_DIR/gw-tui/target/debug/gw-env-copy"
22
+ candidate="$SCRIPT_DIR/tui/target/debug/env-copy"
23
23
  if [[ -x "$candidate" ]]; then
24
24
  printf '%s\n' "$candidate"
25
25
  return 0
@@ -27,32 +27,32 @@ gw_env_copy_bin() {
27
27
  fi
28
28
 
29
29
  if [[ -n "${GW_ORCHESTRATOR_ROOT:-}" ]]; then
30
- candidate="$GW_ORCHESTRATOR_ROOT/gw-env-copy"
30
+ candidate="$GW_ORCHESTRATOR_ROOT/env-copy"
31
31
  if [[ -x "$candidate" ]]; then
32
32
  printf '%s\n' "$candidate"
33
33
  return 0
34
34
  fi
35
35
  fi
36
36
 
37
- if command -v gw-env-copy >/dev/null 2>&1; then
38
- command -v gw-env-copy
37
+ if command -v env-copy >/dev/null 2>&1; then
38
+ command -v env-copy
39
39
  return 0
40
40
  fi
41
41
 
42
42
  return 1
43
43
  }
44
44
 
45
- gw_env_copy_files() {
45
+ env_copy_files() {
46
46
  local source_root="$1"
47
47
  local target_root="$2"
48
48
  local repo_root="${3:-$source_root}"
49
49
 
50
50
  local bin
51
- if ! bin="$(gw_env_copy_bin)"; then
51
+ if ! bin="$(env_copy_bin)"; then
52
52
  if declare -f err >/dev/null 2>&1; then
53
- err "gw-env-copy binary not found"
53
+ err "env-copy binary not found"
54
54
  else
55
- printf 'Error: %s\n' "gw-env-copy binary not found" >&2
55
+ printf 'Error: %s\n' "env-copy binary not found" >&2
56
56
  fi
57
57
  return 1
58
58
  fi
@@ -4,7 +4,7 @@ cmd_copy_env() {
4
4
  local target_branch="${1-}"
5
5
  if [[ -z "$target_branch" ]]; then
6
6
  err "Target worktree name required"
7
- echo "Usage: gw copy-env <worktreename>"
7
+ echo "Usage: orchestra-cli copy-env <worktreename>"
8
8
  return 1
9
9
  fi
10
10
 
@@ -24,6 +24,6 @@ cmd_copy_env() {
24
24
  [[ -z "$shared_root" ]] && shared_root="$root"
25
25
 
26
26
  info "Copying env files from '$root' -> '$target_path'"
27
- gw_env_copy_files "$root" "$target_path" "$shared_root"
27
+ env_copy_files "$root" "$target_path" "$shared_root"
28
28
  info "Env files synced to '$target_branch'"
29
29
  }
@@ -9,12 +9,12 @@ cmd_checkout_worktree() {
9
9
  local source_root="$root"
10
10
 
11
11
  if [[ "${1-}" == "-b" ]]; then
12
- [[ -z "${2-}" ]] && { err "Branch name required for -b"; echo "Usage: gw checkout -b <branch>"; return 1; }
12
+ [[ -z "${2-}" ]] && { err "Branch name required for -b"; echo "Usage: orchestra-cli checkout -b <branch>"; return 1; }
13
13
  create_new=true
14
14
  branch_name="$2"
15
15
  [[ "$#" -gt 2 ]] && { err "Too many args"; return 1; }
16
16
  else
17
- [[ -z "${1-}" ]] && { err "Branch name required"; echo "Usage: gw checkout <branch>"; return 1; }
17
+ [[ -z "${1-}" ]] && { err "Branch name required"; echo "Usage: orchestra-cli checkout <branch>"; return 1; }
18
18
  branch_name="$1"
19
19
  [[ "$#" -gt 1 ]] && { err "Too many args"; return 1; }
20
20
  fi
@@ -30,7 +30,7 @@ cmd_checkout_worktree() {
30
30
  # Create worktree for existing branch
31
31
  info "🌳 Creating worktree for existing branch '$branch_name'..."
32
32
  wt="$(git_ensure_worktree_for_branch "$branch_name")"
33
- gw_env_copy_files "$source_root" "$wt" "$shared_root"
33
+ env_copy_files "$source_root" "$wt" "$shared_root"
34
34
  echo "cd \"$wt\""
35
35
  fi
36
36
  return 0
@@ -57,7 +57,7 @@ cmd_checkout_worktree() {
57
57
  if git_branch_exists "$branch_name"; then
58
58
  info "🌳 Creating worktree for existing branch '$branch_name'..."
59
59
  wt="$(git_ensure_worktree_for_branch "$branch_name")"
60
- gw_env_copy_files "$source_root" "$wt" "$shared_root"
60
+ env_copy_files "$source_root" "$wt" "$shared_root"
61
61
  echo "cd \"$wt\""
62
62
  return 0
63
63
  else
@@ -3,7 +3,7 @@
3
3
  cmd_create_worktree() {
4
4
  if [ -z "${1-}" ]; then
5
5
  err "Branch name required"
6
- echo "Usage: gw create <branch>"
6
+ echo "Usage: orchestra-cli create <branch>"
7
7
  return 1
8
8
  fi
9
9
  local branch_name="$1"
@@ -16,7 +16,7 @@ cmd_create_worktree() {
16
16
 
17
17
  info "🌳 Creating branch '$branch_name' and worktree at '$dir'..."
18
18
  dir="$(git_create_branch_and_worktree "$branch_name")"
19
- gw_env_copy_files "$source_root" "$dir" "$shared_root"
19
+ env_copy_files "$source_root" "$dir" "$shared_root"
20
20
  info "✅ Success! Worktree created at '$dir'."
21
21
  echo "cd \"$dir\""
22
22
  (cd "$dir" && git_status_short)
@@ -3,7 +3,7 @@
3
3
  cmd_delete_worktree() {
4
4
  if [ -z "${1-}" ]; then
5
5
  err "Branch name required"
6
- echo "Usage: gw delete <branch>"
6
+ echo "Usage: orchestra-cli delete <branch>"
7
7
  return 1
8
8
  fi
9
9
  local branch_name="$1"
@@ -2,7 +2,7 @@
2
2
 
3
3
  # shellcheck shell=bash
4
4
 
5
- # Master file that sources all individual bridge functions for merge operations
5
+ # Master file that sources all individual services functions for merge operations
6
6
  # This maintains the same interface while using modular files
7
7
 
8
8
  # Source individual merge functions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # shellcheck shell=bash
4
4
 
5
- # Master file that sources all individual bridge functions for repository operations
5
+ # Master file that sources all individual services functions for repository operations
6
6
  # This maintains the same interface while using modular files
7
7
 
8
8
  # Source individual repo functions
@@ -2,7 +2,7 @@
2
2
 
3
3
  # shellcheck shell=bash
4
4
 
5
- # Master file that sources all individual bridge functions for worktree operations
5
+ # Master file that sources all individual services functions for worktree operations
6
6
  # This maintains the same interface while using modular files
7
7
 
8
8
  # Source individual worktree functions
@@ -72,7 +72,7 @@ detect_installation_method() {
72
72
  fi
73
73
 
74
74
  # Check if running from local development
75
- if [[ -f "$(dirname "${BASH_SOURCE[0]}")/../../../gw-tui/Cargo.toml" ]]; then
75
+ if [[ -f "$(dirname "${BASH_SOURCE[0]}")/../../../tui/Cargo.toml" ]]; then
76
76
  method="local"
77
77
  fi
78
78
 
@@ -8,10 +8,10 @@ gwr_find_binary() {
8
8
 
9
9
  local binary_paths=(
10
10
  "$SCRIPT_DIR/orchestra"
11
- "$SCRIPT_DIR/gw-tui"
12
- "$SCRIPT_DIR/gw-tui/target/release/gw-tui"
13
- "$SCRIPT_DIR/gw-tui/target/debug/gw-tui"
14
- "$(command -v gw-tui 2>/dev/null || true)"
11
+ "$SCRIPT_DIR/tui"
12
+ "$SCRIPT_DIR/tui/target/release/tui"
13
+ "$SCRIPT_DIR/tui/target/debug/tui"
14
+ "$(command -v tui 2>/dev/null || true)"
15
15
  )
16
16
 
17
17
  for path in "${binary_paths[@]}"; do
@@ -4,7 +4,7 @@ gwr_load_core() {
4
4
  source "$SCRIPT_DIR/shell/gwr_colors.sh"
5
5
  source "$SCRIPT_DIR/shell/gwr_logging.sh"
6
6
  source "$SCRIPT_DIR/shell/gwr_git.sh"
7
- source "$SCRIPT_DIR/shell/gwr_bridge.sh"
7
+ source "$SCRIPT_DIR/shell/gwr_services.sh"
8
8
  source "$SCRIPT_DIR/shell/gwr_binary.sh"
9
9
  source "$SCRIPT_DIR/shell/git/gwr_worktree_title.sh"
10
10
  source "$SCRIPT_DIR/shell/gwr_terminal.sh"
@@ -0,0 +1,10 @@
1
+ # shellcheck shell=bash
2
+
3
+ gwr_check_services_script() {
4
+ local services_path="$SCRIPT_DIR/services.sh"
5
+ if [[ ! -x "$services_path" ]]; then
6
+ gwr_error "services.sh not found or not executable at: $services_path"
7
+ gwr_error "Please ensure the services script exists and is executable."
8
+ exit 1
9
+ fi
10
+ }