@humanu/orchestra 0.5.77 → 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.
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 +2806 -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
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
3
  ###############################################################################
4
- # gw.sh – Git-Worktree helper main entry point
4
+ # orchestra-cli.sh - Orchestra CLI entry point
5
5
  # ---------------------------------------------------------------------------
6
6
  # This script prints a line like: cd "/abs/path" for your shell wrapper to eval
7
7
  # so your interactive shell actually changes directories. See wrapper notes
@@ -11,8 +11,8 @@
11
11
 
12
12
  # Recommended wrapper (place in ~/.bash_profile or ~/.zshrc):
13
13
  #
14
- # gw () {
15
- # local script="/absolute/path/to/gw.sh" # UPDATE THIS PATH
14
+ # orchestra-cli () {
15
+ # local script="/absolute/path/to/orchestra-cli.sh" # UPDATE THIS PATH
16
16
  # local out
17
17
  # out="$(command bash "$script" "$@")"
18
18
  # local status=$?
@@ -32,8 +32,8 @@ set -o nounset
32
32
  # lastpipe not available on older macOS bash; ignore
33
33
 
34
34
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
35
- source "$SCRIPT_DIR/shell/gw_load.sh"
36
- gw_load_core
35
+ source "$SCRIPT_DIR/shell/cli_load.sh"
36
+ cli_load_core
37
37
 
38
38
  # --------------------------- Module Loading ---------------------------------
39
39
 
@@ -115,7 +115,7 @@ set_terminal_title() {
115
115
  printf '\033]0;%s\007' "$title" >"$tty_device" 2>/dev/null || true
116
116
  }
117
117
 
118
- # Interactive functionality is provided by the Rust TUI (gw-tui)
118
+ # Interactive functionality is provided by the Rust TUI (tui)
119
119
  # No longer sourcing interactive.sh - Rust TUI is the primary interface
120
120
 
121
121
  # --------------------------- core features ----------------------------------
