@ivoryheart/herdr-world 0.1.1 → 0.2.0-rc.2

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.
Files changed (74) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +167 -28
  3. package/bin/herdr-world.mjs +66 -0
  4. package/package.json +18 -22
  5. package/THIRD_PARTY_NOTICES.md +0 -61
  6. package/UPSTREAM.md +0 -65
  7. package/bin/herdr-world +0 -133
  8. package/docs/world-assets.md +0 -51
  9. package/lib/bridges/linux-x64/herdr-world-bridge +0 -0
  10. package/lib/bridges/macos-arm64/herdr-world-bridge +0 -0
  11. package/lib/bridges/macos-x64/herdr-world-bridge +0 -0
  12. package/lib/herdr-world-launcher.sh +0 -533
  13. package/share/herdr-world/web/assets/BufferResource-TmONtVkO.js +0 -311
  14. package/share/herdr-world/web/assets/CanvasPool-C4EP4giG.js +0 -1
  15. package/share/herdr-world/web/assets/GraphTheme-DdAfatoM.js +0 -1
  16. package/share/herdr-world/web/assets/NoteMarkdownPreview-Crh3odMO.js +0 -29
  17. package/share/herdr-world/web/assets/SpacesSurface-KQpjWcgW.js +0 -1
  18. package/share/herdr-world/web/assets/WorldSurface-4GHZpnMP.js +0 -369
  19. package/share/herdr-world/web/assets/WorldThemeStage-Da7LFwo3.js +0 -1
  20. package/share/herdr-world/web/assets/__vite-browser-external-2447137e-BvRk9kiK.js +0 -0
  21. package/share/herdr-world/web/assets/browserAll-B258yZD2.js +0 -1
  22. package/share/herdr-world/web/assets/chunk-QTnfLwEv.js +0 -1
  23. package/share/herdr-world/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  24. package/share/herdr-world/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  25. package/share/herdr-world/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  26. package/share/herdr-world/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  27. package/share/herdr-world/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  28. package/share/herdr-world/web/assets/getBatchSamplersUniformGroup-D-hqfegN.js +0 -1
  29. package/share/herdr-world/web/assets/ghostty-web-CMdhZEut.js +0 -13
  30. package/share/herdr-world/web/assets/index-B8V-qiZs.js +0 -18
  31. package/share/herdr-world/web/assets/index-DSq8fuVk.css +0 -1
  32. package/share/herdr-world/web/assets/init-BCuNUfJx.js +0 -1
  33. package/share/herdr-world/web/assets/jsx-runtime-BWRPWl8p.js +0 -1
  34. package/share/herdr-world/web/assets/localUniformBit-BnogyqF-.js +0 -264
  35. package/share/herdr-world/web/assets/web-Bev77txP.js +0 -1
  36. package/share/herdr-world/web/assets/web-CCyAvF9M.js +0 -1
  37. package/share/herdr-world/web/assets/webworkerAll-B5q9qlVj.js +0 -1
  38. package/share/herdr-world/web/fonts/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
  39. package/share/herdr-world/web/fonts/OFL.txt +0 -93
  40. package/share/herdr-world/web/herdr-logo-180.png +0 -0
  41. package/share/herdr-world/web/herdr-logo-192.png +0 -0
  42. package/share/herdr-world/web/herdr-logo-512.png +0 -0
  43. package/share/herdr-world/web/herdr-logo-maskable-192.png +0 -0
  44. package/share/herdr-world/web/herdr-logo-maskable-512.png +0 -0
  45. package/share/herdr-world/web/herdr-logo.svg +0 -6
  46. package/share/herdr-world/web/index.html +0 -25
  47. package/share/herdr-world/web/legal/Apache-2.0.txt +0 -190
  48. package/share/herdr-world/web/legal/LICENSE.txt +0 -22
  49. package/share/herdr-world/web/legal/PixiJS-MIT.txt +0 -21
  50. package/share/herdr-world/web/legal/THIRD_PARTY_NOTICES.md +0 -61
  51. package/share/herdr-world/web/legal/UPSTREAM.md +0 -65
  52. package/share/herdr-world/web/legal/manifest.json +0 -33
  53. package/share/herdr-world/web/legal/npm-licenses.txt +0 -1381
  54. package/share/herdr-world/web/legal/world-assets.md +0 -51
  55. package/share/herdr-world/web/manifest.json +0 -42
  56. package/share/herdr-world/web/world/LICENSE-PixiJS.txt +0 -21
  57. package/share/herdr-world/web/world/characters/1-D-1.png +0 -0
  58. package/share/herdr-world/web/world/characters/10-D-1.png +0 -0
  59. package/share/herdr-world/web/world/characters/11-D-1.png +0 -0
  60. package/share/herdr-world/web/world/characters/12-D-1.png +0 -0
  61. package/share/herdr-world/web/world/characters/2-D-1.png +0 -0
  62. package/share/herdr-world/web/world/characters/3-D-1.png +0 -0
  63. package/share/herdr-world/web/world/characters/4-D-1.png +0 -0
  64. package/share/herdr-world/web/world/characters/5-D-1.png +0 -0
  65. package/share/herdr-world/web/world/characters/6-D-1.png +0 -0
  66. package/share/herdr-world/web/world/characters/7-D-1.png +0 -0
  67. package/share/herdr-world/web/world/characters/8-D-1.png +0 -0
  68. package/share/herdr-world/web/world/characters/9-D-1.png +0 -0
  69. package/third_party/dependencies/README.md +0 -22
  70. package/third_party/dependencies/cargo-licenses.html +0 -7696
  71. package/third_party/dependencies/npm-licenses.txt +0 -1381
  72. package/third_party/licenses/Apache-2.0.txt +0 -190
  73. package/third_party/licenses/PixiJS-MIT.txt +0 -21
  74. package/vendor/herdr-compat/VENDOR-MANIFEST.toml +0 -186
