@humanu/orchestra 0.5.62 → 0.5.63

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanu/orchestra",
3
- "version": "0.5.62",
3
+ "version": "0.5.63",
4
4
  "description": "AI-powered Git worktree and tmux session manager with modern TUI",
5
5
  "keywords": [
6
6
  "git",
@@ -80,7 +80,7 @@ _tmux_normalize_app_from_command() {
80
80
 
81
81
  local base="${tokens[$i]}"
82
82
  base="${base##*/}"
83
- base="$(printf '%s' "$base" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9._-:' '_')"
83
+ base="$(printf '%s' "$base" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9._:-' '_')"
84
84
  base="${base//__/_}"
85
85
  base="${base##_}"
86
86
  base="${base%%_}"
@@ -1189,6 +1189,8 @@ if history_arg:
1189
1189
  history_commands = history_commands[-50:]
1190
1190
 
1191
1191
  prompt_pattern = re.compile(r"^[A-Za-z0-9_.@~/-]+$")
1192
+ prompt_sigil_pattern = re.compile(r"^(?P<prompt>[^\t]{0,120}?)(?P<sigil>[$#%])\s+(?P<cmd>.+)$")
1193
+ simple_sigil_pattern = re.compile(r"^(?P<sigil>[$#%])\s+(?P<cmd>.+)$")
1192
1194
  disallowed_prompts = {
1193
1195
  "warning",
1194
1196
  "error",
@@ -1324,23 +1326,44 @@ def clean_tokens(tokens):
1324
1326
  return tokens
1325
1327
 
1326
1328
 
1327
- for raw_line in lines:
1329
+ def extract_prompt_and_command(raw_line):
1328
1330
  stripped = raw_line.strip()
1329
- if not stripped or ":" not in stripped:
1330
- continue
1331
+ if not stripped:
1332
+ return "", ""
1333
+
1334
+ # Pattern 1: host:path:command (common bash/zsh prompts)
1335
+ if ":" in stripped:
1336
+ maybe_prompt, maybe_cmd = stripped.split(":", 1)
1337
+ maybe_prompt = maybe_prompt.strip().rstrip("#$%")
1338
+ maybe_cmd = maybe_cmd.strip()
1339
+ if maybe_prompt and maybe_cmd and prompt_pattern.match(maybe_prompt):
1340
+ prompt_lower = maybe_prompt.lower()
1341
+ if prompt_lower not in disallowed_prompts:
1342
+ return maybe_prompt, maybe_cmd
1343
+
1344
+ # Pattern 2: prompt ending with $, #, % (supports prompts without ':')
1345
+ match = prompt_sigil_pattern.match(stripped)
1346
+ if match:
1347
+ maybe_prompt = (match.group("prompt") or "").strip().rstrip("#$%")
1348
+ maybe_cmd = (match.group("cmd") or "").strip()
1349
+ if maybe_cmd:
1350
+ if maybe_prompt and maybe_prompt.lower() in disallowed_prompts:
1351
+ return "", ""
1352
+ return (maybe_prompt if maybe_prompt else match.group("sigil")), maybe_cmd
1353
+
1354
+ # Pattern 3: bare prompt lines like "$ git status"
1355
+ match = simple_sigil_pattern.match(stripped)
1356
+ if match:
1357
+ maybe_cmd = (match.group("cmd") or "").strip()
1358
+ if maybe_cmd:
1359
+ return match.group("sigil"), maybe_cmd
1360
+
1361
+ return "", ""
1331
1362
 
1332
- prompt_part, command_part = stripped.split(":", 1)
1333
- prompt_part = prompt_part.strip().rstrip("#$%")
1334
- command_part = command_part.strip()
1335
-
1336
- if not prompt_part or not command_part:
1337
- continue
1338
1363
 
1339
- if not prompt_pattern.match(prompt_part):
1340
- continue
1341
-
1342
- prompt_lower = prompt_part.lower()
1343
- if prompt_lower in disallowed_prompts:
1364
+ for raw_line in lines:
1365
+ prompt_part, command_part = extract_prompt_and_command(raw_line)
1366
+ if not command_part:
1344
1367
  continue
1345
1368
 
1346
1369
  tokens = clean_tokens(command_part.split())
@@ -86,7 +86,7 @@ _orchestra_normalize_app() {
86
86
 
87
87
  local base="${tokens[$i]}"
88
88
  base="${base##*/}"
89
- base="$(printf '%s' "$base" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9._-:' '_')"
89
+ base="$(printf '%s' "$base" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9._:-' '_')"
90
90
  base="${base//__/_}"
91
91
  base="${base##_}"
92
92
  base="${base%%_}"