@@ -157,27 +157,27 @@ usage() {
157
157
 
158
158
  if [ $# -eq 0 ]; then
159
159
  # Interactive mode by default - prefer Rust TUI if available
160
- if command -v gw-tui >/dev/null 2>&1; then
160
+ if command -v tui >/dev/null 2>&1; then
161
161
  # Use Rust TUI if available
162
162
  set_terminal_title
163
- gw-tui --bridge-path "$SCRIPT_DIR/gw-bridge.sh"
164
- elif [[ -f "$SCRIPT_DIR/gw-tui/target/release/gw-tui" ]]; then
163
+ tui --services-path "$SCRIPT_DIR/services.sh"
164
+ elif [[ -f "$SCRIPT_DIR/tui/target/release/tui" ]]; then
165
165
  # Use locally built Rust TUI
166
166
  set_terminal_title
167
- "$SCRIPT_DIR/gw-tui/target/release/gw-tui" --bridge-path "$SCRIPT_DIR/gw-bridge.sh"
168
- elif [[ -f "$SCRIPT_DIR/gw-tui/target/debug/gw-tui" ]]; then
167
+ "$SCRIPT_DIR/tui/target/release/tui" --services-path "$SCRIPT_DIR/services.sh"
168
+ elif [[ -f "$SCRIPT_DIR/tui/target/debug/tui" ]]; then
169
169
  # Use debug build of Rust TUI
170
170
  set_terminal_title
171
- "$SCRIPT_DIR/gw-tui/target/debug/gw-tui" --bridge-path "$SCRIPT_DIR/gw-bridge.sh"
171
+ "$SCRIPT_DIR/tui/target/debug/tui" --services-path "$SCRIPT_DIR/services.sh"
172
172
  else
173
173
  # No Rust TUI available - provide clear guidance
174
- err "Interactive mode requires the Rust TUI (gw-tui)"
174
+ err "Interactive mode requires the Rust TUI (tui)"
175
175
  echo ""
176
176
  echo "To build:"
177
177
  echo " ./build.sh # Build Rust TUI binary"
178
178
  echo ""
179
179
  echo "Or build manually:"
180
- echo " cd gw-tui && cargo build --release"
180
+ echo " cd tui && cargo build --release"
181
181
  echo ""
182
182
  echo "For command-line operations without interactive mode:"
183
183
  echo " $0 ls # List worktrees"
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # - Default root is $HOME/repos/orchestrator (override via ORCHESTRA_LOCAL_ROOT
7
7
  # or --root).
8
- # - Worktree flag resolves to <root>/worktrees/<name>/gwr.sh for convenience.
8
+ # - Worktree flag resolves to <root>/worktrees/<name>/orchestra.sh for convenience.
9
9
 
10
10
  set -euo pipefail
11
11
 
@@ -18,10 +18,10 @@ Launch the local Orchestra TUI directly from your cloned repository.
18
18
  Options:
19
19
  --root <path> Path to the orchestrator repo (default: $HOME/repos/orchestrator)
20
20
  or the value of $ORCHESTRA_LOCAL_ROOT if set.
21
- -w, --worktree <n> Use the worktree wrapper at <root>/worktrees/<n>/gwr.sh
21
+ -w, --worktree <n> Use the worktree wrapper at <root>/worktrees/<n>/orchestra.sh
22
22
  -h, --help Show this help and exit.
23
23
 
24
- Any remaining arguments are forwarded to the local gwr.sh script.
24
+ Any remaining arguments are forwarded to the local orchestra.sh script.
25
25
 
26
26
  Environment:
27
27
  ORCHESTRA_LOCAL_ROOT Overrides the default repo path.
@@ -67,9 +67,9 @@ main() {
67
67
  exit 1
68
68
  fi
69
69
 
70
- local script_path="$root/gwr.sh"
70
+ local script_path="$root/orchestra.sh"
71
71
  if [[ -n "$worktree" ]]; then
72
- script_path="$root/worktrees/$worktree/gwr.sh"
72
+ script_path="$root/worktrees/$worktree/orchestra.sh"
73
73
  fi
74
74
 
75
75
  if [[ ! -f "$script_path" ]]; then
@@ -78,7 +78,7 @@ main() {
78
78
  fi
79
79
 
80
80
  # This launcher is explicitly for local development; ignore installed binary
81
- # overrides so gwr.sh resolves the TUI binary from the selected checkout.
81
+ # overrides so orchestra.sh resolves the TUI binary from the selected checkout.
82
82
  unset GW_TUI_BIN
83
83
 
84
84
  if [[ ${#args[@]} -gt 0 ]]; then
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
3
  ###############################################################################
4
- # gwr.sh – Git-Worktree Rust TUI launcher
4
+ # orchestra.sh - Orchestra TUI launcher
5
5
  # ---------------------------------------------------------------------------
6
6
  # This script launches the Rust TUI application for git worktree and tmux
7
7
  # session management. It automatically detects the built binary location
@@ -10,8 +10,8 @@
10
10
 
11
11
  # Recommended wrapper (place in ~/.bash_profile or ~/.zshrc):
12
12
  #
13
- # gwr () {
14
- # local script="/absolute/path/to/gwr.sh" # UPDATE THIS PATH
13
+ # orchestra () {
14
+ # local script="/absolute/path/to/orchestra.sh" # UPDATE THIS PATH
15
15
  # local out
16
16
  # out="$(command bash "$script" "$@")"
17
17
  # local status=$?
@@ -29,7 +29,7 @@ set -o nounset
29
29
  # shellcheck shell=bash
30
30
 
31
31
  ###############################################################################
32
- # gwr.sh – Git-Worktree Rust TUI launcher
32
+ # orchestra.sh - Orchestra TUI launcher
33
33
  ###############################################################################
34
34
 
35
35
  set -o errexit
@@ -54,11 +54,11 @@ fi
54
54
 
55
55
  # Check prerequisites
56
56
  gwr_check_git_repo
57
- gwr_check_bridge_script
57
+ gwr_check_services_script
58
58
 
59
59
  # Find the binary
60
60
  if ! BINARY_PATH=$(gwr_find_binary); then
61
- gwr_error "gw-tui binary not found!"
61
+ gwr_error "tui binary not found!"
62
62
  gwr_error ""
63
63
  gwr_error "Please build the Rust TUI first:"
64
64
  gwr_error " ./build.sh"
@@ -70,61 +70,17 @@ if ! BINARY_PATH=$(gwr_find_binary); then
70
70
  if [[ -n "${GW_TUI_BIN:-}" ]]; then
71
71
  gwr_error " • $GW_TUI_BIN (from GW_TUI_BIN)"
72
72
  fi
73
- gwr_error " • $SCRIPT_DIR/gw-tui/target/release/gw-tui"
74
- gwr_error " • $SCRIPT_DIR/gw-tui/target/debug/gw-tui"
75
- gwr_error " • gw-tui (in PATH)"
73
+ gwr_error " • $SCRIPT_DIR/tui/target/release/tui"
74
+ gwr_error " • $SCRIPT_DIR/tui/target/debug/tui"
75
+ gwr_error " • tui (in PATH)"
76
76
  exit 1
77
77
  fi
78
78
 
79
- BRIDGE_PATH="$SCRIPT_DIR/gw-bridge.sh"
79
+ SERVICES_PATH="$SCRIPT_DIR/services.sh"
80
80
 
81
81
  gwr_set_terminal_title
82
82
 
83
83
  # Check for updates silently (once per day)
84
84
  gwr_check_updates_silent
85
85
 
86
- exec "$BINARY_PATH" --bridge-path "$BRIDGE_PATH" "$@"
87
-
88
- # Handle help flag early
89
- if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
90
- show_usage
91
- exit 0
92
- fi
93
-
94
- # Handle update check flag
95
- if [[ "${1:-}" == "--check-updates" || "${1:-}" == "--update" ]]; then
96
- "$SCRIPT_DIR/shell/gwr/check-updates.sh"
97
- exit $?
98
- fi
99
-
100
- # Check prerequisites
101
- check_git_repo
102
- check_bridge_script
103
-
104
- # Find the binary
105
- if ! BINARY_PATH=$(find_gw_tui_binary); then
106
- error "gw-tui binary not found!"
107
- error ""
108
- error "Please build the Rust TUI first:"
109
- error " ./build.sh"
110
- error ""
111
- error "Or install globally:"
112
- error " ./build.sh --install"
113
- error ""
114
- error "Binary search paths:"
115
- if [[ -n "${GW_TUI_BIN:-}" ]]; then
116
- error " • $GW_TUI_BIN (from GW_TUI_BIN)"
117
- fi
118
- error " • $SCRIPT_DIR/gw-tui/target/release/gw-tui"
119
- error " • $SCRIPT_DIR/gw-tui/target/debug/gw-tui"
120
- error " • gw-tui (in PATH)"
121
- exit 1
122
- fi
123
-
124
- # Get bridge script path
125
- BRIDGE_PATH="$SCRIPT_DIR/gw-bridge.sh"
126
-
127
- set_terminal_title
128
-
129
- # Run the Rust TUI with bridge path and all arguments passed through
130
- exec "$BINARY_PATH" --bridge-path "$BRIDGE_PATH" "$@"
86
+ exec "$BINARY_PATH" --services-path "$SERVICES_PATH" "$@"
@@ -28,7 +28,7 @@ ai_choose_provider() {
28
28
  }
29
29
 
30
30
  # AI generate name from base64 content
31
- bridge_ai_generate_name_from_base64() {
31
+ services_ai_generate_name_from_base64() {
32
32
  if [[ -z "${1:-}" ]]; then
33
33
  json_error "Base64 content required"
34
34
  return 1
@@ -147,7 +147,7 @@ PY
147
147
  }
148
148
 
149
149
  # Rename session with AI
150
- bridge_rename_session() {
150
+ services_rename_session() {
151
151
  if [[ -z "${1:-}" ]]; then
152
152
  json_error "Session name required"
153
153
  return 1
@@ -184,7 +184,7 @@ bridge_rename_session() {
184
184
  # Generate AI description using the CURRENT session (no renaming to temp name)
185
185
  local err_file
186
186
  if [[ "$OSTYPE" == "darwin"* ]]; then
187
- err_file=$(mktemp -t gw_ai_err)
187
+ err_file=$(mktemp -t orchestra_ai_err)
188
188
  else
189
189
  err_file=$(mktemp)
190
190
  fi
@@ -229,7 +229,7 @@ bridge_rename_session() {
229
229
  }
230
230
 
231
231
  # Manual rename session
232
- bridge_manual_rename_session() {
232
+ services_manual_rename_session() {
233
233
  if [[ -z "${1:-}" ]] || [[ $# -lt 2 ]]; then
234
234
  json_error "Old and new session names required"
235
235
  return 1
@@ -1,11 +1,11 @@
1
1
  #!/bin/bash
2
2
 
3
3
  ###############################################################################
4
- # gw-bridge.sh – API bridge between the Rust TUI and the shell context
4
+ # services.sh – local services between the Rust TUI and the shell context
5
5
  # ---------------------------------------------------------------------------
6
6
  # The UI lives in Rust, but all operational logic (git, worktrees, tmux, env
7
7
  # copying, etc.) lives in bash. The TUI calls into this script (through
8
- # `BridgeApi`), and we fan out to the shell utilities (`api/git.sh`, `commands.sh`,
8
+ # `ServicesApi`), and we fan out to the shell utilities (`api/git.sh`,
9
9
  # `api/tmux.sh`, …). Responses are normalised (usually JSON) so the Rust side can
10
10
  # remain strongly-typed while we stay anchored in the shell environment.
11
11
  ###############################################################################
@@ -13,29 +13,32 @@
13
13
  set -euo pipefail
14
14
 
15
15
  # Source the API modules
16
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
- source "$SCRIPT_DIR/api/git.sh"
18
- source "$SCRIPT_DIR/api/tmux.sh"
19
- source "$SCRIPT_DIR/shell/gw_env_copy.sh"
20
-
21
- # Source bridge modules
22
- source "$SCRIPT_DIR/shell/bridge/utils.sh"
23
- source "$SCRIPT_DIR/shell/bridge/tmux.sh"
24
- source "$SCRIPT_DIR/shell/bridge/ai.sh"
25
-
26
- # Source git bridge modules (now modular)
27
- source "$SCRIPT_DIR/shell/git/bridge_worktree.sh"
28
- source "$SCRIPT_DIR/shell/git/bridge_repo.sh"
29
- source "$SCRIPT_DIR/shell/git/bridge_merge.sh"
30
- source "$SCRIPT_DIR/shell/git/bridge_enhanced_git_status.sh"
31
- source "$SCRIPT_DIR/shell/git/bridge_git_status.sh"
16
+ SERVICES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ SERVER_DIR="$(cd "$SERVICES_DIR/.." && pwd)"
18
+ ROOT_DIR="$(cd "$SERVER_DIR/.." && pwd)"
19
+ GIT_SERVICES_DIR="$SERVICES_DIR/git"
20
+ source "$GIT_SERVICES_DIR/api.sh"
21
+ source "$ROOT_DIR/api/tmux.sh"
22
+ source "$ROOT_DIR/shell/env_copy.sh"
23
+
24
+ # Source services modules
25
+ source "$SERVICES_DIR/json.sh"
26
+ source "$SERVICES_DIR/session/tmux.sh"
27
+ source "$SERVICES_DIR/ai.sh"
28
+
29
+ # Source git service handlers
30
+ source "$GIT_SERVICES_DIR/worktree_api.sh"
31
+ source "$GIT_SERVICES_DIR/repo_api.sh"
32
+ source "$GIT_SERVICES_DIR/merge_api.sh"
33
+ source "$GIT_SERVICES_DIR/enhanced_git_status_api.sh"
34
+ source "$GIT_SERVICES_DIR/git_status_api.sh"
32
35
 
33
36
  # Define utilities we need
34
37
  err() { printf '❌ %s\n' "$*" >&2; }
35
38
  info() { printf '%s\n' "$*"; }
36
39
  have_cmd() { command -v "$1" >/dev/null 2>&1; }
37
40
 
38
- bridge_copy_env_files() {
41
+ services_copy_env_files() {
39
42
  if [[ -z "${1:-}" ]] || [[ -z "${2:-}" ]]; then
40
43
  json_error "Source and target paths required"
41
44
  return 1
@@ -58,8 +61,8 @@ bridge_copy_env_files() {
58
61
  fi
59
62
 
60
63
  local bin
61
- if ! bin="$(gw_env_copy_bin)"; then
62
- json_error "gw-env-copy binary not found"
64
+ if ! bin="$(env_copy_bin)"; then
65
+ json_error "env-copy binary not found"
63
66
  return 1
64
67
  fi
65
68
 
@@ -78,155 +81,155 @@ bridge_copy_env_files() {
78
81
  }
79
82
 
80
83
  # Ensure JSON backend is available (jq preferred, python/node fallback)
81
- bridge_init_json_backend
84
+ services_init_json_backend
82
85
 
83
86
  # Main command dispatcher
84
87
  case "${1:-}" in
85
88
  "list-worktrees")
86
- bridge_list_worktrees
89
+ list_worktrees_api
87
90
  ;;
88
91
 
89
92
  "list-sessions")
90
- bridge_list_sessions "${2:-}" "${3:-}"
93
+ services_list_sessions "${2:-}" "${3:-}"
91
94
  ;;
92
95
 
93
96
  "create-session")
94
- bridge_create_session "${2:-}" "${3:-}" "${4:-}"
97
+ services_create_session "${2:-}" "${3:-}" "${4:-}"
95
98
  ;;
96
99
 
97
100
  "create-session-exact")
98
- bridge_create_session_exact "${2:-}" "${3:-}"
101
+ services_create_session_exact "${2:-}" "${3:-}"
99
102
  ;;
100
103
 
101
104
  "create-workspace-session")
102
- bridge_create_workspace_session "${2:-}" "${3:-}"
105
+ services_create_workspace_session "${2:-}" "${3:-}"
103
106
  ;;
104
107
 
105
108
  "close-workspace-session")
106
- bridge_close_workspace_session "${2:-}" "${3:-}"
109
+ services_close_workspace_session "${2:-}" "${3:-}"
107
110
  ;;
108
111
 
109
112
  "workspace-session-menu")
110
- bridge_workspace_session_menu "${2:-}" "${3:-}"
113
+ services_workspace_session_menu "${2:-}" "${3:-}"
111
114
  ;;
112
115
 
113
116
  "kill-session")
114
- bridge_kill_session "${2:-}"
117
+ services_kill_session "${2:-}"
115
118
  ;;
116
119
 
117
120
  "attach-session")
118
- bridge_attach_session "${2:-}"
121
+ services_attach_session "${2:-}"
119
122
  ;;
120
123
 
121
124
  "tmux-send-keys")
122
- bridge_tmux_send_keys "${2:-}" "${@:3}"
125
+ services_tmux_send_keys "${2:-}" "${@:3}"
123
126
  ;;
124
127
 
125
128
  "cycle-workspace-session")
126
- bridge_cycle_workspace_session "${2:-}" "${3:-}" "${4:-}"
129
+ services_cycle_workspace_session "${2:-}" "${3:-}" "${4:-}"
127
130
  ;;
128
131
 
129
132
  "tmux-help-popup")
130
- bridge_tmux_help_popup "${2:-}"
133
+ services_tmux_help_popup "${2:-}"
131
134
  ;;
132
135
 
133
136
  "session-metadata")
134
- bridge_session_metadata "${2:-}"
137
+ services_session_metadata "${2:-}"
135
138
  ;;
136
139
 
137
140
  "session-preview")
138
- bridge_session_preview "${2:-}"
141
+ services_session_preview "${2:-}"
139
142
  ;;
140
143
 
141
144
  "ai-generate-name-from-base64")
142
- bridge_ai_generate_name_from_base64 "${2:-}"
145
+ services_ai_generate_name_from_base64 "${2:-}"
143
146
  ;;
144
147
 
145
148
  "rename-session")
146
- bridge_rename_session "${2:-}"
149
+ services_rename_session "${2:-}"
147
150
  ;;
148
151
 
149
152
  "manual-rename-session")
150
- bridge_manual_rename_session "${2:-}" "${@:3}"
153
+ services_manual_rename_session "${2:-}" "${@:3}"
151
154
  ;;
152
155
 
153
156
  "check-branch")
