1#!/usr/bin/env bash2# session-start.sh — the plugin's SessionStart hook (hooks/hooks.json), also3# run by this repository's own .claude/settings.json in a remote session.4#5# session-start.sh # what Claude Code runs; by hand it does the same6#7# Other agents have no SessionStart hook: they run scripts/bootstrap.sh once8# and source scripts/env.sh, which sets the same variables.9#10# 1. Puts the graphos-factory binary (and the graphos-factory-core link) in11# the bootstrap cache: no network when a binary at least as new as this12# checkout's pin is already there, else scripts/bootstrap.sh downloads the13# release (never --build: a plugin user has no reason to need cargo).14# 2. Appends PATH (the cache's bin/ and ~/.rover/bin),
137echo "supergraph_check runs rover subgraph check only with the user's APOLLO_KEY in the environment and a graph ref: ask once which <graph>@<variant>, then set GRAPHOS_FACTORY_GRAPH_REF on your commands (their GRAPHOS_FACTORY_SUPERGRAPH_CHECK=auto uses \$APOLLO_GRAPH_REF; never set it). Never ask for, set or print the key."
138if missing="$(bash "$SCRIPTS/toolchain.sh" --check 2>&1 >/dev/null)"; then
139 echo "Toolchain: ready (rover, supergraph plugin, Apollo Router, WireMock)."
140else
141 echo "Toolchain: not installed (${missing%%$'\n'*}). Compose, unit, e2e and live need it."
142 echo "Before running them, ask the user, then run: bash \"\$GRAPHOS_FACTORY_CORE_SCRIPTS/toolchain.sh\""
143 echo "It downloads about 100 MB: rover (whose installer edits ~/.profile and ~/.zshenv), its supergraph plugin, the Apollo Router and WireMock."
144 echo "Java 17+ and jq are prerequisites it does not install. The composition plugin and the Apollo Router are under the Elastic License v2 (https://www.elastic.co/licensing/elastic-license). Ask the user once, showing the link; on an explicit yes, set APOLLO_ELV2_LICENSE=accept for the commands you run this session and tell them an \`export\` in their shell profile makes it permanent. Never set it unasked; until it is set, compose, unit, e2e and live report not_run."