@humanu/orchestra 0.5.76 → 0.5.78
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/bin/{gw.js → orchestra-cli.js} +1 -1
- package/bin/orchestra.js +2 -2
- package/install.js +41 -42
- package/package.json +2 -3
- package/resources/api/git.sh +4 -444
- package/resources/api/tmux.sh +4 -2791
- package/resources/prebuilt/linux-x64/{gw-env-copy → env-copy} +0 -0
- package/resources/prebuilt/linux-x64/orchestra +0 -0
- package/resources/prebuilt/macos-arm64/{gw-env-copy → env-copy} +0 -0
- package/resources/prebuilt/macos-arm64/orchestra +0 -0
- package/resources/prebuilt/macos-intel/{gw-env-copy → env-copy} +0 -0
- package/resources/prebuilt/macos-intel/orchestra +0 -0
- package/resources/scripts/{gw.sh → orchestra-cli.sh} +14 -14
- package/resources/scripts/orchestra-local.sh +6 -6
- package/resources/scripts/{gwr.sh → orchestra.sh} +11 -55
- package/resources/scripts/{shell/bridge → server/services}/ai.sh +4 -4
- package/resources/scripts/{gw-bridge.sh → server/services/dispatch.sh} +62 -59
- package/resources/scripts/server/services/git/api.sh +447 -0
- package/resources/scripts/{shell/git/bridge_check_branch.sh → server/services/git/check_branch_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_create_worktree.sh → server/services/git/create_worktree_api.sh} +3 -3
- package/resources/scripts/{shell/git/bridge_create_worktree_from_existing.sh → server/services/git/create_worktree_from_existing_api.sh} +2 -2
- package/resources/scripts/{shell/git/bridge_create_worktree_from_remote.sh → server/services/git/create_worktree_from_remote_api.sh} +2 -2
- package/resources/scripts/{shell/git/bridge_delete_branch_only.sh → server/services/git/delete_branch_only_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_delete_worktree.sh → server/services/git/delete_worktree_api.sh} +2 -2
- package/resources/scripts/{shell/git/bridge_delete_worktree_only.sh → server/services/git/delete_worktree_only_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_enhanced_git_status.sh → server/services/git/enhanced_git_status_api.sh} +3 -3
- package/resources/scripts/{shell/git/bridge_git_status.sh → server/services/git/git_status_api.sh} +2 -2
- package/resources/scripts/{shell/git/bridge_list_worktrees.sh → server/services/git/list_worktrees_api.sh} +2 -2
- package/resources/scripts/server/services/git/merge_api.sh +12 -0
- package/resources/scripts/{shell/git/bridge_merge_from_primary.sh → server/services/git/merge_from_primary_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_merge_into_primary.sh → server/services/git/merge_into_primary_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_primary_branch.sh → server/services/git/primary_branch_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_rebase_from_primary.sh → server/services/git/rebase_from_primary_api.sh} +1 -1
- package/resources/scripts/server/services/git/repo_api.sh +12 -0
- package/resources/scripts/{shell/git/bridge_repo_info.sh → server/services/git/repo_info_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_squash_into_primary.sh → server/services/git/squash_into_primary_api.sh} +1 -1
- package/resources/scripts/{shell/git/bridge_switch_worktree.sh → server/services/git/switch_worktree_api.sh} +2 -2
- package/resources/scripts/server/services/git/worktree_api.sh +17 -0
- package/resources/scripts/{shell/bridge/utils.sh → server/services/json.sh} +23 -23
- package/resources/scripts/{shell/bridge → server/services/session}/tmux.sh +14 -14
- package/resources/scripts/server/session/tmux_api.sh +2806 -0
- package/resources/scripts/services.sh +6 -0
- package/resources/scripts/shell/AGENTS.md +63 -74
- package/resources/scripts/shell/build/dependencies.sh +33 -0
- package/resources/scripts/shell/build/install.sh +7 -0
- package/resources/scripts/shell/build/load.sh +10 -0
- package/resources/scripts/shell/build/logging.sh +6 -0
- package/resources/scripts/shell/build/rust.sh +18 -0
- package/resources/scripts/shell/build/services.sh +17 -0
- package/resources/scripts/shell/build/{build_usage.sh → usage.sh} +6 -6
- package/resources/scripts/shell/cli_load.sh +9 -0
- package/resources/scripts/shell/{gw_env_copy.sh → env_copy.sh} +11 -11
- package/resources/scripts/shell/env_copy_command.sh +2 -2
- package/resources/scripts/shell/git/checkout_worktree.sh +4 -4
- package/resources/scripts/shell/git/create_worktree.sh +2 -2
- package/resources/scripts/shell/git/delete_worktree.sh +1 -1
- package/resources/scripts/shell/git/merge.sh +1 -1
- package/resources/scripts/shell/git/repo.sh +1 -1
- package/resources/scripts/shell/git/worktree.sh +1 -1
- package/resources/scripts/shell/gwr/check-updates.sh +1 -1
- package/resources/scripts/shell/gwr_binary.sh +4 -4
- package/resources/scripts/shell/gwr_load.sh +1 -1
- package/resources/scripts/shell/gwr_services.sh +10 -0
- package/resources/scripts/shell/gwr_usage.sh +10 -10
- package/resources/scripts/shell/orchestra-command-hook.sh +15 -15
- package/resources/scripts/shell/orchestra-local.sh +6 -6
- package/resources/scripts/shell/tmux/new_session_command.sh +1 -1
- package/bin/gwr.js +0 -10
- package/resources/scripts/shell/build/build_bridge.sh +0 -17
- package/resources/scripts/shell/build/build_dependencies.sh +0 -33
- package/resources/scripts/shell/build/build_install.sh +0 -7
- package/resources/scripts/shell/build/build_load.sh +0 -10
- package/resources/scripts/shell/build/build_logging.sh +0 -6
- package/resources/scripts/shell/build/build_rust.sh +0 -18
- package/resources/scripts/shell/git/bridge_merge.sh +0 -12
- package/resources/scripts/shell/git/bridge_repo.sh +0 -12
- package/resources/scripts/shell/git/bridge_worktree.sh +0 -17
- package/resources/scripts/shell/gw_legacy_wrappers.sh +0 -7
- package/resources/scripts/shell/gw_load.sh +0 -10
- package/resources/scripts/shell/gwr_bridge.sh +0 -10
- /package/resources/scripts/shell/{gw_debug.sh → cli_debug.sh} +0 -0
- /package/resources/scripts/shell/{gw_err.sh → cli_err.sh} +0 -0
- /package/resources/scripts/shell/{gw_have_cmd.sh → cli_have_cmd.sh} +0 -0
- /package/resources/scripts/shell/{gw_info.sh → cli_info.sh} +0 -0
|
@@ -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
|
|
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
|
-
├──
|
|
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
|
|
17
|
-
├──
|
|
18
|
-
├──
|
|
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
|
-
│ ├──
|
|
27
|
-
│ ├──
|
|
28
|
-
│ ├──
|
|
29
|
-
│ ├──
|
|
30
|
-
│ ├──
|
|
31
|
-
│ ├──
|
|
32
|
-
│ └──
|
|
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/ #
|
|
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
|
|
43
|
-
**Usage**: Sourced by
|
|
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
|
|
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
|
|
51
|
-
**Usage**: Provides consistent color scheme across
|
|
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
|
|
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
|
|
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
|
|
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
|
-
###
|
|
71
|
-
**Purpose**:
|
|
72
|
-
**Usage**: Ensures
|
|
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
|
-
- `
|
|
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
|
|
73
|
+
**Usage**: Finds and validates tui binary location
|
|
80
74
|
**Key Functions**:
|
|
81
|
-
- `gwr_find_binary()` - Searches for
|
|
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
|
|
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 (
|
|
93
|
+
## CLI System Files (cli_*)
|
|
100
94
|
|
|
101
|
-
###
|
|
102
|
-
**Purpose**: Main loader for the
|
|
103
|
-
**Usage**: Sourced by
|
|
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
|
|
106
|
-
- Provides `
|
|
107
|
-
**Dependencies**:
|
|
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
|
-
###
|
|
110
|
-
**Purpose**: CLI equivalents of
|
|
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
|
-
###
|
|
117
|
-
**Purpose**: Rust env copy helper for CLI and
|
|
118
|
-
**Usage**: Locates and invokes the `
|
|
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
|
-
- `
|
|
121
|
-
- `
|
|
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
|
-
###
|
|
119
|
+
### load.sh
|
|
133
120
|
**Purpose**: Loader for build system components
|
|
134
121
|
**Usage**: Loads all build-related modules
|
|
135
|
-
**Key Functions**: `
|
|
122
|
+
**Key Functions**: `load_core()` - Loads build system modules
|
|
136
123
|
|
|
137
|
-
###
|
|
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
|
-
###
|
|
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 `
|
|
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
|
-
###
|
|
177
|
-
- Sources `gwr_load.sh` to load all
|
|
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
|
|
166
|
+
- Passes services path to Rust TUI binary
|
|
180
167
|
|
|
181
|
-
###
|
|
182
|
-
- Sources `
|
|
183
|
-
- Uses `
|
|
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
|
-
###
|
|
187
|
-
- `
|
|
188
|
-
-
|
|
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**:
|
|
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
|
|
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 `
|
|
205
|
+
2. Add to `load.sh` if needed
|
|
217
206
|
3. Follow existing build system patterns
|
|
218
|
-
4. Update `
|
|
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,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,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
|
-
|
|
3
|
+
usage() {
|
|
4
4
|
cat << EOF
|
|
5
5
|
Usage: $0 [options]
|
|
6
6
|
|
|
7
|
-
Build script for
|
|
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
|
|
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: ./
|
|
23
|
-
- Debug: ./
|
|
22
|
+
- Release: ./tui/target/release/tui
|
|
23
|
+
- Debug: ./tui/target/debug/tui
|
|
24
24
|
|
|
25
|
-
The
|
|
25
|
+
The orchestra-cli.sh script will automatically detect and use the built binary.
|
|
26
26
|
EOF
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# shellcheck shell=bash
|
|
2
2
|
|
|
3
|
-
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
38
|
-
command -v
|
|
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
|
-
|
|
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="$(
|
|
51
|
+
if ! bin="$(env_copy_bin)"; then
|
|
52
52
|
if declare -f err >/dev/null 2>&1; then
|
|
53
|
-
err "
|
|
53
|
+
err "env-copy binary not found"
|
|
54
54
|
else
|
|
55
|
-
printf 'Error: %s\n' "
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
|
-
# Master file that sources all individual
|
|
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
|
|
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
|
|
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]}")/../../../
|
|
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/
|
|
12
|
-
"$SCRIPT_DIR/
|
|
13
|
-
"$SCRIPT_DIR/
|
|
14
|
-
"$(command -v
|
|
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/
|
|
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
|
+
}
|