154
- bridge_check_branch "${2:-}"
157
+ check_branch_api "${2:-}"
155
158
  ;;
156
159
 
157
160
  "create-worktree")
158
- bridge_create_worktree "${2:-}"
161
+ create_worktree_api "${2:-}"
159
162
  ;;
160
163
 
161
164
  "create-worktree-from-existing")
162
- bridge_create_worktree_from_existing "${2:-}"
165
+ create_worktree_from_existing_api "${2:-}"
163
166
  ;;
164
167
 
165
168
  "create-worktree-from-remote")
166
- bridge_create_worktree_from_remote "${2:-}" "${3:-}"
169
+ create_worktree_from_remote_api "${2:-}" "${3:-}"
167
170
  ;;
168
171
 
169
172
  "delete-worktree")
170
- bridge_delete_worktree "${2:-}"
173
+ delete_worktree_api "${2:-}"
171
174
  ;;
172
175
 
173
176
  "delete-worktree-only")
174
- bridge_delete_worktree_only "${2:-}"
177
+ delete_worktree_only_api "${2:-}"
175
178
  ;;
176
179
 
177
180
  "delete-branch-only")
178
- bridge_delete_branch_only "${2:-}"
181
+ delete_branch_only_api "${2:-}"
179
182
  ;;
180
183
 
