Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions plugins/onex/hooks/scripts/ensure-plugin-venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@
# SPDX-FileCopyrightText: 2025 OmniNode.ai Inc.
# SPDX-License-Identifier: MIT
#
# ensure-plugin-venv.sh — Build plugin venv in CLAUDE_PLUGIN_DATA on first session
# ensure-plugin-venv.sh — Build plugin venv in CLAUDE_PLUGIN_DATA
#
# Runs as a SessionStart hook. Builds a Python venv in the persistent
# CLAUDE_PLUGIN_DATA directory (survives plugin updates). Skips if the venv
# already exists and the marker matches current plugin version + lockfile hash.
# Invoked manually, NOT registered in hooks.json: scripts/repair-plugin-venv.sh
# delegates here, and the onboarding skill documents running it by hand
# (plugins/onex/skills/onboarding/SKILL.md). Builds a Python venv in the
# persistent CLAUDE_PLUGIN_DATA directory (survives plugin updates). Skips if
# the venv already exists and the marker matches current plugin version +
# lockfile hash.
#
# [OMN-10500]

set -euo pipefail

# Load ~/.omnibase/.env so OMNI_HOME and other platform vars are available
# even when not exported by the parent shell.
_GLOBAL_ENV="${HOME}/.omnibase/.env"
if [[ -f "$_GLOBAL_ENV" ]]; then
set -a
# shellcheck disable=SC1090
source "$_GLOBAL_ENV" 2>/dev/null || true
set +a
fi
unset _GLOBAL_ENV

VENV_DIR="${CLAUDE_PLUGIN_DATA:?CLAUDE_PLUGIN_DATA must be set}/.venv"
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT must be set}"
BREW_PY="/opt/homebrew/bin/python3.13"
Expand Down
2 changes: 1 addition & 1 deletion plugins/onex/hooks/scripts/session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if [[ "$OMNICLAUDE_MODE" == "lite" ]]; then
# 3. Exit code 0
#
# NOT initialized: Kafka emit daemon, intelligence context, ticket metadata
echo '{"hookSpecificOutput":{"additionalContext":"omniclaude lite mode active — generic development tooling only"}}'
echo '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"omniclaude lite mode active — generic development tooling only"}}'
exit 0
fi

Expand Down
Loading