diff --git a/standards/launcher-standard.a2ml b/standards/launcher-standard.a2ml index bffdb14..6075d9e 100644 --- a/standards/launcher-standard.a2ml +++ b/standards/launcher-standard.a2ml @@ -15,14 +15,33 @@ # - standards/docs/UX-standards/LM-LA-LIFECYCLE-STANDARD.adoc (install/uninstall) [spec] -version = "0.1.0" -date = "2026-04-10" +version = "0.2.0" +date = "2026-04-17" compliance = [ "launcher-standard.adoc", "LM-LA-LIFECYCLE-STANDARD.adoc", "cross-platform-system-integration-modes", + "fallback-ladder-keepopen", ] +[fallback-ladder] +# keepopen.sh wraps every primary desktop-file Exec line. It turns launcher +# failures from invisible flashes into loud, labelled banners, and lands the +# user in an interactive shell at the repo root if everything fails. +# +# See launcher-standard.adoc §Fallback Ladder for the prose version. +wrapper = "keepopen.sh" +canonical-path = "developer-ecosystem/standards/launcher/keepopen.sh" +deployed-symlink = "/var/mnt/eclipse/repos/.desktop-tools/keepopen.sh" +calling-convention = "keepopen.sh APP_NAME REPO_DIR \"GUI_CMD\" \"TUI_CMD\" [LOG_FILE]" +stages = [ + { name = "gui", colour = "yellow", on-failure = "show-banner-then-try-tui" }, + { name = "tui", colour = "red", on-failure = "show-banner-then-drop-to-shell" }, + { name = "shell", colour = "green", behaviour = "exec-bash-login-at-repo-dir" }, +] +banner-visibility = "loud" # Intentionally ugly — visibility beats aesthetics. +final-shell = "bash -l at REPO_DIR (never 'press enter to close')" + [required-modes] # These are the modes every compliant launcher MUST implement. runtime = ["--start", "--stop", "--status", "--auto", "--browser"] diff --git a/templates/launcher.sh.tera b/templates/launcher.sh.tera index 9239263..ba64723 100644 --- a/templates/launcher.sh.tera +++ b/templates/launcher.sh.tera @@ -325,6 +325,27 @@ write_linux_desktop_file() { else icon_name="package-x-generic" fi + + # keepopen.sh implements the standard fallback ladder: GUI → TUI → + # bash-at-repo-root. See launcher-standard.adoc §Fallback Ladder. + local keepopen="/var/mnt/eclipse/repos/.desktop-tools/keepopen.sh" + local gui_cmd tui_cmd +{% if runtime_kind == "server-url" -%} + # server-url: GUI = start server + open browser + tail log (so terminal + # stays open); TUI = start-only + follow log; Shell = repo root. + gui_cmd="$LAUNCHER_TARGET --auto && tail -f $LOG_FILE" + tui_cmd="$LAUNCHER_TARGET --start && tail -f $LOG_FILE" +{%- elif runtime_kind == "remote" -%} + # remote: GUI = open remote URL; TUI = print status; Shell = repo root. + gui_cmd="$LAUNCHER_TARGET --browser" + tui_cmd="$LAUNCHER_TARGET --status" +{%- else -%} + # process: GUI = start then tail log so terminal stays open; + # TUI = just tail the existing log; Shell = repo root. + gui_cmd="$LAUNCHER_TARGET --start && tail -f $LOG_FILE" + tui_cmd="tail -n 200 -f $LOG_FILE" +{%- endif %} + cat > "$target" <