@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.
- 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 -2804
- 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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
5
|
# Switch to worktree
|
|
6
|
-
|
|
6
|
+
switch_worktree_api() {
|
|
7
7
|
if [[ -z "${1:-}" ]]; then
|
|
8
8
|
json_error "Branch name required"
|
|
9
9
|
return 1
|
|
@@ -20,4 +20,4 @@ bridge_switch_worktree() {
|
|
|
20
20
|
else
|
|
21
21
|
json_error "Not a git repository"
|
|
22
22
|
fi
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# shellcheck shell=bash
|
|
4
|
+
|
|
5
|
+
# Master file that sources all individual services functions for worktree operations
|
|
6
|
+
# This maintains the same interface while using modular files
|
|
7
|
+
|
|
8
|
+
# Source individual worktree functions
|
|
9
|
+
source "$(dirname "${BASH_SOURCE[0]}")/list_worktrees_api.sh"
|
|
10
|
+
source "$(dirname "${BASH_SOURCE[0]}")/check_branch_api.sh"
|
|
11
|
+
source "$(dirname "${BASH_SOURCE[0]}")/create_worktree_api.sh"
|
|
12
|
+
source "$(dirname "${BASH_SOURCE[0]}")/create_worktree_from_existing_api.sh"
|
|
13
|
+
source "$(dirname "${BASH_SOURCE[0]}")/create_worktree_from_remote_api.sh"
|
|
14
|
+
source "$(dirname "${BASH_SOURCE[0]}")/delete_worktree_api.sh"
|
|
15
|
+
source "$(dirname "${BASH_SOURCE[0]}")/delete_worktree_only_api.sh"
|
|
16
|
+
source "$(dirname "${BASH_SOURCE[0]}")/delete_branch_only_api.sh"
|
|
17
|
+
source "$(dirname "${BASH_SOURCE[0]}")/switch_worktree_api.sh"
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
5
|
# Initialise JSON backend (jq preferred, python3/node fallbacks)
|
|
6
|
-
|
|
7
|
-
if [[ -n "${
|
|
6
|
+
services_init_json_backend() {
|
|
7
|
+
if [[ -n "${SERVICES_JSON_BACKEND:-}" ]]; then
|
|
8
8
|
return 0
|
|
9
9
|
fi
|
|
10
10
|
|
|
11
11
|
if have_cmd jq; then
|
|
12
|
-
|
|
12
|
+
SERVICES_JSON_BACKEND="jq"
|
|
13
13
|
elif command -v python3 >/dev/null 2>&1; then
|
|
14
|
-
|
|
14
|
+
SERVICES_JSON_BACKEND="python"
|
|
15
15
|
elif command -v node >/dev/null 2>&1; then
|
|
16
|
-
|
|
16
|
+
SERVICES_JSON_BACKEND="node"
|
|
17
17
|
else
|
|
18
18
|
err "jq (or python3/node fallback) required for JSON processing"
|
|
19
19
|
exit 1
|
|
@@ -24,8 +24,8 @@ bridge_init_json_backend() {
|
|
|
24
24
|
# Arguments use the format `key[:type]=value` where type defaults to `s` (string).
|
|
25
25
|
# Supported types: s (string), n (numeric), b (boolean), j (raw JSON), null (null literal).
|
|
26
26
|
json_object() {
|
|
27
|
-
|
|
28
|
-
case "$
|
|
27
|
+
services_init_json_backend
|
|
28
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
29
29
|
jq)
|
|
30
30
|
local -a jq_args=()
|
|
31
31
|
local -a jq_expr_parts=()
|
|
@@ -185,9 +185,9 @@ NODE
|
|
|
185
185
|
|
|
186
186
|
# Helper to convert newline-delimited text into a JSON array (dropping trailing blank)
|
|
187
187
|
json_array_from_lines() {
|
|
188
|
-
|
|
188
|
+
services_init_json_backend
|
|
189
189
|
local input="$1"
|
|
190
|
-
case "$
|
|
190
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
191
191
|
jq)
|
|
192
192
|
# More robust handling: split and filter out empty lines, then convert to JSON array
|
|
193
193
|
printf '%s' "$input" | jq -R -s 'split("\n") | map(select(length > 0))'
|
|
@@ -219,9 +219,9 @@ NODE
|
|
|
219
219
|
|
|
220
220
|
# Helper to encode arbitrary text as a JSON string
|
|
221
221
|
json_stringify() {
|
|
222
|
-
|
|
222
|
+
services_init_json_backend
|
|
223
223
|
local input="$1"
|
|
224
|
-
case "$
|
|
224
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
225
225
|
jq)
|
|
226
226
|
printf '%s' "$input" | jq -R -s .
|
|
227
227
|
;;
|
|
@@ -243,9 +243,9 @@ NODE
|
|
|
243
243
|
|
|
244
244
|
# Helper to convert newline-separated JSON objects into an array
|
|
245
245
|
json_array_from_json_lines() {
|
|
246
|
-
|
|
246
|
+
services_init_json_backend
|
|
247
247
|
local input="$1"
|
|
248
|
-
case "$
|
|
248
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
249
249
|
jq)
|
|
250
250
|
printf '%s' "$input" | jq -s .
|
|
251
251
|
;;
|
|
@@ -334,8 +334,8 @@ git_error_summary() {
|
|
|
334
334
|
|
|
335
335
|
# Helper function to output structured worktree data
|
|
336
336
|
json_worktrees() {
|
|
337
|
-
|
|
338
|
-
case "$
|
|
337
|
+
services_init_json_backend
|
|
338
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
339
339
|
jq)
|
|
340
340
|
git_list_worktrees | jq -R -s '
|
|
341
341
|
split("\n")[:-1] |
|
|
@@ -396,9 +396,9 @@ load_anthropic_api_key() {
|
|
|
396
396
|
return 0
|
|
397
397
|
fi
|
|
398
398
|
else
|
|
399
|
-
|
|
399
|
+
services_init_json_backend
|
|
400
400
|
local api_key
|
|
401
|
-
case "$
|
|
401
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
402
402
|
python)
|
|
403
403
|
api_key="$(python3 - "$config_file" <<'PY'
|
|
404
404
|
import json
|
|
@@ -461,9 +461,9 @@ load_openai_api_key() {
|
|
|
461
461
|
return 0
|
|
462
462
|
fi
|
|
463
463
|
else
|
|
464
|
-
|
|
464
|
+
services_init_json_backend
|
|
465
465
|
local api_key
|
|
466
|
-
case "$
|
|
466
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
467
467
|
python)
|
|
468
468
|
api_key="$(python3 - "$config_file" <<'PY'
|
|
469
469
|
import json
|
|
@@ -524,8 +524,8 @@ load_ai_primary_provider() {
|
|
|
524
524
|
if have_cmd jq; then
|
|
525
525
|
provider="$(jq -r '.ai_primary_provider // empty' "$config_file" 2>/dev/null)"
|
|
526
526
|
else
|
|
527
|
-
|
|
528
|
-
case "$
|
|
527
|
+
services_init_json_backend
|
|
528
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
529
529
|
python)
|
|
530
530
|
provider="$(python3 - "$config_file" <<'PY'
|
|
531
531
|
import json
|
|
@@ -576,8 +576,8 @@ load_openai_model() {
|
|
|
576
576
|
if have_cmd jq; then
|
|
577
577
|
model="$(jq -r '.openai_model // empty' "$config_file" 2>/dev/null)"
|
|
578
578
|
else
|
|
579
|
-
|
|
580
|
-
case "$
|
|
579
|
+
services_init_json_backend
|
|
580
|
+
case "$SERVICES_JSON_BACKEND" in
|
|
581
581
|
python)
|
|
582
582
|
model="$(python3 - "$config_file" <<'PY'
|
|
583
583
|
import json
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# shellcheck shell=bash
|
|
4
4
|
|
|
5
5
|
# List tmux sessions
|
|
6
|
-
|
|
6
|
+
services_list_sessions() {
|
|
7
7
|
if [[ -z "${1:-}" ]]; then
|
|
8
8
|
json_error "Slug parameter required"
|
|
9
9
|
return 1
|
|
@@ -29,7 +29,7 @@ bridge_list_sessions() {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
# Create tmux session
|
|
32
|
-
|
|
32
|
+
services_create_session() {
|
|
33
33
|
if [[ -z "${1:-}" ]]; then
|
|
34
34
|
json_error "Slug required"
|
|
35
35
|
return 1
|
|
@@ -47,7 +47,7 @@ bridge_create_session() {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
# Create exact tmux session
|
|
50
|
-
|
|
50
|
+
services_create_session_exact() {
|
|
51
51
|
if [[ -z "${1:-}" ]]; then
|
|
52
52
|
json_error "Session name required"
|
|
53
53
|
return 1
|
|
@@ -63,7 +63,7 @@ bridge_create_session_exact() {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
# Create a new tmux session in the current session's worktree and switch to it.
|
|
66
|
-
|
|
66
|
+
services_create_workspace_session() {
|
|
67
67
|
if [[ -z "${1:-}" ]]; then
|
|
68
68
|
json_error "Current session name required"
|
|
69
69
|
return 1
|
|
@@ -83,7 +83,7 @@ bridge_create_workspace_session() {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
# Close current tmux session after switching to the next workspace session.
|
|
86
|
-
|
|
86
|
+
services_close_workspace_session() {
|
|
87
87
|
if [[ -z "${1:-}" ]]; then
|
|
88
88
|
json_error "Current session name required"
|
|
89
89
|
return 1
|
|
@@ -103,7 +103,7 @@ bridge_close_workspace_session() {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
# Show interactive workspace session menu.
|
|
106
|
-
|
|
106
|
+
services_workspace_session_menu() {
|
|
107
107
|
if [[ -z "${1:-}" ]]; then
|
|
108
108
|
json_error "Current session name required"
|
|
109
109
|
return 1
|
|
@@ -123,7 +123,7 @@ bridge_workspace_session_menu() {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
# Kill tmux session
|
|
126
|
-
|
|
126
|
+
services_kill_session() {
|
|
127
127
|
if [[ -z "${1:-}" ]]; then
|
|
128
128
|
json_error "Session name required"
|
|
129
129
|
return 1
|
|
@@ -142,7 +142,7 @@ bridge_kill_session() {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
# Attach to tmux session
|
|
145
|
-
|
|
145
|
+
services_attach_session() {
|
|
146
146
|
if [[ -z "${1:-}" ]]; then
|
|
147
147
|
json_error "Session name required"
|
|
148
148
|
return 1
|
|
@@ -158,7 +158,7 @@ bridge_attach_session() {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
# Send keys to tmux session
|
|
161
|
-
|
|
161
|
+
services_tmux_send_keys() {
|
|
162
162
|
if [[ -z "${1:-}" ]]; then
|
|
163
163
|
json_error "Session name required"
|
|
164
164
|
return 1
|
|
@@ -173,7 +173,7 @@ bridge_tmux_send_keys() {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
# Cycle to next/previous registered Orchestra session in the current workspace
|
|
176
|
-
|
|
176
|
+
services_cycle_workspace_session() {
|
|
177
177
|
if [[ -z "${1:-}" ]] || [[ -z "${2:-}" ]]; then
|
|
178
178
|
json_error "Session name and direction required"
|
|
179
179
|
return 1
|
|
@@ -194,7 +194,7 @@ bridge_cycle_workspace_session() {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
# Show Orchestra tmux shortcut help popup
|
|
197
|
-
|
|
197
|
+
services_tmux_help_popup() {
|
|
198
198
|
target_client="${1:-}"
|
|
199
199
|
|
|
200
200
|
if tmux_available; then
|
|
@@ -209,7 +209,7 @@ bridge_tmux_help_popup() {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
# Get session metadata
|
|
212
|
-
|
|
212
|
+
services_session_metadata() {
|
|
213
213
|
if [[ -z "${1:-}" ]]; then
|
|
214
214
|
json_error "Session name required"
|
|
215
215
|
return 1
|
|
@@ -253,7 +253,7 @@ bridge_session_metadata() {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
# Get session preview
|
|
256
|
-
|
|
256
|
+
services_session_preview() {
|
|
257
257
|
if [[ -z "${1:-}" ]]; then
|
|
258
258
|
json_error "Session name required"
|
|
259
259
|
return 1
|
|
@@ -269,7 +269,7 @@ bridge_session_preview() {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
# Check if tmux is available
|
|
272
|
-
|
|
272
|
+
services_tmux_available() {
|
|
273
273
|
if tmux_available; then
|
|
274
274
|
echo "true"
|
|
275
275
|
else
|