chore: auto-commit (799 archivos)
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-2
@@ -142,7 +142,8 @@ func (db *DB) InsertType(t *Type) error {
|
||||
}
|
||||
|
||||
// SearchFunctions performs FTS search on functions with optional filters.
|
||||
func (db *DB) SearchFunctions(query string, kind Kind, purity Purity, lang, domain string) ([]Function, error) {
|
||||
// tags filter: each entry must be present in functions.tags JSON array (AND across tags).
|
||||
func (db *DB) SearchFunctions(query string, kind Kind, purity Purity, lang, domain string, tags ...string) ([]Function, error) {
|
||||
where := []string{}
|
||||
args := []any{}
|
||||
|
||||
@@ -166,6 +167,13 @@ func (db *DB) SearchFunctions(query string, kind Kind, purity Purity, lang, doma
|
||||
where = append(where, "f.domain = ?")
|
||||
args = append(args, domain)
|
||||
}
|
||||
for _, t := range tags {
|
||||
if t == "" {
|
||||
continue
|
||||
}
|
||||
where = append(where, "EXISTS (SELECT 1 FROM json_each(f.tags) WHERE value = ?)")
|
||||
args = append(args, t)
|
||||
}
|
||||
|
||||
sql := "SELECT * FROM functions f"
|
||||
if len(where) > 0 {
|
||||
@@ -183,7 +191,8 @@ func (db *DB) SearchFunctions(query string, kind Kind, purity Purity, lang, doma
|
||||
}
|
||||
|
||||
// SearchTypes performs FTS search on types with optional filters.
|
||||
func (db *DB) SearchTypes(query string, lang, domain string) ([]Type, error) {
|
||||
// tags filter: each entry must be present in types.tags JSON array (AND across tags).
|
||||
func (db *DB) SearchTypes(query string, lang, domain string, tags ...string) ([]Type, error) {
|
||||
where := []string{}
|
||||
args := []any{}
|
||||
|
||||
@@ -199,6 +208,13 @@ func (db *DB) SearchTypes(query string, lang, domain string) ([]Type, error) {
|
||||
where = append(where, "t.domain = ?")
|
||||
args = append(args, domain)
|
||||
}
|
||||
for _, t := range tags {
|
||||
if t == "" {
|
||||
continue
|
||||
}
|
||||
where = append(where, "EXISTS (SELECT 1 FROM json_each(t.tags) WHERE value = ?)")
|
||||
args = append(args, t)
|
||||
}
|
||||
|
||||
sql := "SELECT * FROM types t"
|
||||
if len(where) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user