@humanu/orchestra 0.5.34 → 0.5.35
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/README.md
CHANGED
|
@@ -5,6 +5,10 @@ Orchestra is a fast, terminal-first TUI application for managing your Git worktr
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
+
# Install one JSON helper first (jq, python3, or node) — example for Debian/Ubuntu:
|
|
9
|
+
sudo apt-get install jq
|
|
10
|
+
|
|
11
|
+
# Then install Orchestra:
|
|
8
12
|
npm install -g @humanu/orchestra
|
|
9
13
|
```
|
|
10
14
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -23,62 +23,9 @@ bridge_init_json_backend() {
|
|
|
23
23
|
# Internal helper to emit a JSON object.
|
|
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
|
-
json_object_sh() {
|
|
27
|
-
local first=1
|
|
28
|
-
local spec key rest type value
|
|
29
|
-
printf '{'
|
|
30
|
-
for spec in "$@"; do
|
|
31
|
-
[[ -z "$spec" ]] && continue
|
|
32
|
-
key="${spec%%:*}"
|
|
33
|
-
rest="${spec#*:}"
|
|
34
|
-
if [[ "$rest" == "$spec" ]]; then
|
|
35
|
-
rest="s"
|
|
36
|
-
fi
|
|
37
|
-
if [[ "$rest" == *=* ]]; then
|
|
38
|
-
type="${rest%%=*}"
|
|
39
|
-
value="${rest#*=}"
|
|
40
|
-
else
|
|
41
|
-
type="s"
|
|
42
|
-
value="$rest"
|
|
43
|
-
fi
|
|
44
|
-
if [[ $first -eq 0 ]]; then
|
|
45
|
-
printf ','
|
|
46
|
-
fi
|
|
47
|
-
printf '"%s":' "$(json_escape "$key")"
|
|
48
|
-
case "$type" in
|
|
49
|
-
s)
|
|
50
|
-
printf '"%s"' "$(json_escape "$value")"
|
|
51
|
-
;;
|
|
52
|
-
n)
|
|
53
|
-
printf '%s' "${value:-0}"
|
|
54
|
-
;;
|
|
55
|
-
b)
|
|
56
|
-
case "$value" in
|
|
57
|
-
1|true|TRUE|True|yes|on) printf 'true' ;;
|
|
58
|
-
*) printf 'false' ;;
|
|
59
|
-
esac
|
|
60
|
-
;;
|
|
61
|
-
j)
|
|
62
|
-
[[ -n "$value" ]] && printf '%s' "$value" || printf 'null'
|
|
63
|
-
;;
|
|
64
|
-
null)
|
|
65
|
-
printf 'null'
|
|
66
|
-
;;
|
|
67
|
-
*)
|
|
68
|
-
printf '"%s"' "$(json_escape "$value")"
|
|
69
|
-
;;
|
|
70
|
-
esac
|
|
71
|
-
first=0
|
|
72
|
-
done
|
|
73
|
-
printf '}'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
26
|
json_object() {
|
|
77
27
|
bridge_init_json_backend
|
|
78
28
|
case "$BRIDGE_JSON_BACKEND" in
|
|
79
|
-
sh)
|
|
80
|
-
json_object_sh "$@"
|
|
81
|
-
;;
|
|
82
29
|
jq)
|
|
83
30
|
local -a jq_args=()
|
|
84
31
|
local -a jq_expr_parts=()
|
|
@@ -237,28 +184,10 @@ NODE
|
|
|
237
184
|
}
|
|
238
185
|
|
|
239
186
|
# Helper to convert newline-delimited text into a JSON array (dropping trailing blank)
|
|
240
|
-
json_array_from_lines_sh() {
|
|
241
|
-
local input="$1"
|
|
242
|
-
local first=1
|
|
243
|
-
printf '['
|
|
244
|
-
while IFS= read -r line; do
|
|
245
|
-
[[ -z "$line" ]] && continue
|
|
246
|
-
if [[ $first -eq 0 ]]; then
|
|
247
|
-
printf ','
|
|
248
|
-
fi
|
|
249
|
-
printf '"%s"' "$(json_escape "$line")"
|
|
250
|
-
first=0
|
|
251
|
-
done <<<"$input"
|
|
252
|
-
printf ']'
|
|
253
|
-
}
|
|
254
|
-
|
|
255
187
|
json_array_from_lines() {
|
|
256
188
|
bridge_init_json_backend
|
|
257
189
|
local input="$1"
|
|
258
190
|
case "$BRIDGE_JSON_BACKEND" in
|
|
259
|
-
sh)
|
|
260
|
-
json_array_from_lines_sh "$input"
|
|
261
|
-
;;
|
|
262
191
|
jq)
|
|
263
192
|
printf '%s' "$input" | jq -R -s 'split("\n")[:-1]'
|
|
264
193
|
;;
|
|
@@ -292,9 +221,6 @@ json_stringify() {
|
|
|
292
221
|
bridge_init_json_backend
|
|
293
222
|
local input="$1"
|
|
294
223
|
case "$BRIDGE_JSON_BACKEND" in
|
|
295
|
-
sh)
|
|
296
|
-
printf '"%s"' "$(json_escape "$input")"
|
|
297
|
-
;;
|
|
298
224
|
jq)
|
|
299
225
|
printf '%s' "$input" | jq -R -s .
|
|
300
226
|
;;
|
|
@@ -315,28 +241,10 @@ NODE
|
|
|
315
241
|
}
|
|
316
242
|
|
|
317
243
|
# Helper to convert newline-separated JSON objects into an array
|
|
318
|
-
json_array_from_json_lines_sh() {
|
|
319
|
-
local input="$1"
|
|
320
|
-
local first=1
|
|
321
|
-
printf '['
|
|
322
|
-
while IFS= read -r line; do
|
|
323
|
-
[[ -z "$line" ]] && continue
|
|
324
|
-
if [[ $first -eq 0 ]]; then
|
|
325
|
-
printf ','
|
|
326
|
-
fi
|
|
327
|
-
printf '%s' "$line"
|
|
328
|
-
first=0
|
|
329
|
-
done <<<"$input"
|
|
330
|
-
printf ']'
|
|
331
|
-
}
|
|
332
|
-
|
|
333
244
|
json_array_from_json_lines() {
|
|
334
245
|
bridge_init_json_backend
|
|
335
246
|
local input="$1"
|
|
336
247
|
case "$BRIDGE_JSON_BACKEND" in
|
|
337
|
-
sh)
|
|
338
|
-
json_array_from_json_lines_sh "$input"
|
|
339
|
-
;;
|
|
340
248
|
jq)
|
|
341
249
|
printf '%s' "$input" | jq -s .
|
|
342
250
|
;;
|
|
@@ -424,29 +332,9 @@ git_error_summary() {
|
|
|
424
332
|
}
|
|
425
333
|
|
|
426
334
|
# Helper function to output structured worktree data
|
|
427
|
-
json_worktrees_sh() {
|
|
428
|
-
local first=1
|
|
429
|
-
printf '['
|
|
430
|
-
while IFS=$'\t' read -r path branch sha; do
|
|
431
|
-
[[ -z "$path" ]] && continue
|
|
432
|
-
if [[ $first -eq 0 ]]; then
|
|
433
|
-
printf ','
|
|
434
|
-
fi
|
|
435
|
-
printf '{"path":"%s","branch":"%s","sha":"%s"}' \
|
|
436
|
-
"$(json_escape "$path")" \
|
|
437
|
-
"$(json_escape "$branch")" \
|
|
438
|
-
"$(json_escape "$sha")"
|
|
439
|
-
first=0
|
|
440
|
-
done < <(git_list_worktrees)
|
|
441
|
-
printf ']'
|
|
442
|
-
}
|
|
443
|
-
|
|
444
335
|
json_worktrees() {
|
|
445
336
|
bridge_init_json_backend
|
|
446
337
|
case "$BRIDGE_JSON_BACKEND" in
|
|
447
|
-
sh)
|
|
448
|
-
json_worktrees_sh
|
|
449
|
-
;;
|
|
450
338
|
jq)
|
|
451
339
|
git_list_worktrees | jq -R -s '
|
|
452
340
|
split("\n")[:-1] |
|