@@ -1,533 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- herdr_world_resolve_script() {
5
- local source="$1"
6
- local link_dir=""
7
- local link_target=""
8
-
9
- while [[ -L "$source" ]]; do
10
- link_dir="$(cd -P "$(dirname "$source")" && pwd)"
11
- link_target="$(readlink "$source")"
12
- case "$link_target" in
13
- /*) source="$link_target" ;;
14
- *) source="$link_dir/$link_target" ;;
15
- esac
16
- done
17
-
18
- printf '%s\n' "$source"
19
- }
20
-
21
- LAUNCHER_PATH="$(herdr_world_resolve_script "${BASH_SOURCE[0]}")"
22
- BIN_DIR="$(cd "$(dirname "$LAUNCHER_PATH")" && pwd)"
23
- BUNDLE_ROOT="$(cd "$BIN_DIR/.." && pwd)"
24
- BRIDGE_BIN="${HERDR_WORLD_BRIDGE_BIN:-$BIN_DIR/herdr-world-bridge}"
25
- STATIC_DIR="${HERDR_WORLD_STATIC_DIR:-$BUNDLE_ROOT/share/herdr-world/web}"
26
-
27
- HERDR_INSTALLER_URL="https://herdr.dev/install.sh"
28
- HERDR_INSTALL_DOCS_URL="https://herdr.dev/docs/install/"
29
- HERDR_MINIMUM_VERSION="v0.8.2"
30
- HERDR_TERMINAL_PROTOCOL="20"
31
-
32
- herdr_world_default_socket() {
33
- local config_home="${XDG_CONFIG_HOME:-}"
34
- if [[ -z "$config_home" ]]; then
35
- [[ -n "${HOME:-}" ]] || return 1
36
- config_home="$HOME/.config"
37
- fi
38
- printf '%s/herdr/herdr.sock\n' "$config_home"
39
- }
40
-
41
- herdr_world_socket_ready() {
42
- [[ -S "$1" ]]
43
- }
44
-
45
- herdr_world_find_binary() {
46
- local found=""
47
- if found="$(command -v herdr 2>/dev/null)" && [[ -n "$found" ]]; then
48
- printf '%s\n' "$found"
49
- return 0
50
- fi
51
-
52
- if [[ -n "${HERDR_INSTALL_DIR:-}" && -x "$HERDR_INSTALL_DIR/herdr" ]]; then
53
- printf '%s/herdr\n' "$HERDR_INSTALL_DIR"
54
- return 0
55
- fi
56
-
57
- if [[ -n "${HOME:-}" && -x "$HOME/.local/bin/herdr" ]]; then
58
- printf '%s/.local/bin/herdr\n' "$HOME"
59
- return 0
60
- fi
61
-
62
- return 1
63
- }
64
-
65
- herdr_world_find_installer_binary() {
66
- if [[ -n "${HERDR_INSTALL_DIR:-}" && -x "$HERDR_INSTALL_DIR/herdr" ]]; then
67
- printf '%s/herdr\n' "$HERDR_INSTALL_DIR"
68
- return 0
69
- fi
70
-
71
- if [[ -n "${HOME:-}" && -x "$HOME/.local/bin/herdr" ]]; then
72
- printf '%s/.local/bin/herdr\n' "$HOME"
73
- return 0
74
- fi
75
-
76
- herdr_world_find_binary
77
- }
78
-
79
- herdr_world_version_is_supported() {
80
- local version="$1"
81
- local major
82
- local minor
83
- local patch
84
-
85
- version="${version#v}"
86
- if [[ ! "$version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)([-+].*)?$ ]]; then
87
- return 1
88
- fi
89
- major="${BASH_REMATCH[1]}"
90
- minor="${BASH_REMATCH[2]}"
91
- patch="${BASH_REMATCH[3]}"
92
-
93
- (( major > 0 || minor > 8 || (minor == 8 && patch >= 2) ))
94
- }
95
-
96
- herdr_world_binary_is_supported() {
97
- local herdr_bin="$1"
98
- local version_output=""
99
- local version=""
100
-
101
- version_output="$("$herdr_bin" -V 2>/dev/null)" || return 1
102
- version="${version_output##* }"
103
- herdr_world_version_is_supported "$version"
104
- }
105
-
106
- herdr_world_server_is_supported() {
107
- local herdr_bin="$1"
108
- local status_output=""
109
- local server_fields=""
110
- local server_version=""
111
- local server_protocol=""
112
- local server_compatible=""
113
-
114
- status_output="$("$herdr_bin" status 2>/dev/null)" || return 1
115
- server_fields="$(printf '%s\n' "$status_output" | awk '
116
- $0 == "server:" { in_server = 1; next }
117
- in_server && $0 !~ /^ / { in_server = 0 }
118
- in_server && $1 == "version:" { version = $2 }
119
- in_server && $1 == "protocol:" { protocol = $2 }
120
- in_server && $1 == "compatible:" { compatible = $2 }
121
- END { printf "%s\t%s\t%s\n", version, protocol, compatible }
122
- ')"
123
- IFS=$'\t' read -r server_version server_protocol server_compatible <<<"$server_fields"
124
-
125
- herdr_world_version_is_supported "$server_version" \
126
- && [[ "$server_protocol" == "$HERDR_TERMINAL_PROTOCOL" ]] \
127
- && [[ "$server_compatible" == "yes" ]]
128
- }
129
-
130
- herdr_world_server_is_reachable() {
131
- local herdr_bin="$1"
132
- local status_output=""
133
- local server_state=""
134
-
135
- status_output="$("$herdr_bin" status 2>/dev/null)" || return 1
136
- server_state="$(printf '%s\n' "$status_output" | awk '
137
- $0 == "server:" { in_server = 1; next }
138
- in_server && $0 !~ /^ / { in_server = 0 }
139
- in_server && $1 == "status:" { print $2; exit }
140
- ')"
141
- [[ "$server_state" == "running" ]]
142
- }
143
-
144
- herdr_world_is_interactive() {
145
- [[ -t 0 && -t 2 ]]
146
- }
147
-
148
- herdr_world_confirm() {
149
- local prompt="$1"
150
- local answer=""
151
- printf '%s [y/N] ' "$prompt" >&2
152
- IFS= read -r answer || return 1
153
- case "$answer" in
154
- y | Y | yes | YES | Yes) return 0 ;;
155
- *) return 1 ;;
156
- esac
157
- }
158
-
159
- herdr_world_manual_instructions() {
160
- cat >&2 <<EOF
161
- Herdr World needs a running Herdr ${HERDR_MINIMUM_VERSION} or newer session using terminal protocol ${HERDR_TERMINAL_PROTOCOL}.
162
-
163
- Install Herdr using the official instructions:
164
- ${HERDR_INSTALL_DOCS_URL}
165
-
166
- Then start it from the directory containing the work you want Herdr to manage:
167
- cd /path/to/your/project
168
- herdr
169
-
170
- Detach from Herdr with Ctrl+B, then Q, and run herdr-world again
171
- (or bin/herdr-world from a portable bundle).
172
- EOF
173
- }
174
-
175
- herdr_world_help() {
176
- cat <<'EOF'
177
- Usage: herdr-world [OPTIONS]
178
- herdr-world task-summary [TEXT] [--ttl-ms N] [--pane ID] [--session NAME]
179
- herdr-world task-summary --clear [--pane ID] [--session NAME]
180
-
181
- Starts the Herdr World browser bridge for the selected Herdr session.
182
-
183
- The task-summary command reports bounded, expiring harness metadata for the
184
- current Herdr pane without starting the browser bridge.
185
-
186
- Options are forwarded to the bridge:
187
- --host HOST Bind address (loopback by default)
188
- --port PORT HTTP port (8787 by default)
189
- --session NAME Select a named Herdr session
190
- --no-herdr-setup Disable interactive Herdr setup
191
- -h, --help Show this help without starting Herdr or a bridge
192
-
193
- The bridge requires Herdr 0.8.2 or newer with terminal protocol 20.
194
- EOF
195
- }
196
-
197
- herdr_world_install() {
198
- if ! command -v curl >/dev/null 2>&1; then
199
- echo "Cannot install Herdr automatically because curl is not available." >&2
200
- return 1
201
- fi
202
-
203
- local installer_dir=""
204
- local installer_path=""
205
- installer_dir="$(mktemp -d "${TMPDIR:-/tmp}/herdr-world-install.XXXXXX")"
206
- installer_path="$installer_dir/install.sh"
207
-
208
- if ! curl --proto '=https' --tlsv1.2 -fsSL "$HERDR_INSTALLER_URL" -o "$installer_path"; then
209
- rm -rf -- "$installer_dir"
210
- echo "Could not download the official Herdr installer." >&2
211
- return 1
212
- fi
213
-
214
- if ! sh "$installer_path"; then
215
- rm -rf -- "$installer_dir"
216
- echo "The Herdr installer did not complete successfully." >&2
217
- return 1
218
- fi
219
-
220
- rm -rf -- "$installer_dir"
221
- }
222
-
223
- herdr_world_ensure_supported_binary() {
224
- local herdr_bin=""
225
-
226
- if herdr_bin="$(herdr_world_find_binary)" && herdr_world_binary_is_supported "$herdr_bin"; then
227
- printf '%s\n' "$herdr_bin"
228
- return 0
229
- fi
230
-
231
- if [[ -n "$herdr_bin" ]]; then
232
- cat >&2 <<EOF
233
- The installed Herdr executable is older than ${HERDR_MINIMUM_VERSION}:
234
- $herdr_bin
235
-
236
- Herdr World can download ${HERDR_INSTALLER_URL} over HTTPS and run it locally
237
- to install the latest stable Herdr.
238
- EOF
239
- else
240
- cat >&2 <<EOF
241
- Herdr is not installed or is not available on PATH.
242
-
243
- Herdr World can download ${HERDR_INSTALLER_URL} over HTTPS and run it locally.
244
- The official installer installs the latest stable Herdr (normally under ~/.local/bin)
245
- and verifies the downloaded Herdr binary checksum. Herdr and Herdr World remain
246
- separate commands and installations.
247
- EOF
248
- fi
249
-
250
- if ! herdr_world_confirm "Download and run the official Herdr installer now?"; then
251
- herdr_world_manual_instructions
252
- return 1
253
- fi
254
- # This function's stdout is its resolved-binary return value. The official
255
- # installer is intentionally chatty on stdout, so display that output on the
256
- # launcher diagnostic stream instead of capturing it as part of the path.
257
- if ! herdr_world_install >&2; then
258
- herdr_world_manual_instructions
259
- return 1
260
- fi
261
- if ! herdr_bin="$(herdr_world_find_installer_binary)"; then
262
- echo "Herdr was installed, but its executable could not be found." >&2
263
- herdr_world_manual_instructions
264
- return 1
265
- fi
266
- if ! herdr_world_binary_is_supported "$herdr_bin"; then
267
- echo "The installed Herdr executable is still older than ${HERDR_MINIMUM_VERSION}." >&2
268
- herdr_world_manual_instructions
269
- return 1
270
- fi
271
-
272
- printf '%s\n' "$herdr_bin"
273
- }
274
-
275
- herdr_world_choose_workspace() {
276
- local default_dir="$PWD"
277
- local answer=""
278
- local resolved=""
279
-
280
- case "$PWD/" in
281
- "$BUNDLE_ROOT/"*)
282
- default_dir=""
283
- echo "Choose a project directory; the unpacked Herdr World bundle should not become your Herdr workspace." >&2
284
- ;;
285
- esac
286
-
287
- while true; do
288
- if [[ -n "$default_dir" ]]; then
289
- printf 'Directory containing the work Herdr should manage [%s]: ' "$default_dir" >&2
290
- else
291
- printf 'Directory containing the work Herdr should manage: ' >&2
292
- fi
293
- IFS= read -r answer || return 1
294
- answer="${answer:-$default_dir}"
295
-
296
- if [[ "$answer" == "~/"* && -n "${HOME:-}" ]]; then
297
- answer="$HOME/${answer#\~/}"
298
- fi
299
- if [[ -z "$answer" || ! -d "$answer" ]]; then
300
- echo "Enter an existing directory." >&2
301
- continue
302
- fi
303
-
304
- resolved="$(cd "$answer" && pwd -P)"
305
- printf '%s\n' "$resolved"
306
- return 0
307
- done
308
- }
309
-
310
- herdr_world_run_herdr() {
311
- local herdr_bin="$1"
312
- local workspace="$2"
313
- (
314
- cd "$workspace"
315
- "$herdr_bin"
316
- )
317
- }
318
-
319
- herdr_world_wait_for_server() {
320
- local herdr_bin="$1"
321
- local attempt
322
- for attempt in {1..50}; do
323
- if herdr_world_server_is_supported "$herdr_bin"; then
324
- return 0
325
- fi
326
- sleep 0.1
327
- done
328
- return 1
329
- }
330
-
331
- herdr_world_wait_for_server_to_stop() {
332
- local herdr_bin="$1"
333
- local attempt
334
- for attempt in {1..50}; do
335
- if ! herdr_world_server_is_reachable "$herdr_bin"; then
336
- return 0
337
- fi
338
- sleep 0.1
339
- done
340
- return 1
341
- }
342
-
343
- herdr_world_stop_herdr() {
344
- local herdr_bin="$1"
345
- "$herdr_bin" server stop
346
- }
347
-
348
- herdr_world_exec_bridge() {
349
- exec "$BRIDGE_BIN" --static-dir "$STATIC_DIR" "$@"
350
- }
351
-
352
- herdr_world_exec_task_summary() {
353
- exec "$BRIDGE_BIN" task-summary "$@"
354
- }
355
-
356
- herdr_world_start_bridge() {
357
- local -a args=("$@")
358
- local port="8787"
359
- local index
360
-
361
- for ((index = 0; index < ${#args[@]}; index += 1)); do
362
- case "${args[$index]}" in
363
- --port)
364
- if ((index + 1 < ${#args[@]})); then
365
- port="${args[$((index + 1))]}"
366
- fi
367
- ;;
368
- --port=*) port="${args[$index]#--port=}" ;;
369
- esac
370
- done
371
-
372
- echo "Herdr is running; starting Herdr World at http://127.0.0.1:$port (press Ctrl+C to stop)." >&2
373
- herdr_world_exec_bridge "${args[@]+"${args[@]}"}"
374
- }
375
-
376
- herdr_world_main() {
377
- local -a bridge_args=()
378
- local setup_enabled=true
379
- local arg
380
- local default_socket=""
381
- local herdr_bin=""
382
- local workspace=""
383
- local socket_is_ready=false
384
-
385
- if [[ "${1:-}" == "task-summary" ]]; then
386
- shift
387
- herdr_world_exec_task_summary "$@"
388
- return
389
- fi
390
-
391
- for arg in "$@"; do
392
- if [[ "$arg" == "--no-herdr-setup" ]]; then
393
- setup_enabled=false
394
- else
395
- bridge_args+=("$arg")
396
- fi
397
- done
398
-
399
- for arg in "${bridge_args[@]+"${bridge_args[@]}"}"; do
400
- case "$arg" in
401
- -h | --help)
402
- herdr_world_help
403
- return
404
- ;;
405
- esac
406
- done
407
-
408
- # Explicit sessions and socket paths are operator-managed. The launcher must
409
- # not create or start a different default session in response to their state.
410
- for arg in "${bridge_args[@]+"${bridge_args[@]}"}"; do
411
- case "$arg" in
412
- --session | --session=*)
413
- herdr_world_exec_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
414
- return
415
- ;;
416
- esac
417
- done
418
- if [[ -n "${HERDR_SOCKET_PATH:-}" || -n "${HERDR_CLIENT_SOCKET_PATH:-}" || -n "${HERDR_SESSION:-}" ]]; then
419
- herdr_world_exec_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
420
- return
421
- fi
422
-
423
- if ! default_socket="$(herdr_world_default_socket)"; then
424
- echo "Herdr World could not determine the default Herdr socket because HOME and XDG_CONFIG_HOME are unset." >&2
425
- herdr_world_manual_instructions
426
- return 1
427
- fi
428
-
429
- case "${HERDR_WORLD_SETUP:-auto}" in
430
- never | off | 0) setup_enabled=false ;;
431
- esac
432
-
433
- if herdr_world_socket_ready "$default_socket"; then
434
- socket_is_ready=true
435
- if herdr_bin="$(herdr_world_find_binary)" \
436
- && herdr_world_binary_is_supported "$herdr_bin" \
437
- && herdr_world_server_is_supported "$herdr_bin"; then
438
- herdr_world_start_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
439
- return
440
- fi
441
-
442
- if [[ -n "$herdr_bin" ]] \
443
- && herdr_world_binary_is_supported "$herdr_bin" \
444
- && ! herdr_world_server_is_reachable "$herdr_bin"; then
445
- socket_is_ready=false
446
- fi
447
-
448
- # Preserve non-interactive and explicitly disabled behavior. The bridge
449
- # remains the authority for the detailed compatibility error in this path.
450
- if [[ "$setup_enabled" != true ]] || ! herdr_world_is_interactive; then
451
- herdr_world_exec_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
452
- return
453
- fi
454
- fi
455
-
456
- if [[ "$setup_enabled" != true ]] || ! herdr_world_is_interactive; then
457
- echo "No running default Herdr session was found at $default_socket." >&2
458
- herdr_world_manual_instructions
459
- return 1
460
- fi
461
-
462
- if ! herdr_bin="$(herdr_world_ensure_supported_binary)"; then
463
- return 1
464
- fi
465
-
466
- if [[ "$socket_is_ready" == true ]]; then
467
- if herdr_world_server_is_supported "$herdr_bin"; then
468
- herdr_world_start_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
469
- return
470
- fi
471
-
472
- if ! herdr_world_server_is_reachable "$herdr_bin"; then
473
- socket_is_ready=false
474
- cat >&2 <<EOF
475
- A stale Herdr socket was found at $default_socket, but no server is running.
476
- Continuing with normal Herdr startup.
477
- EOF
478
- fi
479
- fi
480
-
481
- if [[ "$socket_is_ready" == true ]]; then
482
- cat >&2 <<EOF
483
- The running default Herdr server is incompatible with Herdr World.
484
-
485
- It must be stopped before the current Herdr can start. Stopping it exits the
486
- terminal panes and processes owned by that server.
487
- EOF
488
- if ! herdr_world_confirm "Stop the incompatible Herdr server now?"; then
489
- herdr_world_manual_instructions
490
- return 1
491
- fi
492
- if ! herdr_world_stop_herdr "$herdr_bin"; then
493
- echo "The incompatible Herdr server could not be stopped." >&2
494
- herdr_world_manual_instructions
495
- return 1
496
- fi
497
- if ! herdr_world_wait_for_server_to_stop "$herdr_bin"; then
498
- echo "The incompatible Herdr server did not stop." >&2
499
- herdr_world_manual_instructions
500
- return 1
501
- fi
502
- fi
503
-
504
- cat >&2 <<EOF
505
-
506
- Herdr is available at: $herdr_bin
507
- Starting it opens the Herdr terminal UI. Detach with Ctrl+B, then Q; the Herdr
508
- server remains active and this launcher will then continue with Herdr World.
509
- EOF
510
- if ! herdr_world_confirm "Start Herdr now?"; then
511
- herdr_world_manual_instructions
512
- return 1
513
- fi
514
- if ! workspace="$(herdr_world_choose_workspace)"; then
515
- echo "Herdr was not started because no workspace directory was selected." >&2
516
- return 1
517
- fi
518
- if ! herdr_world_run_herdr "$herdr_bin" "$workspace"; then
519
- echo "Herdr exited with an error; Herdr World was not started." >&2
520
- return 1
521
- fi
522
- if ! herdr_world_wait_for_server "$herdr_bin"; then
523
- echo "Herdr returned, but no compatible running session appeared at $default_socket." >&2
524
- herdr_world_manual_instructions
525
- return 1
526
- fi
527
-
528
- herdr_world_start_bridge "${bridge_args[@]+"${bridge_args[@]}"}"
529
- }
530
-
531
- if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
532
- herdr_world_main "$@"
533
- fi