@humanu/orchestra 0.5.61 → 0.5.62
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/package.json
CHANGED
package/resources/api/tmux.sh
CHANGED
|
@@ -24,6 +24,9 @@ fi
|
|
|
24
24
|
# Note: tmux session names cannot contain ':'; use a safe delimiter
|
|
25
25
|
ORCHESTRA_SESSION_DELIM="__"
|
|
26
26
|
|
|
27
|
+
# Absolute directory that contains this script when sourced.
|
|
28
|
+
_TMUX_API_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
29
|
+
|
|
27
30
|
# Helper: return delimiter
|
|
28
31
|
_tmux_delim() { echo "$ORCHESTRA_SESSION_DELIM"; }
|
|
29
32
|
|
|
@@ -108,18 +111,38 @@ _tmux_normalize_app_from_command() {
|
|
|
108
111
|
|
|
109
112
|
# Helper: absolute path to the command hook script (if present)
|
|
110
113
|
_orchestra_command_hook() {
|
|
111
|
-
local
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
local hook=""
|
|
115
|
+
|
|
116
|
+
# 1) Explicit install root set by wrappers (Homebrew/NPM)
|
|
117
|
+
if [[ -n "${GW_ORCHESTRATOR_ROOT-}" ]]; then
|
|
118
|
+
hook="$GW_ORCHESTRATOR_ROOT/shell/orchestra-command-hook.sh"
|
|
119
|
+
if [[ -f "$hook" ]]; then
|
|
120
|
+
echo "$hook"
|
|
121
|
+
return
|
|
122
|
+
fi
|
|
116
123
|
fi
|
|
117
|
-
|
|
124
|
+
|
|
125
|
+
# 2) Resolve relative to this script's install location
|
|
126
|
+
local script_root
|
|
127
|
+
script_root="$(cd "$_TMUX_API_DIR/.." && pwd -P)"
|
|
128
|
+
hook="$script_root/shell/orchestra-command-hook.sh"
|
|
118
129
|
if [[ -f "$hook" ]]; then
|
|
119
130
|
echo "$hook"
|
|
120
|
-
|
|
121
|
-
echo ""
|
|
131
|
+
return
|
|
122
132
|
fi
|
|
133
|
+
|
|
134
|
+
# 3) Fallback to repo root for legacy/dev flows
|
|
135
|
+
local root
|
|
136
|
+
root="$(repo_root)"
|
|
137
|
+
if [[ -n "$root" ]]; then
|
|
138
|
+
hook="$root/shell/orchestra-command-hook.sh"
|
|
139
|
+
if [[ -f "$hook" ]]; then
|
|
140
|
+
echo "$hook"
|
|
141
|
+
return
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
echo ""
|
|
123
146
|
}
|
|
124
147
|
|
|
125
148
|
# Source the command hook inside a tmux session to enable command history logging
|
|
@@ -144,8 +167,8 @@ _tmux_source_command_hook() {
|
|
|
144
167
|
pane_id="${line%% *}"
|
|
145
168
|
pane_cmd="${line#* }"
|
|
146
169
|
case "$pane_cmd" in
|
|
147
|
-
bash|zsh
|
|
148
|
-
tmux send-keys -t "$pane_id" "
|
|
170
|
+
bash|zsh)
|
|
171
|
+
tmux send-keys -t "$pane_id" ". '$hook'" C-m 2>/dev/null || true
|
|
149
172
|
;;
|
|
150
173
|
*)
|
|
151
174
|
;;
|
|
@@ -1296,6 +1319,8 @@ allowed_prefixes = (
|
|
|
1296
1319
|
def clean_tokens(tokens):
|
|
1297
1320
|
while tokens and tokens[0] in {"$", "#", "%"}:
|
|
1298
1321
|
tokens = tokens[1:]
|
|
1322
|
+
while tokens and (tokens[0].endswith("$") or tokens[0].endswith("#") or tokens[0].endswith("%")):
|
|
1323
|
+
tokens = tokens[1:]
|
|
1299
1324
|
return tokens
|
|
1300
1325
|
|
|
1301
1326
|
|
|
@@ -1468,7 +1493,7 @@ def normalize_app(cmd: str) -> str:
|
|
|
1468
1493
|
return ""
|
|
1469
1494
|
return base
|
|
1470
1495
|
|
|
1471
|
-
app_commands = history_commands
|
|
1496
|
+
app_commands = history_commands if history_commands else app_command_candidates
|
|
1472
1497
|
app_prefix = ""
|
|
1473
1498
|
for candidate in reversed(app_commands):
|
|
1474
1499
|
app_prefix = normalize_app(candidate)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|