@humanu/orchestra 0.5.29 โ†’ 0.5.31

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 (78) hide show
  1. package/install.js +27 -3
  2. package/package.json +1 -1
  3. package/resources/prebuilt/linux-x64/orchestra +0 -0
  4. package/resources/prebuilt/macos-arm64/orchestra +0 -0
  5. package/resources/prebuilt/macos-intel/orchestra +0 -0
  6. package/resources/scripts/gw-bridge.sh +50 -1024
  7. package/resources/scripts/gw.sh +25 -19
  8. package/resources/scripts/gwr.sh +41 -139
  9. package/resources/scripts/shell/bridge/ai.sh +175 -0
  10. package/resources/scripts/shell/bridge/copy_env.sh +84 -0
  11. package/resources/scripts/shell/bridge/tmux.sh +162 -0
  12. package/resources/scripts/shell/bridge/utils.sh +449 -0
  13. package/resources/scripts/shell/build/build_bridge.sh +17 -0
  14. package/resources/scripts/shell/build/build_dependencies.sh +23 -0
  15. package/resources/scripts/shell/build/build_install.sh +7 -0
  16. package/resources/scripts/shell/build/build_load.sh +10 -0
  17. package/resources/scripts/shell/build/build_logging.sh +6 -0
  18. package/resources/scripts/shell/build/build_rust.sh +18 -0
  19. package/resources/scripts/shell/build/build_usage.sh +27 -0
  20. package/resources/scripts/shell/env/copy_env_command.sh +27 -0
  21. package/resources/scripts/shell/env/copy_env_constants.sh +3 -0
  22. package/resources/scripts/shell/env/copy_env_core.sh +171 -0
  23. package/resources/scripts/shell/env/copy_env_debug_parse.sh +14 -0
  24. package/resources/scripts/shell/env/copy_env_load.sh +9 -0
  25. package/resources/scripts/shell/env/copy_env_locations.sh +34 -0
  26. package/resources/scripts/shell/env/copy_env_logging.sh +17 -0
  27. package/resources/scripts/shell/env/copy_env_state.sh +5 -0
  28. package/resources/scripts/shell/fix_hanging_colors.sh +9 -0
  29. package/resources/scripts/shell/fix_hanging_load.sh +9 -0
  30. package/resources/scripts/shell/fix_hanging_logging.sh +6 -0
  31. package/resources/scripts/shell/fix_hanging_script.sh +19 -0
  32. package/resources/scripts/shell/fix_hanging_steps.sh +81 -0
  33. package/resources/scripts/shell/git/bridge_check_branch.sh +53 -0
  34. package/resources/scripts/shell/git/bridge_create_worktree.sh +35 -0
  35. package/resources/scripts/shell/git/bridge_create_worktree_from_existing.sh +32 -0
  36. package/resources/scripts/shell/git/bridge_create_worktree_from_remote.sh +28 -0
  37. package/resources/scripts/shell/git/bridge_delete_branch_only.sh +25 -0
  38. package/resources/scripts/shell/git/bridge_delete_worktree.sh +26 -0
  39. package/resources/scripts/shell/git/bridge_delete_worktree_only.sh +28 -0
  40. package/resources/scripts/shell/git/bridge_enhanced_git_status.sh +106 -0
  41. package/resources/scripts/shell/git/bridge_git_status.sh +13 -0
  42. package/resources/scripts/shell/git/bridge_list_worktrees.sh +12 -0
  43. package/resources/scripts/shell/git/bridge_merge.sh +12 -0
  44. package/resources/scripts/shell/git/bridge_merge_from_primary.sh +112 -0
  45. package/resources/scripts/shell/git/bridge_merge_into_primary.sh +116 -0
  46. package/resources/scripts/shell/git/bridge_primary_branch.sh +15 -0
  47. package/resources/scripts/shell/git/bridge_rebase_from_primary.sh +72 -0
  48. package/resources/scripts/shell/git/bridge_repo.sh +12 -0
  49. package/resources/scripts/shell/git/bridge_repo_info.sh +23 -0
  50. package/resources/scripts/shell/git/bridge_squash_into_primary.sh +144 -0
  51. package/resources/scripts/shell/git/bridge_switch_worktree.sh +23 -0
  52. package/resources/scripts/shell/git/bridge_worktree.sh +17 -0
  53. package/resources/scripts/shell/git/checkout_worktree.sh +68 -0
  54. package/resources/scripts/shell/git/create_worktree.sh +23 -0
  55. package/resources/scripts/shell/git/delete_worktree.sh +27 -0
  56. package/resources/scripts/shell/git/gwr_worktree_title.sh +29 -0
  57. package/resources/scripts/shell/git/list_worktrees.sh +22 -0
  58. package/resources/scripts/shell/git/merge.sh +12 -0
  59. package/resources/scripts/shell/git/repo.sh +12 -0
  60. package/resources/scripts/shell/git/status.sh +21 -0
  61. package/resources/scripts/shell/git/worktree.sh +17 -0
  62. package/resources/scripts/shell/gw_debug.sh +3 -0
  63. package/resources/scripts/shell/gw_err.sh +3 -0
  64. package/resources/scripts/shell/gw_have_cmd.sh +3 -0
  65. package/resources/scripts/shell/gw_info.sh +3 -0
  66. package/resources/scripts/shell/gw_legacy_wrappers.sh +7 -0
  67. package/resources/scripts/shell/gw_load.sh +9 -0
  68. package/resources/scripts/shell/gwr_binary.sh +25 -0
  69. package/resources/scripts/shell/gwr_bridge.sh +10 -0
  70. package/resources/scripts/shell/gwr_colors.sh +7 -0
  71. package/resources/scripts/shell/gwr_git.sh +8 -0
  72. package/resources/scripts/shell/gwr_load.sh +12 -0
  73. package/resources/scripts/shell/gwr_logging.sh +6 -0
  74. package/resources/scripts/shell/gwr_terminal.sh +13 -0
  75. package/resources/scripts/shell/gwr_usage.sh +49 -0
  76. package/resources/scripts/shell/orchestra-command-hook.sh +109 -0
  77. package/resources/scripts/shell/orchestra-local.sh +87 -0
  78. package/resources/scripts/commands.sh +0 -208
