cf-mcp 0.9.3 → 0.10.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/cf/mcp/models/doc_item.rb +33 -16
- data/lib/cf/mcp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fa40d95e95c2179eeaa55f22e374232510ee6857aec12ca73ab5c438d9808f16
|
|
4
|
+
data.tar.gz: 1047aa59ffc741fb792778037a9e958ee3af42fec332a0653882a351277ef10f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dac224a9ccf242b04a8d8a801b148f71bf1e9326bf8550560045b2e34ef8501e60f44a7bfd0ea14b06d762c0ddde9b82e50e4896dd2dd7a2489ee823658f9fa3
|
|
7
|
+
data.tar.gz: 8ebd60174ed5d853121255db222fb34ee4baa7c033d2ebfdd0fc246d9f5cdfe5cf824a18926e49591c34b052154fdd78623e5b25675bcf4b09521f6107260796
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.10.0] - 2026-01-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Multi-keyword search support: queries like "draw circle rectangle" now match items containing any keyword
|
|
13
|
+
- Items matching more keywords rank higher in search results
|
|
14
|
+
|
|
8
15
|
## [0.9.3] - 2026-01-14
|
|
9
16
|
|
|
10
17
|
### Added
|
|
@@ -105,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
105
112
|
- `cf_list_category` - List items by category
|
|
106
113
|
- `cf_get_details` - Get full documentation by name
|
|
107
114
|
|
|
115
|
+
[0.10.0]: https://github.com/pusewicz/cf-mcp/compare/v0.9.3...v0.10.0
|
|
108
116
|
[0.9.3]: https://github.com/pusewicz/cf-mcp/compare/v0.9.2...v0.9.3
|
|
109
117
|
[0.9.2]: https://github.com/pusewicz/cf-mcp/compare/v0.9.1...v0.9.2
|
|
110
118
|
[0.9.1]: https://github.com/pusewicz/cf-mcp/compare/v0.9.0...v0.9.1
|
|
@@ -37,45 +37,62 @@ module CF
|
|
|
37
37
|
def matches?(query)
|
|
38
38
|
return true if query.nil? || query.empty?
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
keywords = query.split(/\s+/).reject(&:empty?)
|
|
41
|
+
return true if keywords.empty?
|
|
42
|
+
|
|
43
|
+
keywords.any? do |keyword|
|
|
44
|
+
pattern = Regexp.new(Regexp.escape(keyword), Regexp::IGNORECASE)
|
|
45
|
+
[name, brief, remarks, category].any? { |field| field&.match?(pattern) }
|
|
46
|
+
end
|
|
42
47
|
end
|
|
43
48
|
|
|
44
49
|
# Returns a relevance score for ranking search results.
|
|
45
50
|
# Higher scores indicate better matches.
|
|
51
|
+
# Supports multi-keyword queries - scores are summed across all keywords.
|
|
46
52
|
def relevance_score(query)
|
|
47
53
|
return 0 if query.nil? || query.empty?
|
|
48
54
|
|
|
55
|
+
keywords = query.split(/\s+/).reject(&:empty?)
|
|
56
|
+
return 0 if keywords.empty?
|
|
57
|
+
|
|
58
|
+
keywords.sum { |keyword| keyword_score(keyword) }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
private
|
|
62
|
+
|
|
63
|
+
def keyword_score(keyword)
|
|
49
64
|
score = 0
|
|
50
|
-
|
|
65
|
+
keyword_downcase = keyword.downcase
|
|
51
66
|
name_downcase = name&.downcase || ""
|
|
52
67
|
|
|
53
68
|
# Exact name match (highest priority)
|
|
54
|
-
if name_downcase ==
|
|
69
|
+
if name_downcase == keyword_downcase
|
|
55
70
|
score += 1000
|
|
56
|
-
# Name starts with
|
|
57
|
-
elsif name_downcase.start_with?(
|
|
71
|
+
# Name starts with keyword (prefix match)
|
|
72
|
+
elsif name_downcase.start_with?(keyword_downcase)
|
|
58
73
|
score += 500
|
|
59
|
-
# Name ends with
|
|
60
|
-
elsif name_downcase.end_with?(
|
|
74
|
+
# Name ends with keyword (suffix match)
|
|
75
|
+
elsif name_downcase.end_with?(keyword_downcase)
|
|
61
76
|
score += 400
|
|
62
|
-
# Name contains
|
|
63
|
-
elsif name_downcase.include?(
|
|
77
|
+
# Name contains keyword
|
|
78
|
+
elsif name_downcase.include?(keyword_downcase)
|
|
64
79
|
score += 100
|
|
65
80
|
end
|
|
66
81
|
|
|
67
|
-
# Brief contains
|
|
68
|
-
score += 50 if brief&.downcase&.include?(
|
|
82
|
+
# Brief contains keyword
|
|
83
|
+
score += 50 if brief&.downcase&.include?(keyword_downcase)
|
|
69
84
|
|
|
70
|
-
# Category contains
|
|
71
|
-
score += 30 if category&.downcase&.include?(
|
|
85
|
+
# Category contains keyword
|
|
86
|
+
score += 30 if category&.downcase&.include?(keyword_downcase)
|
|
72
87
|
|
|
73
|
-
# Remarks contains
|
|
74
|
-
score += 10 if remarks&.downcase&.include?(
|
|
88
|
+
# Remarks contains keyword
|
|
89
|
+
score += 10 if remarks&.downcase&.include?(keyword_downcase)
|
|
75
90
|
|
|
76
91
|
score
|
|
77
92
|
end
|
|
78
93
|
|
|
94
|
+
public
|
|
95
|
+
|
|
79
96
|
def source_urls
|
|
80
97
|
return nil unless source_file
|
|
81
98
|
# Header file URLs (include/cute_xxx.h)
|
data/lib/cf/mcp/version.rb
CHANGED