181
184
  "switch-worktree")
182
- bridge_switch_worktree "${2:-}"
185
+ switch_worktree_api "${2:-}"
183
186
  ;;
184
187
 
185
188
  "repo-info")
186
- bridge_repo_info
189
+ repo_info_api
187
190
  ;;
188
191
 
189
192
  "git-status")
190
- bridge_git_status
193
+ git_status_api
191
194
  ;;
192
195
 
193
196
  "enhanced-git-status")
194
- bridge_enhanced_git_status "${2:-}"
197
+ enhanced_git_status_api "${2:-}"
195
198
  ;;
196
199
 
197
200
  "primary-branch")
198
- bridge_primary_branch
201
+ primary_branch_api
199
202
  ;;
200
203
 
201
204
  "merge-from-primary")
202
- bridge_merge_from_primary "$@"
205
+ merge_from_primary_api "$@"
203
206
  ;;
204
207
 
205
208
  "rebase-from-primary")
206
- bridge_rebase_from_primary "$@"
209
+ rebase_from_primary_api "$@"
207
210
  ;;
208
211
 
209
212
  "merge-into-primary")
210
- bridge_merge_into_primary "$@"
213
+ merge_into_primary_api "$@"
211
214
  ;;
212
215
 
213
216
  "squash-into-primary")
214
- bridge_squash_into_primary "$@"
217
+ squash_into_primary_api "$@"
215
218
  ;;
216
219
 
217
220
  "tmux-available")
218
- bridge_tmux_available
221
+ services_tmux_available
219
222
  ;;
220
223
 
221
224
  "copy-env-files")
222
- bridge_copy_env_files "${2:-}" "${3:-}" "${4:-}"
225
+ services_copy_env_files "${2:-}" "${3:-}" "${4:-}"
223
226
  ;;
224
227
 
225
228
  "help"|"-h"|"--help")
226
229
  cat << 'EOF'
227
- Usage: gw-bridge.sh <command> [args]
230
+ Usage: services.sh <command> [args]
228
231
 
229
- API bridge for gw-tui Rust application.
232
+ Local services for the tui Rust application.
230
233
 
231
234
  Commands:
232
235
  list-worktrees List all worktrees as JSON