@@ -1,208 +0,0 @@
1
- #!/bin/bash
2
-
3
- ###############################################################################
4
- # commands.sh โ€“ Pure Git-Worktree command-line operations
5
- # ---------------------------------------------------------------------------
6
- # This script provides pure git worktree management without any tmux functionality.
7
- # It's sourced by gw.sh for command-line operations.
8
- ###############################################################################
9
-
10
- # Ensure we have access to core utilities from gw.sh
11
- if ! declare -f git_repo_root >/dev/null 2>&1; then
12
- echo "Error: commands.sh must be sourced from gw.sh (git.sh API required)" >&2
13
- return 1 2>/dev/null || exit 1
14
- fi
15
-
16
- # Source shared copy helpers
17
- COMMANDS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18
- source "$COMMANDS_DIR/copy_env.sh"
19
-
20
- # --------------------------- Command Functions ------------------------------
21
-
22
- # Create branch + worktree
23
- cmd_create_worktree() {
24
- if [ -z "${1-}" ]; then
25
- err "Branch name required"
26
- echo "Usage: gw create <branch>"
27
- return 1
28
- fi
29
- local branch_name="$1"
30
- local root; root="$(git_require_repo_root)" || return 1
31
- local shared_root; shared_root="$(git_shared_root 2>/dev/null)"
32
- [[ -z "$shared_root" ]] && shared_root="$root"
33
- local source_root="$(git_current_path)"
34
-
35
- local dir; dir="$(git_build_worktree_path "$branch_name")"
36
-
37
- info "๐ŸŒณ Creating branch '$branch_name' and worktree at '$dir'..."
38
- dir="$(git_create_branch_and_worktree "$branch_name")"
39
- copy_env_files "$source_root" "$dir" "$shared_root"
40
- info "โœ… Success! Worktree created at '$dir'."
41
- echo "cd \"$dir\""
42
- (cd "$dir" && git_status_short)
43
- }
44
-
45
- # Delete worktree + branch
46
- cmd_delete_worktree() {
47
- if [ -z "${1-}" ]; then
48
- err "Branch name required"
49
- echo "Usage: gw delete <branch>"
50
- return 1
51
- fi
52
- local branch_name="$1"
53
- git_require_repo || return 1
54
-
55
- local worktree_path; worktree_path="$(git_branch_to_worktree_path "$branch_name")"
56
-
57
- info "๐Ÿ—‘๏ธ Removing worktree and deleting branch '$branch_name'..."
58
-
59
- # Remove worktree if it exists
60
- if [[ -n "$worktree_path" ]] && [[ -d "$worktree_path" ]]; then
61
- git_remove_worktree "$worktree_path"
62
- fi
63
-
64
- # Delete branch if it exists
65
- if git_branch_exists "$branch_name"; then
66
- git_delete_branch "$branch_name"
67
- fi
68
-
69
- info "๐Ÿงน Done."
70
- }
71
-
72
- # List worktrees (pure worktree listing, no tmux sessions)
73
- cmd_list_worktrees() {
74
- local root; root="$(git_require_repo_root)" || return 1
75
-
76
- local here; here="$(git_current_path)"
77
- info "๐ŸŒณ Listing Git Worktrees (repo: $root)"
78
- echo ""
79
- printf ' %-35s %-12s %s\n' "BRANCH" "HEAD" "PATH"
80
- printf ' %s\n' "------------------------------------------------------------------------------------------"
81
-
82
- while IFS=$'\t' read -r path branch sha; do
83
- local rel="$path"
84
- [[ "$path" == "$root" ]] && rel="."
85
- [[ "$path" == "$root"/* ]] && rel="${path#$root/}"
86
- local indicator=" "
87
- [[ "$path" == "$here" ]] && indicator="โ—‰ "
88
- printf '%s๐ŸŒฟ %-35s %-12s %s\n' "$indicator" "$branch" "$sha" "$rel"
89
- done < <(git_list_worktrees)
90
-
91
- printf ' %s\n' "------------------------------------------------------------------------------------------"
92
- }
93
-
94
- # Checkout/switch worktree (pure worktree switching, no tmux)
95
- cmd_checkout_worktree() {
96
- local create_new=false
97
- local branch_name=""
98
- local root; root="$(git_require_repo_root)" || return 1
99
- local shared_root; shared_root="$(git_shared_root 2>/dev/null)"
100
- [[ -z "$shared_root" ]] && shared_root="$root"
101
- local source_root="$(git_current_path)"
102
-
103
- if [[ "${1-}" == "-b" ]]; then
104
- [[ -z "${2-}" ]] && { err "Branch name required for -b"; echo "Usage: gw checkout -b <branch>"; return 1; }
105
- create_new=true
106
- branch_name="$2"
107
- [[ "$#" -gt 2 ]] && { err "Too many args"; return 1; }
108
- else
109
- [[ -z "${1-}" ]] && { err "Branch name required"; echo "Usage: gw checkout <branch>"; return 1; }
110
- branch_name="$1"
111
- [[ "$#" -gt 1 ]] && { err "Too many args"; return 1; }
112
- fi
113
-
114
- if $create_new; then
115
- if git_branch_exists "$branch_name"; then
116
- # Branch exists, ensure worktree exists
117
- local wt; wt="$(git_branch_to_worktree_path "$branch_name")"
118
- if [[ -n "$wt" ]]; then
119
- info "โœ… Worktree exists at '$wt'"
120
- echo "cd \"$wt\""
121
- else
122
- # Create worktree for existing branch
123
- info "๐ŸŒณ Creating worktree for existing branch '$branch_name'..."
124
- wt="$(git_ensure_worktree_for_branch "$branch_name")"
125
- copy_env_files "$source_root" "$wt" "$shared_root"
126
- echo "cd \"$wt\""
127
- fi
128
- return 0
129
- else
130
- # Create new branch and worktree
131
- cmd_create_worktree "$branch_name" || return $?
132
- local wt; wt="$(git_branch_to_worktree_path "$branch_name")"
133
- [[ -n "$wt" ]] && {
134
- echo "cd \"$wt\""
135
- return 0
136
- }
137
- err "Worktree created but not found"
138
- return 1
139
- fi
140
- else
141
- # Switch to existing branch
142
- local wt; wt="$(git_branch_to_worktree_path "$branch_name")"
143
- if [[ -n "$wt" ]]; then
144
- echo "cd \"$wt\""
145
- return 0
146
- fi
147
-
148
- # Try to create worktree for existing branch
149
- if git_branch_exists "$branch_name"; then
150
- info "๐ŸŒณ Creating worktree for existing branch '$branch_name'..."
151
- wt="$(git_ensure_worktree_for_branch "$branch_name")"
152
- copy_env_files "$source_root" "$wt" "$shared_root"
153
- echo "cd \"$wt\""
154
- return 0
155
- else
156
- err "Branch '$branch_name' does not exist"
157
- return 1
158
- fi
159
- fi
160
- }
161
-
162
- # Current worktree status
163
- cmd_status() {
164
- local root; root="$(git_require_repo_root)" || return 1
165
-
166
- local here; here="$(git_current_path)"
167
- local rel="$here"
168
- [[ "$here" == "$root" ]] && rel="."
169
- [[ "$here" == "$root"/* ]] && rel="${here#$root/}"
170
-
171
- local branch; branch="$(git_current_branch)"
172
- if [[ -z "$branch" ]]; then
173
- branch="$(git_current_commit_short)"
174
- [[ -z "$branch" ]] && { err "Cannot determine branch/commit"; return 1; }
175
- info "๐ŸŒณ In worktree '$rel' (Detached HEAD: $branch)"
176
- else
177
- info "๐ŸŒณ In worktree '$rel' on branch '$branch'"
178
- fi
179
- echo ""
180
- git_status "$@"
181
- }
182
-
183
- # Copy env files from current worktree to an existing target worktree
184
- cmd_copy_env() {
185
- local target_branch="${1-}"
186
- if [[ -z "$target_branch" ]]; then
187
- err "Target worktree name required"
188
- echo "Usage: gw copy-env <worktreename>"
189
- return 1
190
- fi
191
-
192
- git_require_repo || return 1
193
-
194
- # Find absolute path of target worktree by branch name
195
- local target_path; target_path="$(git_branch_to_worktree_path "$target_branch")"
196
- if [[ -z "$target_path" ]]; then
197
- err "Worktree for branch '$target_branch' not found"
198
- return 1
199
- fi
200
-
201
- local root; root="$(git_repo_root)"
202
- local shared_root; shared_root="$(git_shared_root 2>/dev/null)"
203
- [[ -z "$shared_root" ]] && shared_root="$root"
204
- local source_root="$root"
205
- info "๐Ÿ”ง Copying env files from '$source_root' -> '$target_path'"
206
- copy_env_files "$source_root" "$target_path" "$shared_root"
207
- info "โœ… Env files synced to '$target_branch'"
208
- }