🔄 卡若AI 同步 2026-07-24 09:05 | 更新:更新大文件排除规则;.restore-backups/F22_恢复前_20260723_210051 Skill规则更新;更新SKILL_REGISTRY.md;更新karuo_route.sh;更新SkillSpector扫描处置记录.md;更新对话019f7fde可执行模式复盘.md;更新对话019f7fde通过案例分析.md;更新工具候选与集成规则.md;更新生成业务续执行包.py;更新F22_复扫.json;更新F22_静态扫描.json;更新019f7fde-41d5-7641-9a25-561d9356c193.md;其余1172项见提交文件清单 | 排除 >1MB: 693 个
This commit is contained in:
49
.restore-backups/F22_恢复前_20260723_210051/karuo_route.sh
Executable file
49
.restore-backups/F22_恢复前_20260723_210051/karuo_route.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="/Users/karuo/Documents/个人/卡若AI"
|
||||
REGISTRY="$ROOT/SKILL_REGISTRY.md"
|
||||
|
||||
if [[ ! -f "$REGISTRY" ]]; then
|
||||
echo "Missing registry: $REGISTRY" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
QUERY="${*:-}"
|
||||
if [[ -z "$QUERY" ]]; then
|
||||
echo "Usage: $0 <keyword>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Natural-language queries usually contain several keywords. Searching the
|
||||
# complete sentence as one literal/regex makes valid Skills look unavailable.
|
||||
# Split on whitespace, escape regex metacharacters, and match any useful token.
|
||||
PATTERN="$(
|
||||
printf '%s\n' "$QUERY" |
|
||||
tr '[:space:]' '\n' |
|
||||
awk 'length($0) >= 2 &&
|
||||
tolower($0) != "skill" &&
|
||||
$0 != "请求" &&
|
||||
$0 != "功能" &&
|
||||
$0 != "卡若AI" &&
|
||||
$0 != "卡罗维亚" &&
|
||||
$0 != "卡路AI"' |
|
||||
sed 's/[][(){}.^$*+?|\\/]/\\&/g' |
|
||||
paste -sd'|' -
|
||||
)"
|
||||
|
||||
[[ -n "$PATTERN" ]] || PATTERN="$(printf '%s' "$QUERY" | sed 's/[][(){}.^$*+?|\\/]/\\&/g')"
|
||||
|
||||
# Chinese ASR text often has no spaces. Extract high-value routing terms from
|
||||
# the original sentence so phrases such as “优化破解这个skill” still match.
|
||||
for term in 破甲 破解 越狱回归 请求被拦截 PromptInjection Smali Frida Hook 逆向分析 模拟登录; do
|
||||
compact_query="${QUERY// /}"
|
||||
compact_term="${term// /}"
|
||||
compact_query_lower="$(printf '%s' "$compact_query" | tr '[:upper:]' '[:lower:]')"
|
||||
compact_term_lower="$(printf '%s' "$compact_term" | tr '[:upper:]' '[:lower:]')"
|
||||
if [[ "$compact_query_lower" == *"$compact_term_lower"* ]]; then
|
||||
PATTERN="${PATTERN}|${term}"
|
||||
fi
|
||||
done
|
||||
|
||||
rg -n -i --color never --context 1 -- "$PATTERN" "$REGISTRY" | head -80
|
||||
Reference in New Issue
Block a user