Replace the old Go TUI with a web app (port 8470) that runs in a container as a CoreDesktop sibling: - cmd/supermarket server with htmx web UI: dashboard, company profile, inventory (partners/competitors), AI and credential settings, and a Core & Hermes page - SQLite storage and a secrets store under ~/.local/share/supermarket - AI providers (Anthropic, OpenAI-compatible) behind one interface - MCP server and a Hermes bridge to the Federated Core MCP hub - Import of the old Coremarketing TUI's state - install.sh / update.sh / lib.sh, Dockerfile, compose.yaml, the bin/supermarket launcher and hermes/setup.sh Posting is not wired back up yet; that comes in Phase 1. See PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Purpose : Keep Supermarket current (run by CoreDesktop's `update` after it
|
|
# pulls this repository, and by install.sh). Doesn't prompt.
|
|
|
|
set -e
|
|
|
|
SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=lib.sh
|
|
source "$SELF/lib.sh"
|
|
|
|
if ! command -v docker > /dev/null || ! docker info > /dev/null 2>&1; then
|
|
echo "Supermarket: Docker isn't running, or you can't use it yet; skipping."
|
|
echo " Start it with: sudo systemctl start docker (and log out and in once if you were just added to the docker group)."
|
|
exit 1
|
|
fi
|
|
|
|
write_compose_env
|
|
copy_core_conf
|
|
write_ai_servers
|
|
|
|
# The `supermarket` command
|
|
mkdir -p "$HOME/.local/bin"
|
|
if [ -f "$COREDESKTOP/utils.sh" ]; then
|
|
# shellcheck source=/dev/null
|
|
source "$COREDESKTOP/utils.sh"
|
|
install_script "$SELF/bin/supermarket" "$HOME/.local/bin/supermarket"
|
|
else
|
|
install -m 755 "$SELF/bin/supermarket" "$HOME/.local/bin/supermarket"
|
|
fi
|
|
|
|
echo "Supermarket $(version): building and starting its container..."
|
|
compose up -d --build --remove-orphans --quiet-pull
|
|
# Drop the image the rebuild replaced.
|
|
docker image prune -f --filter label=org.opencontainers.image.title=supermarket > /dev/null
|
|
|
|
if wait_until_up 60; then
|
|
echo "Supermarket is running at $URL"
|
|
else
|
|
echo "Supermarket didn't start; see: supermarket logs"
|
|
exit 1
|
|
fi
|