own-rag-cli 0.0.7-snapshot → 0.0.8-snapshot
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.
- package/bin/postinstall.sh +17 -1
- package/package.json +1 -1
- package/rag-setup-macos.run +6 -1
- package/rag-setup.run +6 -1
package/bin/postinstall.sh
CHANGED
|
@@ -35,6 +35,14 @@ ALIAS_LINE="alias rag='~/.local/bin/rag-wrapper.sh'"
|
|
|
35
35
|
log_info() { printf "[+] %s\n" "$*"; }
|
|
36
36
|
log_warn() { printf "[!] %s\n" "$*" >&2; }
|
|
37
37
|
|
|
38
|
+
ask_yes_no_default_no() {
|
|
39
|
+
local prompt="$1"
|
|
40
|
+
local answer=""
|
|
41
|
+
read -r -p "${prompt} [y/N] " answer || return 1
|
|
42
|
+
answer="$(printf "%s" "${answer}" | tr '[:upper:]' '[:lower:]')"
|
|
43
|
+
[[ "${answer}" == "y" || "${answer}" == "yes" || "${answer}" == "s" || "${answer}" == "sim" ]]
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
ensure_own_rag_cli_config() {
|
|
39
47
|
python3 - "${OWN_RAG_CONFIG_FILE}" <<'PYEOF'
|
|
40
48
|
import json
|
|
@@ -309,7 +317,15 @@ if command -v claude >/dev/null 2>&1 || [[ -d "${HOME}/.claude" ]] || [[ -f "${C
|
|
|
309
317
|
fi
|
|
310
318
|
|
|
311
319
|
if command -v codex >/dev/null 2>&1 || [[ -d "${HOME}/.codex" ]] || [[ -f "${CODEX_CONFIG_FILE}" ]]; then
|
|
312
|
-
|
|
320
|
+
if [[ -t 0 ]]; then
|
|
321
|
+
if ask_yes_no_default_no "Deseja adicionar/atualizar o MCP 'rag-codebase' no Codex?"; then
|
|
322
|
+
ensure_codex_mcp_config || true
|
|
323
|
+
else
|
|
324
|
+
log_info "Configuração MCP do Codex ignorada por escolha do usuário."
|
|
325
|
+
fi
|
|
326
|
+
else
|
|
327
|
+
log_info "Sem terminal interativo: pulando configuração automática do MCP no Codex."
|
|
328
|
+
fi
|
|
313
329
|
fi
|
|
314
330
|
|
|
315
331
|
if [[ -f "${WRAPPER_SRC}" ]]; then
|
package/package.json
CHANGED
package/rag-setup-macos.run
CHANGED
|
@@ -1104,6 +1104,11 @@ if command -v codex &>/dev/null || [[ -d "${USER_HOME}/.codex" ]]; then
|
|
|
1104
1104
|
fi
|
|
1105
1105
|
|
|
1106
1106
|
configure_codex_mcp() {
|
|
1107
|
+
if check_codex_mcp_up_to_date; then
|
|
1108
|
+
echo "ok:already_exists"
|
|
1109
|
+
return 0
|
|
1110
|
+
fi
|
|
1111
|
+
|
|
1107
1112
|
if command -v codex &>/dev/null; then
|
|
1108
1113
|
codex mcp remove rag-codebase >/dev/null 2>&1 || true
|
|
1109
1114
|
if codex mcp add rag-codebase \
|
|
@@ -1317,7 +1322,7 @@ PYEOF
|
|
|
1317
1322
|
fi
|
|
1318
1323
|
done
|
|
1319
1324
|
|
|
1320
|
-
if [[ "${CODEX_APP_INSTALLED}" == "true" ]]
|
|
1325
|
+
if [[ "${CODEX_APP_INSTALLED}" == "true" ]]; then
|
|
1321
1326
|
PENDING_CONFIGS+=("${CODEX_CONFIG_TOML}")
|
|
1322
1327
|
PENDING_LABELS+=("Codex")
|
|
1323
1328
|
fi
|
package/rag-setup.run
CHANGED
|
@@ -1142,6 +1142,11 @@ if command -v codex &>/dev/null || [[ -d "${USER_HOME}/.codex" ]]; then
|
|
|
1142
1142
|
fi
|
|
1143
1143
|
|
|
1144
1144
|
configure_codex_mcp() {
|
|
1145
|
+
if check_codex_mcp_up_to_date; then
|
|
1146
|
+
echo "ok:already_exists"
|
|
1147
|
+
return 0
|
|
1148
|
+
fi
|
|
1149
|
+
|
|
1145
1150
|
if command -v codex &>/dev/null; then
|
|
1146
1151
|
codex mcp remove rag-codebase >/dev/null 2>&1 || true
|
|
1147
1152
|
if codex mcp add rag-codebase \
|
|
@@ -1355,7 +1360,7 @@ PYEOF
|
|
|
1355
1360
|
fi
|
|
1356
1361
|
done
|
|
1357
1362
|
|
|
1358
|
-
if [[ "${CODEX_APP_INSTALLED}" == "true" ]]
|
|
1363
|
+
if [[ "${CODEX_APP_INSTALLED}" == "true" ]]; then
|
|
1359
1364
|
PENDING_CONFIGS+=("${CODEX_CONFIG_TOML}")
|
|
1360
1365
|
PENDING_LABELS+=("Codex")
|
|
1361
1366
|
fi
|