@humanu/orchestra 0.5.9 → 0.5.11

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.
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const { spawnSync } = require('child_process');
5
+
6
+ const installScript = path.join(__dirname, '..', 'install.js');
7
+ const result = spawnSync(process.execPath, [installScript, '--invoke=orchestra-local', ...process.argv.slice(2)], {
8
+ stdio: 'inherit',
9
+ });
10
+ process.exit(result.status ?? 0);
package/install.js CHANGED
@@ -5,7 +5,7 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
7
  const BINARY_NAME = 'orchestra';
8
- const SHELL_SCRIPTS = ['gwr.sh', 'gw.sh', 'gw-bridge.sh', 'commands.sh'];
8
+ const SHELL_SCRIPTS = ['gwr.sh', 'gw.sh', 'gw-bridge.sh', 'commands.sh', 'orchestra-local.sh'];
9
9
  const SUPPORTED_PLATFORMS = {
10
10
  'darwin-x64': 'macos-intel',
11
11
  'darwin-arm64': 'macos-arm64',
@@ -217,7 +217,14 @@ function ensureAssets() {
217
217
  function runCommand(command, args) {
218
218
  ensureAssets();
219
219
 
220
- const scriptName = command === 'gw' ? 'gw.sh' : 'gwr.sh';
220
+ let scriptName;
221
+ if (command === 'gw') {
222
+ scriptName = 'gw.sh';
223
+ } else if (command === 'orchestra-local') {
224
+ scriptName = 'orchestra-local.sh';
225
+ } else {
226
+ scriptName = 'gwr.sh';
227
+ }
221
228
  const scriptPath = path.join(distDir, scriptName);
222
229
  if (!fs.existsSync(scriptPath)) {
223
230
  console.error(`Missing script: ${scriptPath}`);
@@ -225,7 +232,7 @@ function runCommand(command, args) {
225
232
  }
226
233
 
227
234
  const env = { ...process.env };
228
- if (command !== 'gw') {
235
+ if (command !== 'gw' && command !== 'orchestra-local') {
229
236
  env.GW_TUI_BIN = path.join(distDir, BINARY_NAME);
230
237
  }
231
238
 
@@ -274,7 +281,14 @@ function main() {
274
281
  }
275
282
 
276
283
  if (invoke) {
277
- const command = invoke === 'gw' ? 'gw' : 'gwr';
284
+ let command;
285
+ if (invoke === 'gw') {
286
+ command = 'gw';
287
+ } else if (invoke === 'orchestra-local') {
288
+ command = 'orchestra-local';
289
+ } else {
290
+ command = 'gwr';
291
+ }
278
292
  runCommand(command, args);
279
293
  return;
280
294
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanu/orchestra",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "description": "AI-powered Git worktree and tmux session manager with modern TUI",
5
5
  "keywords": [
6
6
  "git",
@@ -28,7 +28,8 @@
28
28
  "bin": {
29
29
  "orchestra": "bin/orchestra.js",
30
30
  "gwr": "bin/gwr.js",
31
- "gw": "bin/gw.js"
31
+ "gw": "bin/gw.js",
32
+ "orchestra-local": "bin/orchestra-local.js"
32
33
  },
33
34
  "files": [
34
35
  "bin/",
@@ -58,7 +58,7 @@ find_gw_tui_binary() {
58
58
  )
59
59
 
60
60
  for path in "${binary_paths[@]}"; do
61
- if [[ -n "$path" && -x "$path" ]]; then
61
+ if [[ -n "$path" && -f "$path" && -x "$path" ]]; then
62
62
  echo "$path"
63
63
  return 0
64
64
  fi
@@ -0,0 +1,87 @@
1
+ #!/bin/bash
2
+
3
+ # Orchestra local development command.
4
+ # Usage: orchestra-local [--root <path>] [--worktree <name>] [extra args]
5
+ #
6
+ # - Default root is $HOME/repos/orchestrator (override via ORCHESTRA_LOCAL_ROOT
7
+ # or --root).
8
+ # - Worktree flag resolves to <root>/worktrees/<name>/gwr.sh for convenience.
9
+
10
+ set -euo pipefail
11
+
12
+ print_usage() {
13
+ cat <<'EOF'
14
+ Usage: orchestra-local [--root <path>] [--worktree <name>] [args...]
15
+
16
+ Launch the local Orchestra TUI directly from your cloned repository.
17
+
18
+ Options:
19
+ --root <path> Path to the orchestrator repo (default: $HOME/repos/orchestrator)
20
+ or the value of $ORCHESTRA_LOCAL_ROOT if set.
21
+ -w, --worktree <n> Use the worktree wrapper at <root>/worktrees/<n>/gwr.sh
22
+ -h, --help Show this help and exit.
23
+
24
+ Any remaining arguments are forwarded to the local gwr.sh script.
25
+
26
+ Environment:
27
+ ORCHESTRA_LOCAL_ROOT Overrides the default repo path.
28
+ EOF
29
+ }
30
+
31
+ main() {
32
+ local root="${ORCHESTRA_LOCAL_ROOT:-$HOME/repos/orchestrator}"
33
+ local worktree=""
34
+ local args=()
35
+
36
+ while [[ $# -gt 0 ]]; do
37
+ case $1 in
38
+ --root)
39
+ [[ $# -lt 2 ]] && { echo "--root requires a value" >&2; exit 1; }
40
+ root="$2"
41
+ shift 2
42
+ ;;
43
+ -w|--worktree)
44
+ [[ $# -lt 2 ]] && { echo "--worktree requires a value" >&2; exit 1; }
45
+ worktree="$2"
46
+ shift 2
47
+ ;;
48
+ -h|--help)
49
+ print_usage
50
+ return 0
51
+ ;;
52
+ --)
53
+ shift
54
+ args+=("$@")
55
+ break
56
+ ;;
57
+ *)
58
+ args+=("$1")
59
+ shift
60
+ ;;
61
+ esac
62
+ done
63
+
64
+ if [[ ! -d "$root" ]]; then
65
+ echo "orchestra-local: repository not found at $root" >&2
66
+ echo "Set ORCHESTRA_LOCAL_ROOT or use --root <path> to point to your clone." >&2
67
+ exit 1
68
+ fi
69
+
70
+ local script_path="$root/gwr.sh"
71
+ if [[ -n "$worktree" ]]; then
72
+ script_path="$root/worktrees/$worktree/gwr.sh"
73
+ fi
74
+
75
+ if [[ ! -f "$script_path" ]]; then
76
+ echo "orchestra-local: unable to locate $script_path" >&2
77
+ exit 1
78
+ fi
79
+
80
+ if [[ ${#args[@]} -gt 0 ]]; then
81
+ exec bash "$script_path" "${args[@]}"
82
+ else
83
+ exec bash "$script_path"
84
+ fi
85
+ }
86
+
87
+ main "$@"