claude-smart 0.2.37 → 0.2.40
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/README.md +32 -39
- package/bin/claude-smart.js +108 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/pyproject.toml +11 -11
- package/plugin/scripts/_lib.sh +26 -0
- package/plugin/scripts/backend-service.sh +17 -1
- package/plugin/scripts/cli.sh +1 -1
- package/plugin/scripts/codex-hook.js +1 -1
- package/plugin/scripts/hook_entry.sh +40 -5
- package/plugin/scripts/smart-install.sh +105 -16
- package/plugin/src/claude_smart/cli.py +139 -16
- package/plugin/src/claude_smart/context_format.py +50 -5
- package/plugin/src/claude_smart/cs_cite.py +12 -1
- package/plugin/src/claude_smart/env_config.py +74 -0
- package/plugin/src/claude_smart/hook_log.py +1 -1
- package/plugin/src/claude_smart/internal_call.py +11 -11
- package/plugin/uv.lock +932 -910
- package/scripts/setup-claude-smart.sh +31 -3
|
@@ -106,6 +106,34 @@ append_env_value() {
|
|
|
106
106
|
chmod 600 "$REFLEXIO_ENV"
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
append_env_raw() {
|
|
110
|
+
local key value
|
|
111
|
+
key="$1"
|
|
112
|
+
value="$2"
|
|
113
|
+
mkdir -p "$(dirname "$REFLEXIO_ENV")"
|
|
114
|
+
touch "$REFLEXIO_ENV"
|
|
115
|
+
chmod 600 "$REFLEXIO_ENV"
|
|
116
|
+
printf '%s=%s\n' "$key" "$value" >> "$REFLEXIO_ENV"
|
|
117
|
+
chmod 600 "$REFLEXIO_ENV"
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ensure_local_env_defaults() {
|
|
121
|
+
mkdir -p "$(dirname "$REFLEXIO_ENV")"
|
|
122
|
+
touch "$REFLEXIO_ENV"
|
|
123
|
+
chmod 600 "$REFLEXIO_ENV"
|
|
124
|
+
if ! get_env_value CLAUDE_SMART_USE_LOCAL_CLI >/dev/null 2>&1; then
|
|
125
|
+
printf '# Route reflexio generation through the local Claude Code CLI\n' >> "$REFLEXIO_ENV"
|
|
126
|
+
append_env_raw CLAUDE_SMART_USE_LOCAL_CLI "1"
|
|
127
|
+
fi
|
|
128
|
+
if ! get_env_value CLAUDE_SMART_USE_LOCAL_EMBEDDING >/dev/null 2>&1; then
|
|
129
|
+
printf '# Use the in-process ONNX embedder (chromadb) - no API key for semantic search\n' >> "$REFLEXIO_ENV"
|
|
130
|
+
append_env_raw CLAUDE_SMART_USE_LOCAL_EMBEDDING "1"
|
|
131
|
+
fi
|
|
132
|
+
if ! get_env_value CLAUDE_SMART_READ_ONLY >/dev/null 2>&1; then
|
|
133
|
+
append_env_value CLAUDE_SMART_READ_ONLY "0"
|
|
134
|
+
fi
|
|
135
|
+
}
|
|
136
|
+
|
|
109
137
|
mask_secret() {
|
|
110
138
|
local value len suffix
|
|
111
139
|
value="$1"
|
|
@@ -283,11 +311,11 @@ main() {
|
|
|
283
311
|
|
|
284
312
|
if [ "$mode" = "local" ]; then
|
|
285
313
|
if [ -f "$REFLEXIO_ENV" ]; then
|
|
286
|
-
remove_env_keys
|
|
314
|
+
remove_env_keys REFLEXIO_API_KEY REFLEXIO_URL REFLEXIO_USER_ID
|
|
287
315
|
log "removed managed Reflexio settings from $REFLEXIO_ENV"
|
|
288
|
-
else
|
|
289
|
-
log "local mode selected; no $REFLEXIO_ENV exists, so no env file was created"
|
|
290
316
|
fi
|
|
317
|
+
ensure_local_env_defaults
|
|
318
|
+
log "configured local Reflexio defaults in $REFLEXIO_ENV"
|
|
291
319
|
install_for_host "$host"
|
|
292
320
|
return 0
|
|
293
321
|
fi
|